top of page
Screenshot 2024-03-13 at 15.00.35.png

Mandelbulb Fractals (Recursion)

This is what is known as a Mandelbulb fractal, which essentially is a 3D visualisation of the famous Mandelbrot Set. This was an interesting object that uses quite a lot of maths, which I was able to recreate in the Blender Geometry Nodes system.

The Mandelbrot set itself is two-dimensional (2D), and stretches across the complex or imaginary plane. 

Thankfully, in 2009 Daniel White and Paul Nylander released the fully developed formula for the three dimensional (3D) representation of the Mandelbrot Set, which was named a Mandelbulb fractal.

The formula for a Mandelbulb is defined as:

Screenshot 2024-03-14 at 08.38.41.png

The main challenge when translating this formula into a 3D software such as Blender, was that Mandelbulbs are calculated using spherical coordinates, rather than the traditional cartesian coordinates which are used in most 3D softwares. Spherical Coordinates, instead of the usual cartesian (x, y, z), use (r, θ, ϕ), where r  is a radius rooted to the world origin, while θ(theta)(inclination) and ϕ(phi)(azimuth) are angles in between the x and z axis and the radius respectively.

Thankfully, there are conversion formulas on the internet, and once I found those there was no issue in converting the Blender (xyz) coordinates to spherical 

(r, θ, ϕ) coordinates, and then back again.

These are the formulas to convert Cartesian Coordinates into Spherical Coordinates:

Screenshot 2024-03-13 at 17.42.16.png

Inversely, these are the formulas to convert Spherical Coordinates into Cartesian Coordinates:

Screenshot 2024-03-13 at 17.44.07.png

With that obstacle out of the way, it was no problem in setting up the Mandelbulb formula in Geometry Nodes, where I decides to go for a total of  5 fractal iterations, with a voxel resolution of 1024^2 , resulting in a total of 1,073,741,824 voxels that needed to be calculated, and therefore pushing the limits of my PC. 

 

This was another obstacle; optimization.

In order to make the fractal run faster without having to give up quality, I simply cut off three quarters of the fractal. I was able to do this because depending on the C value in the formula, the Mandelbulb can result to be symmetrical, and therefore allowing me to mirror the remaining quadrants, all while saving a lot of computational power.

 

Now that the model of the Mandelbulb was complete, procedural and fully customizable, it was time to set up the shader of the Mandelbulb and get it ready for the final render. 

This was not difficult, although getting the lighting right took some time. Once the shader and lighting were done, I rendered out the image, put it through some compositing filters, and with that the Mandelbulb fractal was finally complete.

Sources Used:

Wikipedia - Mandelbrot set

Wikipedia - spherical coordinate system

Libretexts - Coordinate systems

Wikipedia - Mandelbulb Fractals

SteamBean - Mandelbulb fractals in houdini

bottom of page