Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
precision highp float;
varying vec2 uv;
uniform float time;
uniform sampler2D img;
vec3 palette( in float t, in vec3 a, in vec3 b, in vec3 c, in vec3 d ) {
return a + b*cos( 6.28318*(c*t+d) );
}
vec3 color (float t) {
return palette(
t,
vec3(.5),
vec3(.6 + .1 * cos(.3 * time)),
vec3(1.),
vec3(0.22, 0.5, 0.77)
);
}
void main() {
float v = 1. - texture2D(img, uv).a;
v = max(-step(fract(time), 0.5), v);
gl_FragColor = vec4(
step(v, 0.) * color(1.6 * (uv.y + time)) +
step(0., v) * color(sqrt(max(v, 0.)) - 2. * time),
1.0);
}
@gre

This comment has been minimized.

Copy link
Owner Author

@gre gre commented Apr 25, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment