Created
April 25, 2021 11:21
-
-
Save gre/c7e8d1ceeae1bdf33961aa291a329d5e 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
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); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
image used for https://www.hicetnunc.xyz/objkt/48081 :
https://greweb.me/images/tezos-dist.png