Revert "SSAO: Remove the strenght parameter"

This reverts commit b92f0b6eccdcff209d5fdabaeb4efc2ae6f3a68c.
This commit is contained in:
Vincent Lejeune 2014-01-27 00:52:20 +01:00
parent 63882318a7
commit 993d1e26dc

View File

@ -8,11 +8,12 @@ uniform vec4 samplePoints[16];
in vec2 uv;
out vec4 FragColor;
const float strengh = 4.;
const float radius = .4f;
#define SAMPLES 16
const float invSamples = 1. / SAMPLES;
const float invSamples = strengh / SAMPLES;
vec3 rand(vec2 co)
{
@ -52,7 +53,7 @@ void main(void)
vec4 occluderPos = invprojm * vec4(sampleProj.xy, 2.0 * occluderFragmentDepth - 1.0, 1.0f);
occluderPos /= occluderPos.w;
bool isOccluded = isInsideTexture && (sampleProj.z > (2. * occluderFragmentDepth - 1.0));
bool isOccluded = isInsideTexture && (sampleProj.z > (2. * occluderFragmentDepth - 1.0)) && (distance(FragPos, occluderPos) < radius);
bl += isOccluded ? smoothstep(radius, 0, distance(samplePos, FragPos)) : 0.;
}