Advertisement
Guest User

Untitled

a guest
Aug 26th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. mat2 rotate(float Angle){
  2. mat2 rotation = mat2(
  3. vec2( cos(Angle), sin(Angle)),
  4. vec2(-sin(Angle), cos(Angle))
  5. );
  6. return rotation;
  7. }
  8.  
  9. vec4 add (vec4 a, vec4 b){
  10. return a + b;
  11. }
  12. vec4 sub (vec4 a, vec4 b){
  13. return a - b;
  14. }
  15. vec4 mul (vec4 a, vec4 b){
  16. return (.5+a) * (.5+b);
  17. }
  18. vec4 div (vec4 a, vec4 b){
  19. return a / b;
  20. }
  21. vec4 avg (vec4 a, vec4 b){
  22. return (a / b)/2.;
  23. }
  24.  
  25. void mainImage( out vec4 fragColor, in vec2 fragCoord )
  26. {
  27. vec2 uv = fragCoord.xy / iResolution.xy - vec2(0.5);
  28. vec2 yv = uv * (0.99 - 0.04*length(uv));
  29. yv *= rotate(0.01 + length(uv)*0.09);
  30. uv+=vec2(0.5);
  31. yv+=vec2(0.5);
  32. fragColor = div(mul(texture(iChannel0,uv) * 0.4,texture(iChannel1,yv)*(0.8+sin(iTime*0.01)*0.1)),vec4(.8)); // * (0.85 + 0.1 * sin(iTime + uv.x));
  33. fragColor.xz *= rotate(0.09*sin(iTime*.4));
  34. fragColor.yx *= rotate(-0.09*sin(iTime*.7+0.2));
  35. // fragColor = max(texture(iChannel0,uv)-vec4(0.4),vec4(0.0)) * 1.0 + texture(iChannel1,yv) * (0.85 + 0.1 * sin(iTime + uv.x));
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement