Fixed some shadow buggs.

This commit is contained in:
Tleety
2014-05-12 23:02:19 +02:00
parent 4639a6e4c3
commit ccd1393dac
2 changed files with 11 additions and 8 deletions
+4 -1
View File
@@ -17,7 +17,10 @@ out vec4 frag_Normal;
float Shadow(vec4 ShadowCoord)
{
if( texture(ShadowTexture, Input.ShadowCoord.xy).z < ShadowCoord.z )
//float cosTheta = clamp(dot(Input.Normal, 1.0), 0.0, 1.0);
float bias = 0.0005; // cosTheta is dot( n,l ), clamped between 0 and 1
bias = clamp(bias, 0.0, 0.01);
if( texture(ShadowTexture, Input.ShadowCoord.xy).z < ShadowCoord.z - bias)
{
return 0.3;
}