Advertisement
ctgPi

feigenbaum

Jul 29th, 2020
2,225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void mainImage( out vec4 fragColor, in vec2 fragCoord )
  2. {
  3.     float lambda = fragCoord.x/iResolution.x * 4.0;
  4.    
  5.     float t = fragCoord.y/iResolution.y;
  6.    
  7.     for (int i = 0; i < 1000; i++) {
  8.         t = lambda * t * (1.0 - t);
  9.     }
  10.  
  11.     float col = 0.0;
  12.     float lb = fragCoord.y/iResolution.y;
  13.     float ub = (fragCoord.y + 1.0)/iResolution.y;
  14.     for (int i = 0; i < 256; i++) {
  15.         t = lambda * t * (1.0 - t);
  16.         if (lb < t && t < ub) {
  17.             col += 1.0 / 256.0;
  18.         }
  19.     }
  20.    
  21.     col = sqrt(col);
  22.     col = sqrt(col);
  23.  
  24.     // Output to screen
  25.     fragColor = vec4(col,col,col,1.0);
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement