Almost have "fail-pass" shadow volume working perfectly

Started by
2 comments, last by howie_007 14 years, 4 months ago
It all seems to be working perfectly except for one minor issue Looks like it's working fine here... looks good here But if you view it this way, you see part of the shadow cap from the other shadow through this object. looks good here I've tried numerous test to try to figure out the problem. Could this just be a side effect to the "fail_pass" method?
Advertisement
Do you draw all objects first, then draw all shadows?
Do you disable depth writes correctly when drawing shadows?
It's not a side-effect, and should definitely work correctly. Is it the same scene as in the first picture, viewed from another angle, or have the objects moved so they are intersecting?
I got lucky and figured out the problem.

After much examination, I noticed I couldn't see one of the objects through the cube like the second screen shot. So the question was, why not this one?

The solution: The last render pass of your objects that are casting a shadow, need to be sorted in z order. closest to the farthest. This anomaly is removed by the z-buffer.

Finally, we have "fail-pass" shadows working. I've lost a bunch of hair over these shadows. Now if you could do this without rendering the shadow objects twice.
Quote:Original post by Erik Rufelt
Do you draw all objects first, then draw all shadows?
Do you disable depth writes correctly when drawing shadows?
It's not a side-effect, and should definitely work correctly. Is it the same scene as in the first picture, viewed from another angle, or have the objects moved so they are intersecting?


I saw your post right after the above post. Thanks for your help!

This topic is closed to new replies.

Advertisement