1 // A simple un.directional blur.
2 // DIRECTION_VERTICAL will be #defined to 1 if we are doing a vertical blur,
6 // uniform vec2 PREFIX(samples)[NUM_TAPS / 2 + 1];
8 vec4 FUNCNAME(vec2 tc) {
9 vec4 sum = vec4(PREFIX(samples)[0].y) * INPUT(tc);
10 for (int i = 1; i < NUM_TAPS / 2 + 1; ++i) {
11 vec2 sample = PREFIX(samples)[i];
12 vec2 sample1_tc = tc, sample2_tc = tc;
13 #if DIRECTION_VERTICAL
14 sample1_tc.y -= sample.x;
15 sample2_tc.y += sample.x;
17 sample1_tc.x -= sample.x;
18 sample2_tc.x += sample.x;
20 sum += vec4(sample.y) * (INPUT(sample1_tc) + INPUT(sample2_tc));
25 #undef DIRECTION_VERTICAL