Guest User

Untitled

a guest
May 24th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. uniform float time;
  2. uniform float progress;
  3. uniform sampler2D texture1;
  4. uniform sampler2D texture2;
  5. uniform vec2 pixels;
  6. uniform vec2 uvRate1;
  7. uniform vec2 accel;
  8. uniform vec2 mouse;
  9.  
  10. varying vec2 vUv;
  11. varying vec2 vUv1;
  12. varying vec4 vPosition;
  13.  
  14.  
  15. vec2 mirrored(vec2 v) {
  16. vec2 m = mod(v,2.);
  17. return mix(m,2.0 - m, step(1.0 ,m));
  18. }
  19.  
  20. float tri(float p) {
  21. return mix(p,1.0 - p, step(0.5 ,p))*2.;
  22. }
  23.  
  24.  
  25. void main() {
  26. vec2 uv = gl_FragCoord.xy/pixels.xy;
  27. // vec2 mouse = vec2(0.3,0.3);
  28. float velocity = 1.;
  29.  
  30. float dist = distance(vec2(mouse.x,((1.-mouse.y) - 0.5)*uvRate1.y + 0.5), vUv1);
  31.  
  32.  
  33.  
  34. vec2 uv1 = vUv1;
  35.  
  36. uv1.y += sin(uv1.y * 5.005 + time * 0.8) * 0.0022;
  37. uv1.x += sin(uv1.x * 10.005 + time * 0.6) * 0.0032;
  38.  
  39. uv1.x =(uv1.x - 0.5)*0.3 + 0.5;
  40.  
  41.  
  42.  
  43. if(dist < 0.1){
  44. // rgba1 = vec4(1.,0.,0.,1.);
  45.  
  46. float absDist = 0.1 - dist;
  47. float time1 = time * 3.3;
  48. float time2 = time * 1.8;
  49.  
  50. uv1.x += sin(gl_FragCoord.y * 0.04 + time2) * 0.005 * absDist * velocity;
  51. uv1.x += sin(gl_FragCoord.y * 0.036 + (time1 * 1.5)) * 0.003 * absDist * velocity;
  52.  
  53. uv1.y += sin(gl_FragCoord.x * 0.06 + time1) * 0.006 * absDist * velocity;
  54. uv1.y += sin(gl_FragCoord.x * 0.046 + (time1 * 2.)) * 0.004 * absDist * velocity;
  55. }
  56. gl_FragColor = vec4(vUv1.y,0.,0.,1.);
  57. vec4 rgba1 = texture2D(texture1,mirrored(uv1));
  58. if(dist < 0.1){rgba1 *= 1.2;};
  59. gl_FragColor = vec4(1.- dist);
  60. gl_FragColor = rgba1;
  61. // gl_FragColor = vec4(tri(progress));
  62. // gl_FragColor = vec4(delayValue);
  63. // gl_FragColor = vec4(delayValue);
  64. // gl_FragColor = vec4(uv,1.,1.);
  65. }
Add Comment
Please, Sign In to add comment