Sign in to follow this  

Depth Texture and some Qs

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

This topic is 4339 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this