Skip to content

Instantly share code, notes, and snippets.

@shawnlawson
Created April 28, 2017 13:22
Show Gist options
  • Save shawnlawson/0f495f492c39ca9b5694e6aa1f3983c2 to your computer and use it in GitHub Desktop.
Save shawnlawson/0f495f492c39ca9b5694e6aa1f3983c2 to your computer and use it in GitHub Desktop.

Revisions

  1. Shawn Lawson created this gist Apr 28, 2017.
    25 changes: 25 additions & 0 deletions exp.frag
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@

    void main() {
    vec2 st = st(), stN = stN(); vec3 c = white * .5;
    float theta = atan(st.x, st.y) / PI2; float phi = log(length(st));
    float k = 1. * bands.y + 5.; float a = mod(theta, PI2/k); a = abs(a - PI2/k/2.) * 3.;

    vec2 p = mix(vec2(a * 6. * bands.y + st.y * bands.z + a*2., phi + phi * (3.+ bands.y * 4.) + time * .1), st, bands.x);
    p = rotate(vec2(0), p, time - bands.y - bands.z);
    p = fract(p * (1.+ bands.y));

    vec3 v = voronoi(vec3(p, time * 1.7 + bands.y * 1.4));
    vec3 v2 = voronoi(vec3(p * 1.1 * bands.y, time * 1.6 + bands.y * 1.4));
    vec3 v3 = voronoi(vec3(p * 1.3 * bands.y, time * 1.5 + bands.y * 1.4));

    c = pow(v.x, 3.) * hsv2rgb(vec3(time, 0.3, .8)) * 2. * bands.z;
    c += pow(v2.x, 3.) * orange * 2. * bands.y;
    c += pow(v3.x, 3.) * blue * 2. * bands.x;

    vec2 center = vec2(.5) + vec2(bands.x-bands.z, bands.y-bands.w) * 5. * length(bands);
    vec3 bb = texture2D(backbuffer, (stN-center) * 1.01 + center).rgb;
    c = mix(c * 3., bb, .5);
    c = pow(c, 2.5 * white);

    gl_FragColor=vec4(c, 1.0 );
    }