Update to rust-rocket 0.7.2
[mandelwow.git] / shaders / mandelwow.frag
1 #version 300 es
2 precision highp float;
3 in vec2 c;
4 in vec2 z;
5 out vec4 color;
6
7 void main() {
8     float zx = z.x;
9     float zy = z.y;
10     const int maxiter = 64;
11     for (int iter = maxiter; iter > 0; iter--) {
12         float zx2 = zx * zx;
13         float zy2 = zy * zy;
14         if (zx2 * zy2 > 4.0) {
15           float index = float(iter) / float(maxiter);
16           color = vec4(index, 0.1, 1.0 - index / 2.0, 0.8 - index * index);
17           return;
18         }
19         zy = zx * zy * 2.0 + c.y;
20         zx = zx2 - zy2 + c.x;
21     }
22     color = vec4((sin(z.y) + 1.0) / 4.0,
23                  (sin(z.x) + 1.0) / 4.0,
24                  (sin(c.x) + 1.0) / 4.0,
25                  1.0);
26 }