Created
September 11, 2021 00:57
-
-
Save krisselden/499669d66c6c1daddb303cb1268fe4d8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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