in vec2 uv;
in vec2 uvn;

out vec4 C;

uniform int input_tex;
uniform vec2 output_res;
uniform vec2 res_sc;

void main() {
    vec2 u = uvn;

    C.rgb -= C.rgb;
    
    float ss_steps = 4.;
    float W = 0.;
    for(float x = -ss_steps; x <= ss_steps; x++){
//        for(float y = -ss_steps; y <= ss_steps; y++){
        for(float y = 0; y <= 0; y++){
            vec2 offs = vec2(x,y)/res_sc*1.;
            vec3 input_col = texture(textures[input_tex], u+offs).rgb;
            input_col *= smoothstep(0.4,1.0, luma(input_col));
            C.rgb += input_col;
            W += 1.0;
        }
    }
    C.rgb /= W;
    C.rgb *= 1.;
//    C. *= 2.4;
    C.w = 1.0;
}
