SHARE
TWEET

Untitled

a guest Jun 17th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. uniform float time;
  2.     uniform vec2 resolution;
  3.  
  4.     float shape(vec2 st, float radius) {
  5.         st = vec2(0.5)-st;
  6.         float r = length(st)*2.0;
  7.         float a = atan(st.y,st.x);
  8.         float m = abs(mod(a+time*2.,3.14*2.)-3.14)/3.6;
  9.         float f = radius;
  10.         f += (sin(a*10.)*.1*pow(m,2.));
  11.         return 1.-step(f,r);
  12.     }
  13.  
  14.     void main( void ) {
  15.  
  16.         vec3 yellow = vec3(1.0,1.0,.0);
  17.         vec3 red = vec3(1.0,0.0,.0);
  18.         vec3 blue = vec3(0.0,0.0,1.0);
  19.         vec3 pink = vec3(1.0,0.0,1.0);
  20.  
  21.         vec2 st = gl_FragCoord.xy/resolution.xy;
  22.         vec3 color = vec3(shape(st,0.8)) * blue;
  23.         color += vec3(shape(st - vec2(0.2),0.8)) * yellow;
  24.         color += vec3(shape(st - vec2(0.1, 0.0),0.8)) * pink;
  25.  
  26.         gl_FragColor = vec4( color, 1.0 );
  27.         gl_FragColor.rgb *= gl_FragColor.a;
  28.  
  29.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top