Stopping concatenation of shadows generated by shadow volumes

Started by
4 comments, last by mohamed adel 19 years, 4 months ago
Hey, I've recently implimented stencil shadow volumes and all is working hunky dory apart from overly darkened regions of shadow caused by shadows from multiple occluding objects concatenating. This isn't physically correct (I know shadow volumes aren't either but that's a different matter ;)) and so want to stop it from occurring. I have read that it is not possible, that this is a disadvantage to the technique but I have also seen it solved in an implimentation that uses vertex shaders. Is there is a way to stop such concatenation without use of vertex shaders?
Advertisement
Surely shadows shadowing over the same areas is a good thing, especially if it gets darker each time. Isn't this realistic?

ace
It would be good if an occluding object's shadow was blocking the light from multiple sources and this caused the darker shadowed area. But in this case for multiple objects blocking a single light source the shadow should be uniform shade. I am creating just an umbra part of a shadow, which is binary in it's result (either the area is lit or shadowed), if a shadowed region is blocked from the single light source again by a further object, then there is no further light to block so the area should have the same shading. Right?

hmm i'm not so sure now... i'm making shadows on my bedroom wall now testing it... it isn't helping :P
Hmm...my advice is to simply not do the "draw black where the sencil is set" step until all the shadows have been written to the stencil buffer.

ie:
For each Light{  ClearStencil();    For Each Object  {     DrawShadowIntoStencilBuffer();  }    DrawBlackWhereStencilIsSet();}
Waramp.Before you insult a man, walk a mile in his shoes.That way, when you do insult him, you'll be a mile away, and you'll have his shoes.
that sounds like it should work, i'll give it a whirl. Thanks.
Don't draw black where stencil is set,instead render using only ambient light.this would give a more realistic effect than just drawing black reigons.also this would increase the performance as you save cycles used in calculating the diffuse component.

This topic is closed to new replies.

Advertisement