From c8844486fabef5f8109801bd953ad156bcd4b8dc Mon Sep 17 00:00:00 2001 From: Vincent Lejeune Date: Mon, 10 Feb 2014 15:58:09 +0100 Subject: [PATCH] Shadow: Tweak bias --- data/shaders/sunlightshadow.frag | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/shaders/sunlightshadow.frag b/data/shaders/sunlightshadow.frag index 88e4173e6..e29828785 100644 --- a/data/shaders/sunlightshadow.frag +++ b/data/shaders/sunlightshadow.frag @@ -45,14 +45,14 @@ float getShadowFactor(vec3 pos, float bias) //float shadowmapz = 2. * texture(shadowtex, vec3(shadowtexcoord, shadowcoord.z).x - 1.; // bias += smoothstep(0.001, 0.1, moved) * 0.014; // According to the warping - return texture(shadowtex0, vec3(shadowtexcoord, 0.5 * (shadowcoord.z + bias) + 0.5)); + return texture(shadowtex0, vec3(shadowtexcoord, 0.5 * (shadowcoord.z + bias * 0.001) + 0.5)); } else if (pos.z < 60) { vec4 shadowcoord = (shadowmat1 * vec4(pos, 1.0)); shadowcoord /= shadowcoord.w; vec2 shadowtexcoord = shadowcoord.xy * 0.5 + 0.5; - return texture(shadowtex1, vec3(shadowtexcoord, 0.5 * (shadowcoord.z + bias) + 0.5)); + return texture(shadowtex1, vec3(shadowtexcoord, 0.5 * (shadowcoord.z + bias * 0.001) + 0.5)); } else {