Skip to content

Instantly share code, notes, and snippets.

@krisselden
Created September 11, 2021 00:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krisselden/499669d66c6c1daddb303cb1268fe4d8 to your computer and use it in GitHub Desktop.
Save krisselden/499669d66c6c1daddb303cb1268fe4d8 to your computer and use it in GitHub Desktop.
void mainImage( out vec4 fragColor, in vec2 fragCoord )
{
vec2 p = (2.0*fragCoord.xy-iResolution.xy)/iResolution.y;
// width
float wi = 0.5 + 0.3*cos( iTime + 2.0 );
vec2 g = abs(p - wi * round(p/wi));
float d = min(g.x, g.y);
vec3 col = vec3(1.0) - sign(d)*vec3(0.1,0.4,0.7);
col *= 1.0 - exp(-3.0*abs(d));
col *= 0.8 + 0.2*cos(120.0*d);
col = mix( col, vec3(1.0), 1.0-smoothstep(0.0,0.015,abs(d)) );
fragColor = vec4(col,1.0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment