i have to render BIG images so i have divided the view frustum in parts, rendered them seperatly, read the pixels and composed the sub-image to one big image.
now i have rendered one scene in once, and then the same scene with my “frustum-composing-method”.
when i compare the two images by eye they look exactly the same. but when i make a difference image i see that they are different at some (single) pixels (ca. 800 pixel differences on a 800*600 image).
I have for each rendering method exactly the same modelview - matrix and same near,far-clip planes. z-buffering is enabled.
z-buffer is big enough (32 bit).
Rendering is done using software-renderer of window 98.
The scene consists of 20.000 triangles, flat-shaded.
Why is the scene rendered different when i compose the image of sub-images ?
Is there a way to guarentee that it is rendered exactly in the same way?
- Why is the scene rendered different when i compose the image of sub-images ?
That’s because floating-point computations are only of finite precision. Therefore you will have slight rounding errors here and there that might cause a pixel to be different occasionally when composing your image. You’re not using the same projection matrix for the whole image anymore but rather a couple of different matrices. Therefore the performed computations are slightly different and even though, assuming that you haven’t made a mistake, they should theoretically be equivalent, they are not due to the fact that computers cannot compute with full precision.
- Is there a way to guarentee that it is rendered exactly in the same way?
No. You might play around a bit with slightly different view frustums and get it right for one implementation/hardware/driver, though even that is very unlikely.
It’s not clear from your description what the specific error you are seeing is. One of the main problems with clipping in the scenario you are talking about can be invariance of color interpolation of lighting results, but if your hardware has perspective correct color interpolation the results will be OK. I’ve tested this in the past a consumer card and it was perspective correct, I don’t know what platform you’re on but some ‘high end’ systems don’t have perspective correct color interpolators. Texture coordinate and vertex precision during clipping is also sometimes an issue, it depends a lot on the numbers and guard band clipping limits etc.