- 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)
+ 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)