Sign in to follow this  

Multiple depth shadows

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

Hello, I have depth shadows working ok for one light, and i am trying to render 2 lights, each light having its own depth texture. The problem is, that only the shadows for the last light work, the 1st lights shadows simply don't appear, as if the 1st depth texture has been cleared. Both sets of shadows work individually very well, and i can toggle between each light perfectly. My rendering path is to: Render both lights depth textures Render each light, blending with GL_ONE,GL_ONE im using glCopyTexImage2D() to copy the depth buffer, and cG for the shadow comparison/shading etc etc Anyone know whats going on? Munch

Share this post


Link to post
Share on other sites
Ok here an image, soz for the crappy explanation so far :)


It may be worth noting that when rendering one light, doing two shadow passes (but just using one) causes the shadows for that one light to dissapear.

Share this post


Link to post
Share on other sites
I have tracked the problem down, although i'm not sure why this is. It seems when using 2 depth textures, when i render to the second depth texture the contents of the first are cleared.

ive tried both:
glCopyTexImage2D() +
glCopyTexSubImage2D()

but the results are the same. Ive checked that im using different depth textures, and that they actually are textures (glIsTexture), both appear fine.

arrgghh need help :)

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I'm pretty sure you have to capture each light's depth information on separate texture units, that is why the next copyImage call is overwriting the first.

Share this post


Link to post
Share on other sites

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