Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- uniform float time;
- uniform vec2 resolution;
- float shape(vec2 st, float radius) {
- st = vec2(0.5)-st;
- float r = length(st)*2.0;
- float a = atan(st.y,st.x);
- float m = abs(mod(a+time*2.,3.14*2.)-3.14)/3.6;
- float f = radius;
- f += (sin(a*10.)*.1*pow(m,2.));
- return 1.-step(f,r);
- }
- void main( void ) {
- vec3 yellow = vec3(1.0,1.0,.0);
- vec3 red = vec3(1.0,0.0,.0);
- vec3 blue = vec3(0.0,0.0,1.0);
- vec3 pink = vec3(1.0,0.0,1.0);
- vec2 st = gl_FragCoord.xy/resolution.xy;
- vec3 color = vec3(shape(st,0.8)) * blue;
- color += vec3(shape(st - vec2(0.2),0.8)) * yellow;
- color += vec3(shape(st - vec2(0.1, 0.0),0.8)) * pink;
- gl_FragColor = vec4( color, 1.0 );
- gl_FragColor.rgb *= gl_FragColor.a;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement