Depth fighting when using small FOV values

Started by
4 comments, last by Michalson 20 years, 1 month ago
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?
Advertisement
i dunno if its normal behaviour, however to fix it you might want to try changing the depth buffer range as you zoom in so you''ve got a smaller range, this could help the fighting
Yep. I was using a near value very close to zero.
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
-~-The Cow of Darkness-~-
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.
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.

____________________________________________________________www.elf-stone.com | Automated GL Extension Loading: GLee 5.00 for Win32 and Linux

This topic is closed to new replies.

Advertisement