ctgPi icon

feigenbaum

ctgPi | PRO | 07/29/20 06:47:50 PM UTC | 0 ⭐ | 9464 👁️ | Never ⏰ | []
OpenGL Shading |

0 B

|

None

|

0 👍

/

0 👎

void mainImage( out vec4 fragColor, in vec2 fragCoord )
{
    float lambda = fragCoord.x/iResolution.x * 4.0;
    
    float t = fragCoord.y/iResolution.y;
    
    for (int i = 0; i < 1000; i++) {
        t = lambda * t * (1.0 - t);
    }
 
    float col = 0.0;
    float lb = fragCoord.y/iResolution.y;
    float ub = (fragCoord.y + 1.0)/iResolution.y;
    for (int i = 0; i < 256; i++) {
        t = lambda * t * (1.0 - t);
        if (lb < t && t < ub) {
            col += 1.0 / 256.0;
        }
    }
    
    col = sqrt(col);
    col = sqrt(col);
 
    // Output to screen
    fragColor = vec4(col,col,col,1.0);
}

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎