Shadow volumes and nasty surfaces

Ok I have got a working shadow volume going, works quite well. What I want to know is there a way to get it to work sensibly with surfaces which are not closed volumes. The method I use so far treats the inner surfaces and outer surfaces seperately to produce 2 shadow volumes. But this causes duplication of shadow edges. Is there a more optimal way to do this?


Well, a variation of what you have now would be to increment/decrement the stencil buffer by 2 for shared silhouette edges, but only 1 for open silhouette edges. If you have cases where there are 3 or more faces sharing an edge, you have to treat them individually as open edges. This would work best if you used destination alpha as stencil (you can change the alpha color in a shader). We did this on the PS2 and it was magic.

Great, that sounds like a pretty neat idea. Now all I gotta do is mark how many times each edge is used. Great thanks for the help.