Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. // Paste into shadertoy.
  2. void mainImage( out vec4 fragColor, in vec2 fragCoord )
  3. {
  4. vec2 c = (2.0*iMouse.xy - iResolution.xy)/iResolution.y;
  5. vec2 p = (-iResolution.xy + 2.0*fragCoord)/iResolution.y;
  6. vec2 d = c - p;
  7.  
  8. // angle of each pixel to the center offset by from
  9. float from = radians(mod(10.0*iTime,360.0));
  10. float a = (atan(d.x, d.y) + radians(180.0) - from)/radians(360.0);
  11. a = fract(a);
  12.  
  13. vec3 col = vec3(0,0,0);
  14. col = vec3(a, a, a);
  15. fragColor = vec4( col, 1.0 );
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement