Shadowmap Oddity

Started by
3 comments, last by sipickles 17 years, 5 months ago
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.
Advertisement
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).
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).

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...
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!

This topic is closed to new replies.

Advertisement