Game Development Community

Shadow bug in BL (T3D 1.0)

by Ivan Mandzhukov · in Torque 3D Professional · 10/03/2009 (1:35 pm) · 4 replies

Shadow renders over the meshes.
It could be seen when the camera is moved a distance up from the player.
Gideon has brown shoes by default,so it couldn't be seen very well, that's why i changed them to white.

img134.imageshack.us/img134/1271/blshadowbug.jpg
I am not very familiar how the shadow works,so any suggestions are highly appriciated.
I do want this fixed really soon.

#1
10/04/2009 (5:47 am)
Well,the shadow is some sort of special decal.
It renders over the mesh,it filters through a filter.
The mesh became visible with a filter.
So the problem seems to be a bad filtering.

But i am still stuck.
T3D pass rendering is new for me,there is no even a documentation on it.
I can not locate the problem.
#2
10/04/2009 (7:00 am)
That is probably the decal bias, which you can adjust as a field in LevelInfo. A smaller number will rise up less as you zoom out, but it will also zfight more at a distance.
#3
10/04/2009 (7:02 am)
Hum, you know since projected-shadows fade out at a distance anyway it would make sense to use a much smaller bias for them than regular decals.
#4
10/04/2009 (7:14 am)
Thank you, James.
This helped a lot.

By the way i found a second problem.
Sometimes the shadow gets white colored,caused by the sun's ambient.
As we know shadow is black when there is no sun, and gets grey when there is a sun.
So we should clamp the color: from [0;1] to [0,0.5]

in projectedShadowP.hlsl

Out.rgb = ambient.rgb * lum;
should be changed to :
Out.rgb = ambient.rgb * lum - 0.5;

Now shadow is always grey when playing with different values of the ambient light.