mightymandel v16

GPU-based Mandelbrot set explorer

fpxx_init_geom.glsl
Go to the documentation of this file.
1 // mightymandel -- GPU-based Mandelbrot Set explorer
2 // Copyright (C) 2012,2013,2014,2015 Claude Heiland-Allen
3 // License GPL3+ http://www.gnu.org/licenses/gpl.html
4 
5 layout(points) in;
6 layout(points, max_vertices = 1) out;
7 uniform int pass;
8 uniform dvec2 center;
9 uniform double radius;
10 uniform double aspect;
11 in dvec4 cne1[1];
12 #ifdef DE
13 in dvec4 zdz1[1];
14 #else
15 in dvec2 zdz1[1];
16 #endif
17 in double err1[1];
18 in vec4 c1[1];
19 flat out dvec4 cne;
20 #ifdef DE
21 flat out dvec4 zdz;
22 #else
23 flat out dvec2 zdz;
24 #endif
25 flat out double err;
26 flat out vec4 ida;
27 void main() {
28  bool glitched = ! (c1[0].w == 0.0);
29  bool escaped = c1[0].z > 0.0;
30  if (pass == 0 || (escaped && glitched)) {
31  cne = cne1[0];
32  zdz = zdz1[0];
33  err = 0.0;
34  ida = vec4(-abs(c1[0].z), 0.0, 0.0, 0.0);
35  gl_Position = vec4(c1[0].xy * vec2(aspect, 1.0), 0.0, 1.0);
36  EmitVertex();
37  EndPrimitive();
38  }
39 }