mightymandel v16

GPU-based Mandelbrot set explorer

fp32_complex.glsl
Go to the documentation of this file.
1 // mightymandel -- GPU-based Mandelbrot Set explorer
2 // Copyright (C) 2012,2013,2014 Claude Heiland-Allen
3 // License GPL3+ http://www.gnu.org/licenses/gpl.html
4 
5 float cmag2(vec2 z) {
6  return dot(z, z);
7 }
8 
9 vec2 csqr(vec2 z) {
10  return vec2(z.x * z.x - z.y * z.y, 2.0 * z.x * z.y);
11 }
12 
13 vec2 cmul(vec2 z, vec2 w) {
14  return vec2(z.x * w.x - z.y * w.y, z.x * w.y + z.y * w.x);
15 }