From 6f9ab1f55fd54beab7f0999a69b80ef92fe63722 Mon Sep 17 00:00:00 2001 From: pryazha Date: Tue, 15 Jul 2025 16:15:26 +0500 Subject: finish ssao --- advanced_lighting/9.ssao/ssao.frag | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'advanced_lighting/9.ssao/ssao.frag') 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; -- cgit v1.2.3-70-g09d2