Skip to content

Instantly share code, notes, and snippets.

@quilime
Last active November 21, 2015 22:33
Show Gist options
  • Save quilime/477633ed9940901174ed to your computer and use it in GitHub Desktop.
Save quilime/477633ed9940901174ed to your computer and use it in GitHub Desktop.
// http://glslsandbox.com/e#29006.1
#ifdef GL_ES
precision mediump float;
#endif
// modified by @hintz
// further modded by @quilime
uniform float time;
uniform vec2 mouse;
uniform vec2 resolution;
#define PI 3.14159
#define TWO_PI (PI*2.0)
#define N 6.0
void main(void)
{
vec2 center = (gl_FragCoord.xy);
vec2 v = (gl_FragCoord.xy) / min(resolution.y, resolution.x) * 35.0;
float col = 1.5;
for(float i = 0.0; i < N; i++)
{
float a = i * (TWO_PI / N) * 44.85;
col += cos(TWO_PI*(v.y * cos(a) + v.x * sin(a) + mouse.y +i*mouse.x + sin(time*.0014)*100.0 ));
}
col /= 5.0;
gl_FragColor = vec4(col*1.0, -col*1.0,-col*4.0, 1.0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment