3D fractals

I have always been interested in fractals. When I was a teenager, my grandfather gave me the book "Chaos, Fractals, & Dynamica, Computer-experimenten in de wiskunde" by R. Devaney. At that time scientific books were sometimes translated in Dutch. I read the book several times, each time understanding a bit more of it. Then I explored fractals with fractint, Xaos, etc.

In 3D

I was trying to extend the Julia and Mandelbrot fractals to 3D. There are two exensions of complex numbers to 4D: hypercomplex numbers or quaternions. In the 3D modeller Povray, fractals can be specified in these spaces and sliced with a hyperplane into a 3D shape. Howver, the results never look very interesting, but more like a sweeped and twisted version of the 2D Julia fractal.

What was missing is a 3D escape-time fractal that could be used like the Mandelbrot set. The constraints were that they should behave like complex numbers when the third coordinate was 0. In addition, only a squaring operation was needed, since the recursion function is u' = u ^ 2 + u_0. I tried by just expressing the 3D vertices in polar coordinates (r, phi, theta) and expressing the square with (r, phi, theta) -> (r^2, 2*phi, 2*theta). All points where the module of the series remains below a threshold (say 2000) after some iterations (15) are considered inside the fractal. The surface could be explored using a marching cubes algorithm. The result did not look so good: Mandelbrot was like a flat spaceship without many interesting features, so I abandoned the project.

The mandelbulb

In 2009, Daniel White and Paul Nylander developed the Mandelbulb fractal, that is based on approximately the same 3D extention of complex numbers. The main differences with my old approach is that they use higher powers for the recursion function and they ray-trace the result with the distance estimator, which gives much more accurate results on small details of the surface.

The Mandelbulb function after a given number of iterations and its derivative w.r.t u_0 (useful to compute the surface normal), can be expressed as polynoms of high degrees. I used Maple to generate the C code that corresponds to them, which can be used as OpenCL almost as is. I ran it on a nVidia GTX 680 GPU to render the fractal in interactive time (ie. not-too-nervous people can navigate in the fractal). Here are few images of the results:


July 2010