]> git.tdb.fi Git - libs/gl.git/blobdiff - shaderlib/ambientocclusion_combine.glsl
Fix some errors in the ambient occlusion shader
[libs/gl.git] / shaderlib / ambientocclusion_combine.glsl
index f33520f8aa05ae76bd25a0499cf86ae319b4fa26..f56bddbc520809cc37ca6ae8d0ca7753751907d6 100644 (file)
@@ -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);