Multiple depth shadows

Started by
5 comments, last by GameDev.net 19 years, 2 months ago
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
Advertisement
a screen shot or two would be handy...
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.
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 :)
hmmm post some relivent bits of code...
that picture looks ok (itll be easier if u draw the light positions)
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.

This topic is closed to new replies.

Advertisement