Sign in to follow this  

Simple Shadow Map Sanity Check Please

Recommended Posts

Hi guys,


I'm working with simple shadow maps and can't see how they could ever be used, even with smoothing, but they are so I must be doing something wrong.


I have a pretty tight setup:



// The floor is 16x16 world units and the box height is 6 units.


Here is what happens with various depth bias values:




There is pretty much no way to tune it. I don't cull the back faces except for in the bottom-right image.


Does this look right to you ?


I know I should be using something like variance or exponential but I was having similar issues with those, either peter-panning or worse: massive self-shadowing.


Any help/info will be appreciated. Thanks.


Share this post

Link to post
Share on other sites

The last two shots look fine to me. The artifacts will vanish as soon as you have proper lighting - since you only apply the shadow term for actually lit surfaces (N dot L > 0).

Share this post

Link to post
Share on other sites

Hey unbird, I finally got it. No self-shadowing and no Peter Pans. It was like you said, I was applying the shadow term to everything and not just to (N dot L > 0), that was my problem all along. I setup a 3x3 filter too and it looks pretty good, so I'm on my way.


I'm going to try exponential now, you'll see me post again when I can't get it to work right :)


Thanks man.

Share this post

Link to post
Share on other sites

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