precision highp float;
precision highp int;

varying vec2 vUV;

// Samplers
uniform sampler2D sceneSampler;
uniform sampler2D aoSampler;

void main(void)
{
    vec2 sampleUV = vUV;

    vec4 screenFragment = texture2D(sceneSampler, sampleUV);
    float ambientOcclusion = texture2D(aoSampler, sampleUV).r;

    // The ambient occlusion holds the value of the actual occlusion, not reverse
    gl_FragColor = vec4(vec3(screenFragment.xyz) * (1.0 - ambientOcclusion), screenFragment.w);
}