Improved shadow stability

This commit is contained in:
Vincent Lejeune 2014-11-15 21:27:15 +01:00
parent 239a32b1d8
commit c2859d24ce
2 changed files with 3 additions and 3 deletions

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, 256.), 1.);
return min(pow(exp(-8. * d) * z, 32.), 1.);
}
void main() {

View File

@ -341,7 +341,7 @@ void PostProcessing::renderGaussian6BlurLayer(FrameBuffer &in_fbo)
FullScreenShader::ComputeShadowBlurVShader::getInstance()->SetTextureUnits(LayerTex);
glBindSampler(FullScreenShader::ComputeShadowBlurVShader::getInstance()->TU_dest, 0);
glBindImageTexture(FullScreenShader::ComputeShadowBlurVShader::getInstance()->TU_dest, irr_driver->getFBO(FBO_SCALAR_1024).getRTT()[0], 0, false, 0, GL_WRITE_ONLY, GL_R32F);
FullScreenShader::ComputeShadowBlurVShader::getInstance()->setUniforms(core::vector2df(1.f / 1024.f, 1.f / 1024.f), 1.f);
FullScreenShader::ComputeShadowBlurVShader::getInstance()->setUniforms(core::vector2df(1.f / 1024.f, 1.f / 1024.f), 1.5f);
glDispatchCompute((int)1024 / 8 + 1, (int)1024 / 8 + 1, 1);
glMemoryBarrier(GL_TEXTURE_FETCH_BARRIER_BIT | GL_SHADER_IMAGE_ACCESS_BARRIER_BIT);
@ -349,7 +349,7 @@ void PostProcessing::renderGaussian6BlurLayer(FrameBuffer &in_fbo)
FullScreenShader::ComputeShadowBlurHShader::getInstance()->SetTextureUnits(irr_driver->getFBO(FBO_SCALAR_1024).getRTT()[0]);
glBindSampler(FullScreenShader::ComputeShadowBlurHShader::getInstance()->TU_dest, 0);
glBindImageTexture(FullScreenShader::ComputeShadowBlurHShader::getInstance()->TU_dest, LayerTex, 0, false, 0, GL_WRITE_ONLY, GL_R32F);
FullScreenShader::ComputeShadowBlurHShader::getInstance()->setUniforms(core::vector2df(1.f / 1024.f, 1.f / 1024.f), 1.f);
FullScreenShader::ComputeShadowBlurHShader::getInstance()->setUniforms(core::vector2df(1.f / 1024.f, 1.f / 1024.f), 1.5f);
glDispatchCompute((int)1024 / 8 + 1, (int)1024 / 8 + 1, 1);
glMemoryBarrier(GL_SHADER_IMAGE_ACCESS_BARRIER_BIT);
}