Archived

This topic is now archived and is closed to further replies.

Michalson

Depth fighting when using small FOV values

Recommended Posts

I''m experiencing problems when using gluPerspective with a very small FOV value (<10). While the model I''m rendering is fine at any distance, when zoomed by decreasing FOV it has depth sorting problems. Any ideas? Is this normal behavoir?

Share this post


Link to post
Share on other sites
I don''t think the FOV is the main cause, but because it makes the frustum appear "stretched" the resolution of the z-buffer might appear even lower.


"Gay marriage will encourage people to be gay, in the same way that hanging around tall people will make you tall." - Grizwald

Share this post


Link to post
Share on other sites
Also found this (which is helpful for my particular problem, which is rendering a several km wide area and being able to zoom in [scope])

quote:

12.080 There is no way that a standard-sized depth buffer will have enough precision for my astronomically large scene. What are my options?

The typical approach is to use a multipass technique. The application might divide the geometry database into regions that don''t interfere with each other in Z. The geometry in each region is then rendered, starting at the furthest region, with a clear of the depth buffer before each region is rendered. This way the precision of the entire depth buffer is made available to each region.

Share this post


Link to post
Share on other sites
I assume you requested a 24-bit z buffer in your PFD? Failing that, a good rule of thumb is to put your near clip plane as far away as you can cope with, and move your far clip to the minimum you can cope with.

If all that fails then it might be worth resorting to z buffer tricks. The method I use in my flight sim is to render the environment with a near depth set to about 20, far depth at 20000, and then render the cockpit with closer near and far clip planes, but with glDepthRange set to [-1:0]. Obviously this only works if you can partition your geometry into near and far without any overlaps.

Share this post


Link to post
Share on other sites