-
Notifications
You must be signed in to change notification settings - Fork 3
/
63.frag
21 lines (19 loc) · 844 Bytes
/
63.frag
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
uniform float time;
uniform vec2 resolution;
out vec4 fragColor;
vec2 rotate( vec2 matrix, float angle ) {
return vec2( matrix.x*cos(radians(angle)), matrix.x*sin(radians(angle)) ) + vec2( matrix.y*-sin(radians(angle)), matrix.y*cos(radians(angle)) );
}
void main(void) {
vec2 st = gl_FragCoord.xy / resolution.xy;
vec2 uv = -1. + 2. * st;
float div = 18.0;
float speed = 1.0;
vec2 rr = rotate(uv, cos(time * 1.0) * 90.0);
vec2 rg = rotate(uv, cos(time * 1.1) * -90.0);
vec2 rb = rotate(uv, sin(time * 1.2) * 90.0);
float r = mod(rr.x + mod(time / div * speed * 10.0, 1.0), 1.0 / div) * div;
float g = mod(rg.y + mod(time / div * speed * 10.0, 1.0), 1.0 / div) * div;
float b = mod(rb.x - mod(time / div * speed * 10.0, 1.0), 1.0 / div) * div;
fragColor = TDOutputSwizzle(vec4(r, g, b, 1.0));
}