I think this is now finding the different segments of the cascade
This commit is contained in:
FakeShemp
2016-02-18 20:48:39 +01:00
parent 178402e964
commit bf376f54b6
4 changed files with 230 additions and 110 deletions
+2 -2
View File
@@ -143,9 +143,9 @@ float random(vec3 seed, int i)
float CalcShadowValue(vec4 positionLightSpace, vec3 normal, vec3 lightDir, sampler2DShadow depthTexture)
{
float bias = 0.005;
//float bias = 0.005;
//float bias = max(0.05 * (1.0 - dot(normal, lightDir)), 0.005);
//float bias = 0.005 * tan(acos(clamp(dot(normal, -lightDir), 0.0, 1.0)));
float bias = 0.005 * tan(acos(clamp(dot(normal, -lightDir), 0.0, 1.0)));
vec3 projCoords = vec3(positionLightSpace.xy, positionLightSpace.z + bias) / positionLightSpace.w;
projCoords = projCoords * 0.5 + 0.5;