DecodeStudios

Untitled

Jul 30th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. #define PI 3.14159265359
  12.  
  13. #define LINE_ORIGIN(t) (0.0025 * cos(5. * (4. * position.y * PI + (t) * 1.)) + position.x)
  14.  
  15. float quantize(float x, float l) {
  16.     return floor(x * l) / l;
  17. }
  18.  
  19. void main( void ) {
  20.  
  21.     vec2 position = (( gl_FragCoord.xy / resolution.xy ) - 0.5);
  22.     position = gl_FragCoord.xy / resolution.xy;
  23.     position.x *= resolution.y / resolution.x;
  24.     //float trueMouseX = mouse.x - 0.5;
  25.     //float mouseX = trueMouseX * resolution.y / resolution.x;
  26.     //position.x -= mouseX;
  27.  
  28.     float sway = 0.;
  29.    
  30.     //vec3 r = (.0025 + 0.01 * mouseX) / abs(LINE_ORIGIN(time) + sway) * vec3(1., 0.55, 0.25);
  31.     //vec3 b = (.0025 - 0.01 * mouseX) / abs(LINE_ORIGIN(-time) - sway)* vec3(0.25, 0.25, 1.);
  32.  
  33.     gl_FragColor = vec4( position, 1.0 , 1.0 );
  34.  
  35. }
Add Comment
Please, Sign In to add comment