Jump to content
  • Advertisement

Archived

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

iwaskia

depth-buffer value

This topic is 5896 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

i know the value is in the range of 0.0 to 1.0, what is the distance from to viewpoint of the depth-buffer value = 1.0 ? [edited by - iwaskia on April 29, 2002 5:17:06 PM]

Share this post


Link to post
Share on other sites
Advertisement
Please clarify your question, maybe with a code snippet that you are confused on.

As for z-buffering, if you enable it in opengl, you can test for the depth of your drawn objects. This is useful say when you draw 2 objects (say in orthoganal projection where the z values are zeroed out by the multiplication), one closer to the viewer , then draw the second object behind the first. With z-buffering off (with depth testing off) the second object you drew would appear to show up in front of the first object (or inside). With z-buffering on, the calculations of the z values are saved so when the objects are drawn, it can determine which objects should appear to the viewer, which in this example the first one would appear when it is rendered because the second one would have a z value further back then the first object.

Share this post


Link to post
Share on other sites
u mean gluPerspective ?
say,
gluPerspective( 45.0f, w/h, 2.0f, 1000.0f );

then value 0.0f -> 2.0f,
1.0f-> 1000.0f ?

Share this post


Link to post
Share on other sites
With that code above your depth buffer will operate in the range from 2 to 1000 (a bit big - could lead to some imprecision further away from the camera)

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!