I’m trying to render the earth using a quadtree (independent sections) in a planar projection (I can’t make use of the earth curvature). That means my desired frustum is from 1 to about 24000000 to be able to see the entire earth plane sitting in one corner very near the ground to the other corner of the earth plane. Obviously I’m having z-fighting issues (as well as jitter due to float precision, but that is another matter).
I tried the method explained in the page 45 of this pdf :
- Set zFar to the maximum value needed.
- Set zNear = zFar / ratio.
- Clear z-buer.
- Render scene and cull to the adjusted frustum.
- Set zFar = zNear.
- If zNear isn’t close enough yet go back to step 2.
But I’m getting problems in the zone where the two frustums touch, it looks like this and I can’t figure out what’s going wrong. I render the image in two passes, one with a different frustum from 50 to 50000000 and from 1 to 50, as mentioned in the pdf, clearing the zbuffer in between.
Do you have any idea of what I’m doing wrong?
I’d also appreciate suggestions on alternative aproaches.