scene.org File Archive

File download

<root>­/­parties­/­2017­/­tokyodemofest17­/­glsl_graphics_compo/minamo_glsl.txt

File size:
734 bytes (734B)
File date:
2017-02-20 05:45:01
Download count:
all-time: 584

Preview

/* MINAMO */

precision mediump float;
uniform float time;
uniform vec2  resolution;

void main(void){
    vec2 p = (gl_FragCoord.xy * 2.0 - resolution) / min(resolution.x, resolution.y);
    vec3 dc = vec3(0.1+sin(time*0.75));
    float f = 0.0;
    
    for(float i = 0.0; i < 1.0; i++){
        float s = sin((time*5.3) + i * 0.1) * 0.5;
        float c = cos((time*2.) + i * 0.1) * 0.5;
        f +=  sin(time*4.) / length(p + vec2(-c, -s));
    }
    for(float i = 0.0; i < 10.0; i++){
        float s = sin((time*5.) + i * 1.) * 0.5;
        float c = cos((time*5.) + i * 0.4) * 0.5;
        f += 0.003 / abs(length(vec2(p.x/5.,p.y) + vec2(c, s)) - 0.5);
    }
    gl_FragColor = vec4(vec3(dc * f), 1.0);
}