Skip to content

Instantly share code, notes, and snippets.

@shawnlawson
Last active April 16, 2017 15:44
Show Gist options
  • Save shawnlawson/b2fb09e1d137bf96edf09d3a3b6a3df2 to your computer and use it in GitHub Desktop.
Save shawnlawson/b2fb09e1d137bf96edf09d3a3b6a3df2 to your computer and use it in GitHub Desktop.

Revisions

  1. Shawn Lawson revised this gist Apr 16, 2017. 1 changed file with 8 additions and 1 deletion.
    9 changes: 8 additions & 1 deletion exp.frag
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,10 @@

    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 + 2.; float a = mod(theta, PI2/k); a = abs(a - PI2/k/2.);


    vec2 pq = fract( st * (.01 + length(bands)*1.));
    pq = rotate(vec2(0), pq, time - bands.z);
    pq = fract(pq);
    @@ -18,4 +24,5 @@

    c = abs(sin((time - length(bands)) * 2.)) * hsv2rgb(vec3(time+1., .3, length(bands))) - step(.95 * white, c);


    gl_FragColor=vec4(c, 1.0 );
    }
  2. Shawn Lawson created this gist Apr 16, 2017.
    21 changes: 21 additions & 0 deletions exp.frag
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@

    vec2 pq = fract( st * (.01 + length(bands)*1.));
    pq = rotate(vec2(0), pq, time - bands.z);
    pq = fract(pq);
    pq = rotate(vec2(0), pq, +time - bands.x );
    pq = fract(pq);
    pq = rotate(vec2(0), pq, -time - bands.z );
    pq = fract(pq);
    pq = rotate(vec2(0), pq, +time + bands.y);
    pq = fract(pq);
    pq = rotate(vec2(sin(time), cos(time)) * 3., pq+st, -time + bands.w);
    // pq = fract(pq);
    float f = fbm((pq ) * (1. + bands.x * 6.), 2 + int(bands.x* 2.)) * 2. - 1.;
    float f2 = fbm((pq) * (2. + bands.y * 4.), 2 + int(bands.y* 5.)) * 2. -1.;

    c += f * white;
    c += f2 * hsv2rgb(vec3(time, length(bands), .8)) * 2.;

    c = abs(sin((time - length(bands)) * 2.)) * hsv2rgb(vec3(time+1., .3, length(bands))) - step(.95 * white, c);