From a9e9384165af85a93ce7a7297ddf0ddc25ca9034 Mon Sep 17 00:00:00 2001 From: Faerbit Date: Mon, 9 Mar 2015 22:33:10 +0100 Subject: [PATCH] Decreased bias for point light shadows. --- data/shader/phong.fsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/shader/phong.fsh b/data/shader/phong.fsh index f069c03..a730177 100644 --- a/data/shader/phong.fsh +++ b/data/shader/phong.fsh @@ -133,7 +133,7 @@ float samplePointShadow(samplerCubeShadow shadowMap, vec3 lightDirection) { float B = -2*(farPlane*nearPlane)/(farPlane - nearPlane); float compValue = 0.5*(-A*length(lightDirection) + B)/length(lightDirection) + 0.5; float bias = 0.001*tan(acos(clamp(dot(vNormal, lightDirection), 0.0, 1.0))); - bias = clamp(bias, 0.0, 0.001); + bias = clamp(bias, 0.0, 0.0005); return texture(shadowMap, vec4(lightDirection , compValue - bias)); }