Skip to content

Instantly share code, notes, and snippets.

@auxiliary-character
Last active November 24, 2015 06:38
Show Gist options
  • Select an option

  • Save auxiliary-character/e05f0dd7e3517405e560 to your computer and use it in GitHub Desktop.

Select an option

Save auxiliary-character/e05f0dd7e3517405e560 to your computer and use it in GitHub Desktop.
uniform float iOvertoneVolume;
void main() {
vec2 z = (4*gl_FragCoord.xy)/iResolution.xy-2;
vec2 c = vec2(iOvertoneVolume * 4, iOvertoneVolume * 4);
int iter = 30;
int i;
for(i=0; i<iter; i++) {
float x = (z.x * z.x - z.y * z.y) + c.x;
float y = (z.y * z.x + z.x * z.y) + c.y;
if((x * x + y * y) > 4.0) break;
z.x = x;
z.y = y;
}
gl_FragColor = vec4(0.0, cos(i), -cos(i), 1.0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment