Advertisement Jump to content
Sign in to follow this  
deadstar

Visualising the depth buffer using GL_INTENSITY

This topic is 3656 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'm playing around with FBO's and post processing, and I'd like to render the depth buffer acquired with an FBO to a texture and draw it to a quad. I've Googled around, and seen the term "bind to it a GL_INTENSITY texture" being thrown around a few times, but no clue as to how I go about doing that. How can I bind my depth texture to GL_INTENSITY? Thanks in advance

Share this post


Link to post
Share on other sites
Advertisement
All you need to do is just call glBindTexture() with the id you setup for your depth texture in the FBO and make sure you have the correct mode setup

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_NONE);

when you want to see the results. and enable them again when you render to the object.

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_R_TO_TEXTURE);

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!