Jump to content
  • Advertisement
Sign in to follow this  
Nasam

OpenGL Not showing depth variation in depth buffer image

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

What I wanted is displaying depth information of the scene as an (bmp or tga ) image. I have used opengl API For this after reading depth value for a pixel from the depth buffer, same value is taken as R, G ,B for that pixel and written to the image file. This is giving correct result(grayscale image). For an object( say 3D teapot or 3D text) it is obvious that different pixels are at different depths if that object is slightly tilted. But it is not showing depth variation in this case( not showing different gray scale levels). Why this happens? And how to correct this error? Thanks in advance

Share this post


Link to post
Share on other sites
Advertisement
If you linearize it you can see more :-) or you just re-construct depth as shown in the many depth of field effects, then you can see lots of stuff in the depth buffer :-)
I actually do this to have a depth buffer preview on screen for debugging purposes.

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.

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

Sign me up!