Why 3D fractals are hard
The Mandelbrot set lives in the complex plane, generated by z → z² + c, and it works because complex multiplication is analytic — differentiable everywhere and angle-preserving, which is what produces infinitely intricate self-similar boundaries. Extending this to three dimensions would need a normed division algebra over ℝ³, but Hurwitz's theorem proves no such algebra exists — the only valid ones have dimension 1, 2, 4 (quaternions) or 8 (octonions), never 3. Quaternion fractals do exist in 4D, but projecting them back to 3D yields relatively smooth shapes without the bulb structure fractal artists were chasing. Two workarounds survive: algebraic hacks like the Mandelbulb's spherical power operation, and geometric iteration — repeatedly folding space, as the Menger sponge and Mandelbox do.
The Mandelbulb: a spherical power-8 formula
Introduced by Daniel White and Paul Nylander in 2009, the Mandelbulb converts a 3D point into spherical coordinates (r, θ, φ), raises the radius to the n-th power while multiplying the angles by n, converts back to Cartesian, and iterates v → vⁿ + c from v = 0. At n = 2 the result is a featureless smooth ball; as n climbs, the surface grows dramatically more self-similar detail, and the canonical choice n = 8 produces the deeply nested, spiralling bulbs everyone recognises, with a boundary Hausdorff dimension estimated near 2.97 — nearly space-filling. Because the spherical power operation is not a holomorphic map, the Mandelbulb is not literally a 3D Mandelbrot set with the same mathematical guarantees — but visually and computationally it's one of the most rewarding fractals ever rendered.
Mandelbulb distance estimator (Íñigo Quílez): dr ← n · r^(n-1) · dr + 1 // running derivative magnitude DE = 0.5 · log(|z|) · |z| / dr // after escape — safe step bound Ray march: p += DE · rd; repeat until DE < ε (hit) or dist > max (miss)
Sphere tracing: marching by a safe distance every step
A signed distance field (SDF) is a function f(p) returning the distance from a point to the nearest surface — negative inside, positive outside, zero exactly on it. Sphere tracing exploits this: cast a ray, evaluate the SDF at the current position, jump forward by exactly that distance (guaranteed not to overshoot any surface), and repeat until the distance falls below a tiny epsilon (a hit) or the accumulated distance exceeds a cutoff (a miss). Surface normals for lighting come from the SDF's gradient via finite differences — the Quílez tetrahedron trick reduces this to four evaluations instead of six. Thin fractal features demand many small steps, so typical implementations run 64–256 steps per pixel; an relaxation factor above 1.0 lets the ray move faster through open space while still backtracking safely near detail.
Colouring the surface: orbit traps and smooth iteration
Raw escape-time iteration counts are integers, which bands the rendered image visibly; smooth iteration counting replaces the integer with smooth_i = i − log₂(log₂(r)) + 4, derived from potential theory, to erase the staircasing. Orbit traps add richer colour by tracking how close a point's iteration orbit passes to a reference shape — a point, a plane, or an XY-cross — and mapping that minimum distance to colour, producing vibrant ring and cross patterns far beyond simple gradient shading. Related fractal families extend the same distance-estimator machinery: the Mandelbox (Tom Lowe, 2010) alternates a box fold with a sphere fold to build recursive, city-like structures, and hybrid fractals mix steps from different formulas entirely.
Frequently asked questions
Why isn't there a true 3D version of the Mandelbrot set?
The Mandelbrot set relies on complex-number multiplication being analytic — angle-preserving and differentiable everywhere. A true 3D analogue would need a normed division algebra over three-dimensional space, but Hurwitz's theorem proves the only such algebras have dimension 1, 2, 4 (quaternions) or 8 (octonions), never 3. The Mandelbulb instead uses a spherical power operation that is visually convincing but not a holomorphic 3D Mandelbrot set.
Why is power 8 used for the Mandelbulb?
At power 2 the spherical iteration produces a smooth, featureless ball. As the power n increases, the surface develops progressively more self-similar detail; at n = 8 — the value chosen by discoverers Daniel White and Paul Nylander in 2009 — the fractal shows deeply nested, spiralling bulbous structures with a boundary Hausdorff dimension estimated near 2.97.
What is a distance estimator and why does ray marching need one?
A distance estimator (DE) is a function giving a safe lower bound on the distance from a point to the fractal surface. Ray marching advances a ray by exactly that safe distance each step rather than a fixed increment, so it never overshoots a thin feature. For the Mandelbulb, the DE is derived from the magnitude of the iteration's running derivative: DE = 0.5 · log(|z|) · |z| / |dz|.
Try it live
Everything above runs in your browser — open Mandelbulb 3D Fractal, slide the power n to morph the spiky shell, and watch a distance-estimator ray marcher render it on the GPU in real time. Nothing is installed, nothing is uploaded.
▶ Open Mandelbulb 3D Fractal simulation