Guest User

Untitled

a guest
Apr 13th, 2020
13
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. float PI=3.1415926;
  2.  
  3. void mainImage( out vec4 fragColor, in vec2 fragCoord )
  4. {
  5. // Normalized pixel coordinates (from 0 to 1)
  6. vec2 uv = fragCoord/iResolution.xy;
  7. uv = uv - vec2(0.3f,0.3f);
  8. // Time varying pixel color
  9. vec3 col;
  10. float angle = -PI/4.0f + float(iFrame)/10.0f;
  11. vec2 rot;
  12. rot.x = uv.x * cos(angle) - uv.y * sin(angle);
  13. rot.y = uv.x * sin(angle) + uv.y * cos(angle);
  14.  
  15. col.x = sqrt(rot.y);
  16.  
  17. // Output to screen
  18. fragColor = vec4(col,1.0);
  19. }
Advertisement
Add Comment
Please, Sign In to add comment