SSAO: Disable alpha test and simplify code

This commit is contained in:
Vincent Lejeune 2014-01-27 00:53:52 +01:00
parent 993d1e26dc
commit 684d265924
2 changed files with 2 additions and 1 deletions

View File

@ -53,7 +53,7 @@ void main(void)
vec4 occluderPos = invprojm * vec4(sampleProj.xy, 2.0 * occluderFragmentDepth - 1.0, 1.0f); vec4 occluderPos = invprojm * vec4(sampleProj.xy, 2.0 * occluderFragmentDepth - 1.0, 1.0f);
occluderPos /= occluderPos.w; occluderPos /= occluderPos.w;
bool isOccluded = isInsideTexture && (sampleProj.z > (2. * occluderFragmentDepth - 1.0)) && (distance(FragPos, occluderPos) < radius); bool isOccluded = isInsideTexture && (sampleProj.z > (2. * occluderFragmentDepth - 1.0));
bl += isOccluded ? smoothstep(radius, 0, distance(samplePos, FragPos)) : 0.; bl += isOccluded ? smoothstep(radius, 0, distance(samplePos, FragPos)) : 0.;
} }

View File

@ -531,6 +531,7 @@ void PostProcessing::renderSSAO(const core::matrix4 &invprojm, const core::matri
{ {
glDisable(GL_DEPTH_TEST); glDisable(GL_DEPTH_TEST);
glDisable(GL_BLEND); glDisable(GL_BLEND);
glDisable(GL_ALPHA_TEST);
glUseProgram(FullScreenShader::SSAOShader::Program); glUseProgram(FullScreenShader::SSAOShader::Program);
glBindVertexArray(FullScreenShader::SSAOShader::vao); glBindVertexArray(FullScreenShader::SSAOShader::vao);