Advertisement
Guest User

Untitled

a guest
Aug 9th, 2016
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #version 120
  2.  
  3. uniform sampler2D fbo_texture;
  4. uniform float time;
  5.  
  6. varying vec2 UV;
  7.  
  8. float rand(vec2 arg)
  9. {
  10.     return fract(sin(dot(arg, vec2(12.9898, 78.233))) * 43758.5453);
  11. }
  12.  
  13. void main(void)
  14. {
  15.     vec2 cPos = UV * 2 - 1;
  16.     float cLength = length(cPos);
  17.     vec2 uv = UV + cos(cLength * 100 + time * 10) * 0.0025;
  18.     float argument = atan(time / 20) * sin(time * 10) * 5;
  19.     uv = vec2(cos(argument), sin(argument)) / 50 + uv + (vec2(rand(time * UV), rand(1 + time * UV)) - 0.5) / (10 + 240 * atan(time / 20) * abs(sin(time * 3)));
  20.     float r = abs(rand(vec2(rand(time * UV))) - 0.3);
  21.     gl_FragColor = (r <= 0.0005 ? 1 : 0) + texture2D(fbo_texture, uv);
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement