X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=builtin_data%2F_ambientocclusion_combine.glsl;h=2e9f75fc30595c05066c77c3c780718c24ed8d7a;hb=1e3b07299f798983ee0b861121a65ca2e8c8830a;hp=88929066b73f7cca9a77cc062223935522ce511a;hpb=d4312ccb1a73acecc57394b2c5230083b1f8b6a1;p=libs%2Fgl.git diff --git a/builtin_data/_ambientocclusion_combine.glsl b/builtin_data/_ambientocclusion_combine.glsl index 88929066..2e9f75fc 100644 --- a/builtin_data/_ambientocclusion_combine.glsl +++ b/builtin_data/_ambientocclusion_combine.glsl @@ -15,11 +15,11 @@ void main() vec2 offset = vec2(float(i), float(j))-1.5; vec2 sample_coord = texcoord+offset*tex_scale; float occ = texture(occlusion, sample_coord).r; - float sample = texture(depth, sample_coord).r; + float sample_depth = texture(depth, sample_coord).r; 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) + if(sample_depth>=min_depth && sample_depth<=max_depth) { sum += occ; count += 1.0;