View Full Version : [Shadow Volume] Why models should be closed?

01-13-2004, 11:54 PM
I have read "Practical and Robust Stenciled Shadow Volumes for Hardware-Accelerated Rendering".

And they wrote: "Unless specially handled, such polygonal models must be closed (2-mainifold)..."

Why? Where is the problem?

01-14-2004, 01:14 AM
You'll end up with irregularities in the shadows, and long lines of shadow which shouldnt exist appearing in places.

It is very simple to overcome this though, so dont let it bother you too much.

01-14-2004, 02:03 AM
DopeFish : how do you overcome this so simply ?

01-14-2004, 03:07 AM
But what's the source of the problem?

01-14-2004, 04:07 AM
The pb is what's called a T-junction. See this picture : http://tfpsly.planet-d.net/Files/Tjunction.gif

Even if the edges AE,EC and AC are aligned, due to computation roundup, the planes that you cast through these edges will not be exactly the same and they won't compensate themselves.

01-14-2004, 05:07 AM

01-14-2004, 05:22 AM
The critically important thing is that the shadow volume be closed.

It's convenient to make this happen if the models from which shadow volumes are generated are closed, but as DopeFish points out, it's easy to work around if that's not the case.

Note: You might think that shadow volumes need not be closed in the case of zpass since you don't render the caps. However, it's better to think of that of an optimization, since the caps simply wouldn't affect the stencil count in zpass.

T-junctions are an issue only insofar as they cannot be guaranteed to produce closed (water-tight) shadow volumes.

Thanks -