Tweak shadow blur

This commit is contained in:
Vincent Lejeune 2014-11-18 03:44:45 +01:00
parent dd0c98fd16
commit c594295288
5 changed files with 6 additions and 6 deletions

View File

@ -17,5 +17,5 @@ void main(void)
vec4 col = texture(tex, uv);
#endif
if (col.a < 0.5) discard;
FragColor = vec4(exp(8. * (2. * gl_FragCoord.z - 1.) / gl_FragCoord.w));
FragColor = vec4(exp(32. * (2. * gl_FragCoord.z - 1.) / gl_FragCoord.w));
}

View File

@ -2,5 +2,5 @@ out vec4 FragColor;
void main()
{
FragColor = vec4(exp(8. * (2. * gl_FragCoord.z - 1.) / gl_FragCoord.w));
FragColor = vec4(exp(32. * (2. * gl_FragCoord.z - 1.) / gl_FragCoord.w));
}

View File

@ -12,5 +12,5 @@ void main(void)
{
vec4 col = texture(tex, uv);
if (col.a < 0.5) discard;
FragColor = vec4(exp(8. * (2. * gl_FragCoord.z - 1.) / gl_FragCoord.w));
FragColor = vec4(exp(32. * (2. * gl_FragCoord.z - 1.) / gl_FragCoord.w));
}

View File

@ -34,7 +34,7 @@ float getShadowFactor(vec3 pos, float bias, int index)
float z = texture(shadowtex, vec3(shadowtexcoord, float(index))).x;
float d = shadowcoord.z;
return min(pow(exp(-8. * d) * z, 32.), 1.);
return min(pow(exp(-32. * d) * z, 8.), 1.);
}
void main() {

View File

@ -1034,8 +1034,8 @@ void IrrDriver::renderShadows()
for (unsigned i = 0; i < 2; i++)
{
m_post_processing->renderGaussian6BlurLayer(m_rtts->getShadowFBO(), i,
1.5f * m_shadow_scales[0].first / m_shadow_scales[i].first,
1.5f * m_shadow_scales[0].second / m_shadow_scales[i].second);
2.f * m_shadow_scales[0].first / m_shadow_scales[i].first,
2.f * m_shadow_scales[0].second / m_shadow_scales[i].second);
}
}
glBindTexture(GL_TEXTURE_2D_ARRAY, m_rtts->getShadowFBO().getRTT()[0]);