X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=shaderlib%2Fambientocclusion_combine.glsl;h=c1e7f27270a1388703ac8cc744901278180f2ac3;hb=HEAD;hp=572ba2f14bcf73858c3b500d992ffebafa14d3db;hpb=e55f79ccb21e8c1be3d86f127e3ec1583e58ce92;p=libs%2Fgl.git diff --git a/shaderlib/ambientocclusion_combine.glsl b/shaderlib/ambientocclusion_combine.glsl deleted file mode 100644 index 572ba2f1..00000000 --- a/shaderlib/ambientocclusion_combine.glsl +++ /dev/null @@ -1,23 +0,0 @@ -import postprocess; -import ambientocclusion; - -////// fragment -void main() -{ - float sample = depth_ratio.x/(texture(depth, texcoord).r-depth_ratio.y); - float sum = 1.0; - float count = 1.0; - for(int i=0; i<=3; ++i) - for(int j=0; j<=3; ++j) - { - vec2 offs = vec2(float(i)-1.5, float(j)-1.5)/screen_size; - float dxy = length(offs)*-sample; - float dz = depth_ratio.x/(texture(depth, texcoord+offs).r-depth_ratio.y)-sample; - if(abs(dz)<3.0*dxy) - { - sum += texture(occlusion, texcoord+offs).r; - count += 1.0; - } - } - frag_color = texture(source, texcoord)*sum/count; -}