X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=blur_effect.frag;fp=blur_effect.frag;h=51ff39a58c33d44b5a241a2f1a82864485c85383;hp=bfa1d16de06386ffd57297e9996668abea40bd1f;hb=c0461658ca2abaa10aae42f40ffee7e5128bc7ab;hpb=b5e3174594efe9a920621a68d3b28f5e44676d03 diff --git a/blur_effect.frag b/blur_effect.frag index bfa1d16..51ff39a 100644 --- a/blur_effect.frag +++ b/blur_effect.frag @@ -1,17 +1,24 @@ // A simple, very stupid horizontal blur. Will be fixed soonish. +uniform float PREFIX(pixel_offset); +uniform float PREFIX(weight)[15]; + vec4 FUNCNAME(vec2 tc) { vec4 x = LAST_INPUT(tc); return - vec4(0.1) * LAST_INPUT(tc + vec2(-0.010f, 0.0)) + - vec4(0.1) * LAST_INPUT(tc + vec2(-0.008f, 0.0)) + - vec4(0.1) * LAST_INPUT(tc + vec2(-0.006f, 0.0)) + - vec4(0.1) * LAST_INPUT(tc + vec2(-0.004f, 0.0)) + - vec4(0.2) * LAST_INPUT(tc + vec2(-0.002f, 0.0)) + - vec4(0.3) * LAST_INPUT(tc + vec2(-0.000f, 0.0)) + - vec4(0.2) * LAST_INPUT(tc + vec2( 0.002f, 0.0)) + - vec4(0.1) * LAST_INPUT(tc + vec2( 0.004f, 0.0)) + - vec4(0.1) * LAST_INPUT(tc + vec2( 0.006f, 0.0)) + - vec4(0.1) * LAST_INPUT(tc + vec2( 0.008f, 0.0)) + - vec4(0.1) * LAST_INPUT(tc + vec2( 0.010f, 0.0)); + vec4(PREFIX(weight)[ 0]) * LAST_INPUT(vec2(tc.x - 7.0 * PREFIX(pixel_offset), tc.y)) + + vec4(PREFIX(weight)[ 1]) * LAST_INPUT(vec2(tc.x - 6.0 * PREFIX(pixel_offset), tc.y)) + + vec4(PREFIX(weight)[ 2]) * LAST_INPUT(vec2(tc.x - 5.0 * PREFIX(pixel_offset), tc.y)) + + vec4(PREFIX(weight)[ 3]) * LAST_INPUT(vec2(tc.x - 4.0 * PREFIX(pixel_offset), tc.y)) + + vec4(PREFIX(weight)[ 4]) * LAST_INPUT(vec2(tc.x - 3.0 * PREFIX(pixel_offset), tc.y)) + + vec4(PREFIX(weight)[ 5]) * LAST_INPUT(vec2(tc.x - 2.0 * PREFIX(pixel_offset), tc.y)) + + vec4(PREFIX(weight)[ 6]) * LAST_INPUT(vec2(tc.x - PREFIX(pixel_offset), tc.y)) + + vec4(PREFIX(weight)[ 7]) * LAST_INPUT(tc) + + vec4(PREFIX(weight)[ 8]) * LAST_INPUT(vec2(tc.x + PREFIX(pixel_offset), tc.y)) + + vec4(PREFIX(weight)[ 9]) * LAST_INPUT(vec2(tc.x + 2.0 * PREFIX(pixel_offset), tc.y)) + + vec4(PREFIX(weight)[10]) * LAST_INPUT(vec2(tc.x + 3.0 * PREFIX(pixel_offset), tc.y)) + + vec4(PREFIX(weight)[11]) * LAST_INPUT(vec2(tc.x + 4.0 * PREFIX(pixel_offset), tc.y)) + + vec4(PREFIX(weight)[12]) * LAST_INPUT(vec2(tc.x + 5.0 * PREFIX(pixel_offset), tc.y)); + vec4(PREFIX(weight)[13]) * LAST_INPUT(vec2(tc.x + 6.0 * PREFIX(pixel_offset), tc.y)); + vec4(PREFIX(weight)[14]) * LAST_INPUT(vec2(tc.x + 7.0 * PREFIX(pixel_offset), tc.y)); }