Added a hack that removes ugly lines when shadows are enabled.

Mathematically it's not 100% correct, but it looks much better.
This commit is contained in:
Deve 2017-02-07 21:48:50 +01:00
parent 77ff387f6b
commit 5df2531a65

View File

@ -35,7 +35,11 @@ float getShadowFactor(vec3 pos, int index)
for (float i = -1.; i <= 1.; i += 1.)
{
for (float j = -1.; j <= 1.; j += 1.)
result += texture(shadowtex, vec4(shadowtexcoord + vec2(i,j) / shadow_res, float(index), d));
{
// result += texture(shadowtex, vec4(shadowtexcoord + vec2(i,j) / shadow_res, float(index), d));
// Added a hack with j+1. to avoid ugly lines
result += texture(shadowtex, vec4(shadowtexcoord + vec2(i,j+1.) / shadow_res, float(index), d));
}
}
return result / 9.;