diff options
Diffstat (limited to 'advanced_lighting/9.ssao/ssao.frag')
-rw-r--r-- | advanced_lighting/9.ssao/ssao.frag | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/advanced_lighting/9.ssao/ssao.frag b/advanced_lighting/9.ssao/ssao.frag index e4d04b1..dd03754 100644 --- a/advanced_lighting/9.ssao/ssao.frag +++ b/advanced_lighting/9.ssao/ssao.frag @@ -13,7 +13,7 @@ uniform sampler2D noise; uniform vec3 samples[64]; uniform mat4 projection; -const vec2 noise_scale = vec2(1600.0 / 4.0, 900.0 / 4.0) +const vec2 noise_scale = vec2(1600.0 / 4.0, 900.0 / 4.0); void main() { @@ -37,8 +37,8 @@ void main() offset.xyz /= offset.w; offset.xyz = offset.xyz * 0.5 + 0.5; float depth = texture(positions, offset.xy).z; - // float range_check = smoothstep(0.0, 1.0, radius / abs(position.z - depth)); - occlusion += (depth >= sample.z + bias ? 1.0 : 0.0); // * range_check; + float range_check = smoothstep(0.0, 1.0, radius / abs(position.z - depth)); + occlusion += (depth >= sample.z + bias ? 1.0 : 0.0) * range_check; } occlusion = 1.0 - (occlusion / nsamples); frag_color = occlusion; |