From 12f65b4a7cd9739d399c685d22862297f325ca91 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Fri, 6 Jan 2017 16:26:53 +0200 Subject: [PATCH] Fix some errors in the ambient occlusion shader --- shaderlib/ambientocclusion_combine.glsl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/shaderlib/ambientocclusion_combine.glsl b/shaderlib/ambientocclusion_combine.glsl index f33520f8..f56bddbc 100644 --- a/shaderlib/ambientocclusion_combine.glsl +++ b/shaderlib/ambientocclusion_combine.glsl @@ -15,11 +15,11 @@ void main() { vec2 offset = vec2(float(i)-1.5, float(j)-1.5)*tex_scale; float occ = texture(occlusion, texcoord+offset).r; - float depth = texture(depth, texcoord+offset).r; - if(depth>=min_depth && depth<=max_depth) + float sample = texture(depth, texcoord+offset).r; + if(sample>=min_depth && sample<=max_depth) { sum += occ; - count += 1; + count += 1.0; } } vec4 src_color = texture(source, texcoord); -- 2.43.0