Sign in to follow this  

gluPerspective & z-buffer?

This topic is 4040 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi! I have a question about the depth buffer. When i use gluPerspective with a near and a far value, i thought that then the depthbuffer gets mapped between these two values. So decresing the range between near and far should also decrease z-fighting problems and vice versa. But somehow for me nothing changes . . . the far clipping changes, but the z-fighting for far objects stays the same... Do i need to set the mapping of the z_buffer somehow separately? thanks!

Share this post


Link to post
Share on other sites
The far clipping plane have virtually no influence at all on the precision distibution in the Z-buffer (assuming a far clip plane at least 100-1000 times the near clip plane). The near clip plane is much more important.

Check this for some information.

edit: To give you a feeling for how important the near clip plane is. Assume you have the near plane at 1 and the far plane at 1000. For a point at depth 500, changing the far clip plane to 1000000 (multiplied by 1000) has almost the same effect on precision loss as changing the near plane to 0.999.

Share this post


Link to post
Share on other sites

This topic is 4040 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this