X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=shaderlib%2Fambientocclusion_combine.glsl;h=1e8bd821d48d1fa4b2ad749dd19bd4ad0b01d6ec;hb=e16855bccb78c721e2fe3f2ea8fc0310e041cb43;hp=f33520f8aa05ae76bd25a0499cf86ae319b4fa26;hpb=1b9640375606a305f19c76cf15406202322b5bdf;p=libs%2Fgl.git diff --git a/shaderlib/ambientocclusion_combine.glsl b/shaderlib/ambientocclusion_combine.glsl index f33520f8..1e8bd821 100644 --- a/shaderlib/ambientocclusion_combine.glsl +++ b/shaderlib/ambientocclusion_combine.glsl @@ -1,7 +1,7 @@ import postprocess; import ambientocclusion; -////// fragment +#pragma MSP stage(fragment) void main() { vec3 center = unproject(vec3(vertex.xy, texture(depth, texcoord).r)); @@ -15,11 +15,11 @@ void main() { 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) + float sample = texture(depth, texcoord+offset).r; + if(sample>=min_depth && sample<=max_depth) { sum += occ; - count += 1; + count += 1.0; } } vec4 src_color = texture(source, texcoord);