Skip to content

Instantly share code, notes, and snippets.

@Kurogoma4D
Last active April 25, 2020 10:45
Show Gist options
  • Save Kurogoma4D/f31a2dcc76f88ed881510f21fed6f816 to your computer and use it in GitHub Desktop.
Save Kurogoma4D/f31a2dcc76f88ed881510f21fed6f816 to your computer and use it in GitHub Desktop.
precision mediump float;
uniform float time;
uniform vec2 resolution;
vec3 gradient(vec2 p) {
return vec3(0.5, abs(clamp(p.y, -0.8, 0.8)) , 0.7);
}
void main(void) {
vec2 p = (gl_FragCoord.xy * 2.0 - resolution) / min(resolution.x, resolution.y);
float u = sin((atan(p.y, p.x) * 0.3 + tan(time)) * 20.0) * 0.01;
float col = 0.02 / abs(0.6 + u - length(p));
float s = smoothstep(0.2, 1.8, cos(p.x));
col += s;
vec3 base = vec3(col) * gradient(p) * smoothstep(0., 1., sin(time));
gl_FragColor = vec4(base * vec3(0.4) + vec3(0.08, 0.11, 0.12), 1.0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment