Tweak shadows CSM split.

This commit is contained in:
vlj 2014-04-20 02:01:29 +02:00
parent fde29887f0
commit 87248b46f3
2 changed files with 14 additions and 8 deletions

View File

@ -100,20 +100,26 @@ void main() {
} }
else if (xpos.z < 20.) else if (xpos.z < 20.)
factor = getShadowFactor(xpos.xyz, bias, 1); factor = getShadowFactor(xpos.xyz, bias, 1);
else if (xpos.z < 30.) else if (xpos.z < 21.)
{ {
float a = getShadowFactor(xpos.xyz, bias, 1), b = getShadowFactor(xpos.xyz, bias, 2); float a = getShadowFactor(xpos.xyz, bias, 1), b = getShadowFactor(xpos.xyz, bias, 2);
factor = mix(a, b, (xpos.z - 20.) / 10.); factor = mix(a, b, (xpos.z - 20.));
} }
else if (xpos.z < 50.) else if (xpos.z < 50.)
factor = getShadowFactor(xpos.xyz, bias, 2); factor = getShadowFactor(xpos.xyz, bias, 2);
else if (xpos.z < 70.) else if (xpos.z < 55.)
{ {
float a = getShadowFactor(xpos.xyz, bias, 2), b = getShadowFactor(xpos.xyz, bias, 3); float a = getShadowFactor(xpos.xyz, bias, 2), b = getShadowFactor(xpos.xyz, bias, 3);
factor = mix(a, b, (xpos.z - 50.) / 20.); factor = mix(a, b, (xpos.z - 50.) / 5.);
}
else if (xpos.z < 145.)
factor = getShadowFactor(xpos.xyz, bias, 3);
else if (xpos.z < 150.)
{
factor = mix(getShadowFactor(xpos.xyz, bias, 3), 1., (xpos.z - 145.) / 5.);
} }
else else
factor = getShadowFactor(xpos.xyz, bias, 3); factor = 1.;
Diff = vec4(factor * NdotL * col, 1.); Diff = vec4(factor * NdotL * col, 1.);
Spec = vec4(factor * Specular, 1.); Spec = vec4(factor * Specular, 1.);
return; return;

View File

@ -559,9 +559,9 @@ void IrrDriver::computeCameraMatrix(scene::ICameraSceneNode * const camnode,
float FarValues[] = float FarValues[] =
{ {
6., 6.,
30., 21.,
70., 55.,
oldfar, 150.,
}; };
float NearValues[] = float NearValues[] =
{ {