Jump to content
  • Advertisement
Sign in to follow this  
Black Knight

Depth Texture and some Qs

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

Hey people, I have created a depth texture in my app. With GL_DEPTH_COMPONENT and then I read the screen into it with :
glBindTexture(GL_TEXTURE_2D, m_pWater->getDepthTextureName());
glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, 0, 20,m_iReflectionSize, m_iReflectionSize, 0);
Now I want to be sure if I make it correct and want to display it on the screen as a 2d quad.But when I do it all I get is a pure white quad.Does the depth texture contain any color info?I think my code is correct I set the viewport before rendering to the texture I create the RTT at the beginning with 1 channel and again GL_DEPTH COMPONENT.What may be wrong?

Share this post


Link to post
Share on other sites
Advertisement
Well,I read through the forums and found my problem was this :
http://www.gamedev.net/community/forums/topic.asp?topic_id=308064

So I changed the near plane before I draw the scene for the depth texture and now my depth texture looks better.

And here is how it looks with water.
ingame12
ingame12
ingame14
ingame15

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!