Skip to content

Instantly share code, notes, and snippets.

@antoineMoPa
Last active March 14, 2018 05:00
Show Gist options
  • Save antoineMoPa/fb42e74553814d4ce369c0657caf5be2 to your computer and use it in GitHub Desktop.
Save antoineMoPa/fb42e74553814d4ce369c0657caf5be2 to your computer and use it in GitHub Desktop.
precision highp float;
varying vec2 UV;
uniform float ratio, time;
void main(void){
float x = UV.x * ratio;
float y = UV.y;
vec2 p = vec2(x, y) - vec2(0.5);
vec4 col = vec4(0.0);
vec2 c = vec2(0.0);
float d = distance(p, c);
float a = atan(p.y, p.x);
d += 0.1 * cos(a * 7.0 + d * 50.0 - time * 6.28);
col += pow(max(1.0 - d * 4.0, 0.0), 2.0);
d = distance(p, c);
col *= pow(d * 4.0, 1.9) * 4.0;
col *= 1.0 + 0.5 * cos(d * 300.0);
col *= 1.0 + 0.5 * cos(a * 30.0);
col.a = 1.0;
col.b *= 1.5;
float bg = cos(p.x * 40.0 + p.y * 10.0) *
cos(p.y * 3.0 + time * 6.28 + p.x * 3.0 + 1.0 *
cos(p.y * 10.0 + p.x * 2.0));
col += 0.02 * floor(clamp(bg, 0.0, 1.0) * 10.0);
col.r *= 1.4;
gl_FragColor = col;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment