]> git.tdb.fi Git - libs/gl.git/blobdiff - shaderlib/ambientocclusion_combine.glsl
Make ambient occlusion edge detection threshold adjustable
[libs/gl.git] / shaderlib / ambientocclusion_combine.glsl
index 05aea60a6c811d3f802f6a2df53db08a99597d6d..c1e7f27270a1388703ac8cc744901278180f2ac3 100644 (file)
@@ -15,7 +15,7 @@ void main()
                        vec2 sample_coord = texcoord+offset*tex_scale;
                        float occ = texture(occlusion, sample_coord).r;
                        float sample = texture(depth, sample_coord).r;
-                       float z_range = occlusion_radius*length(offset)*0.1;
+                       float z_range = occlusion_radius*length(offset)*edge_depth_threshold;
                        float min_depth = project(vec3(center.xy, center.z+z_range)).z;
                        float max_depth = project(vec3(center.xy, center.z-z_range)).z;
                        if(sample>=min_depth && sample<=max_depth)