Archived
1
Fork 0
This repository has been archived on 2025-04-09. You can view files and clone it, but cannot push or open issues or pull requests.
box-car-2d/GLEssentials/Fractal-iOS.fsh
2014-04-01 09:19:41 +02:00

22 lines
433 B
GLSL

#version 100
varying highp vec2 pos;
varying highp vec2 start;
void main(){
highp vec2 z = start;
int i = 0;
for (i = 0; i < 7; i++) {
highp vec2 zsq = z*z;
if(zsq.x + zsq.y > 16.0) break;
highp float t = zsq.x - zsq.y + pos.x;
z.y = 2.0*z.x*z.y + pos.y;
z.x = t;
}
gl_FragColor = vec4(float(i) / 7.0);
gl_FragColor.bg = 0.5 * sin(z) + 0.5;
}