#version 450

layout(location = 0) in vec2 inUV;

layout(location = 0) out vec4 outColor;

layout(set = 0, binding = 0) uniform sampler2D uSSAOTexture;

void main() {
    vec2 texelSize = 1.0 / vec2(textureSize(uSSAOTexture, 0));
    float result = 0.0;
    for (int x = -2; x < 2; ++x) 
    {
        for (int y = -2; y < 2; ++y) 
        {
            vec2 offset = vec2(float(x), float(y)) * texelSize;
            result += texture(uSSAOTexture, inUV + offset).r;
        }
    }

    outColor = vec4(result / (4.0 * 4.0));
} 
