]> git.tdb.fi Git - libs/gl.git/blobdiff - shaderlib/ambientocclusion_occlude.glsl
Check the flat qualifier from the correct member
[libs/gl.git] / shaderlib / ambientocclusion_occlude.glsl
diff --git a/shaderlib/ambientocclusion_occlude.glsl b/shaderlib/ambientocclusion_occlude.glsl
deleted file mode 100644 (file)
index 6d04d43..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-import postprocess;
-import ambientocclusion;
-
-////// fragment
-void main()
-{
-       vec4 rv = texture(rotate, gl_FragCoord.xy/4.0)*2.0-1.0;
-       mat3 transform = mat3(rv.xy, 0.0, rv.zx, 0.0, 0.0, 0.0, rv.w)*occlusion_radius;
-       vec3 center = unproject(vec3(vertex.xy, texture(depth, texcoord).r));
-       float min_depth = project(vec3(center.xy, center.z+occlusion_radius)).z;
-       float occlusion_sum = 0.0;
-       float count = 0.0;
-       for(int i=0; i<n_samples; ++i)
-       {
-               vec3 psp = project(center+transform*sample_points[i]);
-               float sample = texture(depth, psp.xy*0.5+0.5).r;
-               if(sample>=min_depth)
-               {
-                       if(sample<psp.z)
-                               occlusion_sum += 1.0;
-                       count += 1.0;
-               }
-       }
-       frag_color = vec4(1.0-occlusion_sum/count, 0.0, 0.0, 1.0);
-}