Advertisement
szymski

Untitled

Mar 9th, 2018
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. #ifdef GL_ES
  2. precision mediump float;
  3. #endif
  4.  
  5. #extension GL_OES_standard_derivatives : enable
  6.  
  7. uniform float time;
  8. uniform vec2 mouse;
  9. uniform vec2 resolution;
  10.  
  11. void main( void ) {
  12.  
  13. vec2 position = ( gl_FragCoord.xy / resolution.xy );
  14. position.x = (position.x - 0.5) * (resolution.x / resolution.y) + 0.5;
  15.  
  16. vec3 color = vec3(0, 0, 1);
  17.  
  18. vec2 center = vec2(0.5);
  19. float dist = length(position - center) * 0.8;
  20. float angle = atan((position - center).y, (position - center).x);
  21.  
  22. float xd = sin(angle * 10.0 + time) * 0.2 * dist;
  23.  
  24. color += vec3(0.8, 0.8, -2.0) * 0.5 * max(0.0, sin((dist - time * 0.1) * 50.0)) * max(1.0, cos((angle + time * 0.5) * 10.0) * 1.5 * sin(angle * 80.0));
  25.  
  26. color -= vec3(0.0, 1.0, 1.0) * max(0.0, cos((dist + xd - time * 0.1) * 100.0) * (1.0 - xd * (15.0 + 5.0 * cos(time))) * 0.5);
  27. color += smoothstep(vec3(1.0, 0.0, 0.0), vec3(0.0, 1.0, -1.0), vec3(dist * 2.0)) * max(0.0, cos((dist + xd - time * 0.1) * 100.0) * (1.0 - xd * (15.0 + 5.0 * cos(time))));
  28. color += vec3(0.0, 1.1, 0.0) * max(0.0, cos((dist * 0.2 + xd - time * 0.1) * 100.0) * (1.0 - xd * (15.0 + 5.0 * cos(-time)))) * 0.1;
  29.  
  30. gl_FragColor = vec4( color, 1.0 );
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement