aboutsummaryrefslogtreecommitdiffstats
path: root/src/effects/shaders/blur.frag
blob: 8aecd1041a6c3df8d8ed5617af0695364210241d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
void MAIN()
{
    vec4 c1 = texture(INPUT, vec2(INPUT_UV.x - amount, INPUT_UV.y - amount));
    vec4 c2 = texture(INPUT, vec2(INPUT_UV.x + amount, INPUT_UV.y - amount));
    vec4 c3 = texture(INPUT, vec2(INPUT_UV.x - amount, INPUT_UV.y + amount));
    vec4 c4 = texture(INPUT, vec2(INPUT_UV.x + amount, INPUT_UV.y + amount));
    vec4 c5 = texture(INPUT, vec2(INPUT_UV.x - (amount * 2.0), INPUT_UV.y));
    vec4 c6 = texture(INPUT, vec2(INPUT_UV.x, INPUT_UV.y - (amount * 2.0)));
    vec4 c7 = texture(INPUT, vec2(INPUT_UV.x, INPUT_UV.y + (amount * 2.0)));
    vec4 c8 = texture(INPUT, vec2(INPUT_UV.x + (amount * 2.0), INPUT_UV.y));

    FRAGCOLOR = (c1 + c2 + c3 + c4 + c5 + c6 + c7 + c8) / 8.0;
}