Sign in to follow this  
sipickles

Shadowmap Oddity

Recommended Posts

Hi, my shadow map is displaying some (more) weird behaviour. I have a test area, with a large plane, 4 static flat boxes and a ship I can move about. All objects use the same parallel split shadow mapping shader (except there is only a single shadowmap for debugging purposes.) The shadow texture looks good now. However, there is a problem The ship and boxes will cast shadows onto the plane. The ship will cast shadows onto the box. Like this: However, the box doesn't cast shadows onto the ship! You can see how the two shadows are overlapping on the plane, but where is the shadow on the ship?? (The other shadows you can see in the background are from other boxes) Its like the depth test isnt working in this instance. The first picture shows that the depth resolution is adequate to shadow opjects so close together. Any ideas welcome, I am stumped by this one.

Share this post


Link to post
Share on other sites
What type of precision are you using for your shadow maps? There is the possibility that they are too close, the depth for each gets converted to the same integer value (from it's floating point value). Have you tried using floating point textures for the shadow maps, or decreasing the depth range (to incrase the possible values between the local depths).

Share this post


Link to post
Share on other sites
Thanks for the reply.

I am using D3DFMT_R32F for the shadowmap, and the depth of the lights frustum is shaved to be as small as possible to increase precision (as is the way with PSSMing).

Its not easy to tell, but I would say in the top picture, the two objects are closer, almost touching, while in the second picture they are clearly further apart.

It MUST be a precision thing tho, I can't see any other logical reason, (which probably means there are several).

Share this post


Link to post
Share on other sites
Does your ship have self shadowing? it's not clear from the pics.
Also, are you drawing the ship with the same shadow shader as the boxes?
Just a long shot though...

Share this post


Link to post
Share on other sites
After trying various other shapes like a torus, I can confirm self shadowing is taking place. It is using the same shaders as the other geometry.

hurrumpf!

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