- vec4 x = LAST_INPUT(tc);
- return
- vec4(PREFIX(weight)[ 0]) * LAST_INPUT(tc - 7.0 * PREFIX(pixel_offset)) +
- vec4(PREFIX(weight)[ 1]) * LAST_INPUT(tc - 6.0 * PREFIX(pixel_offset)) +
- vec4(PREFIX(weight)[ 2]) * LAST_INPUT(tc - 5.0 * PREFIX(pixel_offset)) +
- vec4(PREFIX(weight)[ 3]) * LAST_INPUT(tc - 4.0 * PREFIX(pixel_offset)) +
- vec4(PREFIX(weight)[ 4]) * LAST_INPUT(tc - 3.0 * PREFIX(pixel_offset)) +
- vec4(PREFIX(weight)[ 5]) * LAST_INPUT(tc - 2.0 * PREFIX(pixel_offset)) +
- vec4(PREFIX(weight)[ 6]) * LAST_INPUT(tc - PREFIX(pixel_offset)) +
- vec4(PREFIX(weight)[ 7]) * LAST_INPUT(tc) +
- vec4(PREFIX(weight)[ 8]) * LAST_INPUT(tc + PREFIX(pixel_offset)) +
- vec4(PREFIX(weight)[ 9]) * LAST_INPUT(tc + 2.0 * PREFIX(pixel_offset)) +
- vec4(PREFIX(weight)[10]) * LAST_INPUT(tc + 3.0 * PREFIX(pixel_offset)) +
- vec4(PREFIX(weight)[11]) * LAST_INPUT(tc + 4.0 * PREFIX(pixel_offset)) +
- vec4(PREFIX(weight)[12]) * LAST_INPUT(tc + 5.0 * PREFIX(pixel_offset)) +
- vec4(PREFIX(weight)[13]) * LAST_INPUT(tc + 6.0 * PREFIX(pixel_offset)) +
- vec4(PREFIX(weight)[14]) * LAST_INPUT(tc + 7.0 * PREFIX(pixel_offset));
+ vec4 sum = vec4(PREFIX(samples)[0].z) * LAST_INPUT(tc);
+ for (int i = 1; i < NUM_TAPS + 1; ++i) {
+ vec4 sample = PREFIX(samples)[i];
+ sum += vec4(sample.z) * (LAST_INPUT(tc - sample.xy) + LAST_INPUT(tc + sample.xy));
+ }
+ return sum;