Sign in to follow this  

Stopping concatenation of shadows generated by shadow volumes

This topic is 4743 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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();
}

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

This topic is 4743 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this