A GPU-accelerated fractal viewer.
Try out on http://divVerent.github.io/webglsl-mandel/
- Fast parameter editing.
- Scrolling by dragging.
- Zooming by mouse wheel (desktop) or pinching (mobile).
- Custom formulas in GLSL.
Formulas are directly evaluated in GLSL; for convenience a few functions are provided. Do not use other constructs, as they may not work as you think!
- Variables:
z
: the current iterator variable (Mandelbrot: initialized to the fixed parameter; Julia: initialized to the fragment position).c
: the current parameter (Mandelbrot: current fragment position; Julia: fixed parameter)
- Low level complex operations:
vec2(r1, r2)
: building a complex number from realsz.x
: real componentz.y
: imaginary componentz*conj
: conjugationcabs(z)
: absolute valuecabs2(z)
: squared absolute valuecarg(z)
: argument
- Elementary operations:
z1 + z2
: additionz1 - z2
: subtractionz1 * r
: multiplication with realcmul(z1, z2)
: multiplication with complexz1 / r
: division by realcdiv(z1, z2)
: division by complex
- More complex-valued functions:
cexp(z)
: exponentiationclog(z)
: logarithmcpow(z1, z2)
: powercsin(z)
: sineccos(z)
: cosinectan(z)
: tangentccot(z)
: cotangent
- Constants:
u
: the unity (same asvec2(1, 0)
)i
: the imaginary unit (also reachable asj
, same asvec2(0, 1)
)M_E
: Euler's numberM_PI
: Archimedes' constant