#include "/lib/all_the_libs.glsl"

varying vec2 texcoord;

float weights[5] = float[](0.227027, 0.1945946, 0.1216216, 0.054054, 0.016216);

void main() {
    vec2 pixelSize = 1.0 / vec2(viewWidth, viewHeight);
    
    vec3 color = texture2D(colortex1, texcoord).rgb * weights[0];
    
    for(int i = 1; i < 5; ++i) {
        // Sample Up
        color += texture2D(colortex1, texcoord + vec2(0.0, pixelSize.y * float(i))).rgb * weights[i];
        // Sample Down
        color += texture2D(colortex1, texcoord - vec2(0.0, pixelSize.y * float(i))).rgb * weights[i];
    }
    /* DRAWBUFFERS:1 */
    gl_FragData[0] = vec4(color, 1.0);
}