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.
Force Experiment 007
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);
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);
gl_FragColor=vec4(c, 1.0 );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment