]> git.sesse.net Git - movit/blob - complex_modulate_effect.frag
There's no need to #undef PREFIX, since we do the token pasting ourselves.
[movit] / complex_modulate_effect.frag
1 // Implicit uniforms:
2 // uniform vec2 PREFIX(num_repeats);
3
4 vec4 FUNCNAME(vec2 tc) {
5         vec4 pixel = INPUT1(tc);
6         vec2 pattern = INPUT2(tc * PREFIX(num_repeats)).xy;
7
8         // Complex multiplication between each of (pixel.xy, pixel.zw) and pattern.xy.
9         return pattern.x * pixel + pattern.y * vec4(-pixel.y, pixel.x, -pixel.w, pixel.z);
10 }