Jump to content
  • Advertisement
Sign in to follow this  

Depth Buffer to NDC space

This topic is 3173 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 im rendering to an FBO using the GL_DEPTH_COMPONENT24 depth format to take the depth buffer values into a texture. I've got the values and they are right but they arent in normalized clip space (i.e. in the range of -1 to +1) so i have no idea where my furthest depth and closest depth are. Previously I obtained the depth in NDC space by using a shader to transform my vertices into clip space through the worldviewProj matrix and then in a pixel shader determined the length of the vector. Does anyone know how to transform the depth from whatever range it is in from GL_DEPTH_COMPONENT24 to a normalized clip space value? thanks

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!