Increase shadow filtering
This commit is contained in:
parent
ab82e3f62a
commit
ee687440c7
@ -43,11 +43,12 @@ float getShadowFactor(vec3 pos, float bias, int index)
|
||||
//float shadowmapz = 2. * texture(shadowtex, vec3(shadowtexcoord, shadowcoord.z).x - 1.;
|
||||
// bias += smoothstep(0.001, 0.1, moved) * 0.014; // According to the warping
|
||||
float sum = 0.;
|
||||
for (int i = 0; i < 4; i++)
|
||||
for (float i = -1.5; i <= 1.5; i+= 1.)
|
||||
{
|
||||
sum += texture(shadowtex, vec4(shadowtexcoord + shadowoffset[i] / 2048., float(index), 0.5 * shadowcoord.z + 0.5));
|
||||
for (float j = -1.5; j <= 1.5; j+= 1.)
|
||||
sum += texture(shadowtex, vec4(shadowtexcoord +vec2(i, j) / 1024., float(index), 0.5 * shadowcoord.z + 0.5));
|
||||
}
|
||||
return sum / 4.;
|
||||
return sum / 16.;
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
@ -978,6 +978,8 @@ void IrrDriver::renderShadows()
|
||||
glDepthMask(GL_TRUE);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glDisable(GL_BLEND);
|
||||
glEnable(GL_CULL_FACE);
|
||||
glCullFace(GL_FRONT);
|
||||
glEnable(GL_POLYGON_OFFSET_FILL);
|
||||
glPolygonOffset(1.5, 0.);
|
||||
m_rtts->getShadowFBO().Bind();
|
||||
@ -1022,6 +1024,7 @@ void IrrDriver::renderShadows()
|
||||
}
|
||||
|
||||
glDisable(GL_POLYGON_OFFSET_FILL);
|
||||
glCullFace(GL_BACK);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user