camera_static.swsl 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // Credited to PelicanPolice on Shadertoy
  2. // Free for any purpose, commercial or otherwise.
  3. // But do post here so I can see where it got used!
  4. // If using on shadertoy, do link to this project on yours :)
  5. highp float noise(highp vec2 pos, highp float evolve) {
  6. // Loop the evolution (over a very long period of time).
  7. highp float e = fract((evolve*0.01));
  8. // Coordinates
  9. highp float cx = pos.x*e;
  10. highp float cy = sin(pos.y*e * 376.0); // is this close enough to a 60hz interference? :smol:
  11. highp float v2_2 = cx*2.4/cy*23.0+pow(abs(cy/22.4),3.3);
  12. highp float v2_1 = fract(fract(v2_2));
  13. highp float v2 = fract(2.0/v2_1);
  14. highp float v3 = fract(cx*evolve/pow(abs(cy),0.050));
  15. // Generate a "random" black or white value
  16. return fract(0.1*v2*v3);
  17. }
  18. void fragment() {
  19. highp vec2 coords = FRAGCOORD.xy;
  20. // Increase this number to test performance
  21. int intensity = 1;
  22. highp vec3 colour;
  23. for (int i = 0; i < intensity; i++)
  24. {
  25. // Generate a black to white pixel
  26. colour = vec3(noise(coords,TIME));
  27. }
  28. // Output to screen
  29. COLOR = vec4(colour,1.0);
  30. }