]> git.tdb.fi Git - libs/gl.git/blobdiff - shaderlib/ambientocclusion_combine.glsl
Check the flat qualifier from the correct member
[libs/gl.git] / shaderlib / ambientocclusion_combine.glsl
diff --git a/shaderlib/ambientocclusion_combine.glsl b/shaderlib/ambientocclusion_combine.glsl
deleted file mode 100644 (file)
index f33520f..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-import postprocess;
-import ambientocclusion;
-
-////// fragment
-void main()
-{
-       vec3 center = unproject(vec3(vertex.xy, texture(depth, texcoord).r));
-       float min_depth = project(vec3(center.xy, center.z+occlusion_radius*0.1)).z;
-       float max_depth = project(vec3(center.xy, center.z-occlusion_radius*0.1)).z;
-       vec2 tex_scale = 1.0/vec2(textureSize(occlusion, 0));
-       float sum = 0.0;
-       float count = 0.0;
-       for(int i=0; i<4; ++i)
-               for(int j=0; j<4; ++j)
-               {
-                       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)
-                       {
-                               sum += occ;
-                               count += 1;
-                       }
-               }
-       vec4 src_color = texture(source, texcoord);
-       frag_color = vec4(src_color.rgb*mix(1.0, min(sum*2.0/count, 1.0), darkness), src_color.a);
-}