#version 330 core
in vec2 vUV;
out vec4 FragColor;

uniform sampler2D uTex;
uniform vec2 uDirection;

const float weights[5] = float[](0.204164, 0.304005, 0.093913, 0.010381, 0.000336);

void main() {
    vec3 result = texture(uTex, vUV).rgb * weights[0];

    for (int i = 1; i < 5; ++i) {
        vec2 offset = uDirection * float(i);
        result += texture(uTex, vUV + offset).rgb * weights[i];
        result += texture(uTex, vUV - offset).rgb * weights[i];
    }

    FragColor = vec4(result, 1.0);
}