Discovering the 3D Mandelbulb

There is some exciting news this week in the world of fractals. Daniel White, on his website, describes what is apparently a completely new type of fractal, and the closest analog so far to a true 3-dimensional Mandelbrot set!

Although White mentions that this is probably not the “true” 3D Mandelbrot, the new fractal is undoubtedly a sight to behold, especially considering the renderings he showcases on his webpage.

Unable to contain my enthusiasm, I quickly wrote up a small program that uses OpenGL to actually display this shape in 3D, in real time, to get a feel for what this beast looks like from all angles. Don’t get too excited; the program does not render the shape in real time, it just displays the points rendered so far in real time. The actual rendering process can take a minute or so.

Download the program using the link below, and read further for instructions and screen shots.


The program basically renders the 3D shape by constructing a “point cloud” that approximates the edge of the fractal.

Everything in the program should be relatively self-explanatory, but here’s a brief overview of the features so far:

  • The program lets you click-and drag the rendered shape to rotate it in trackball fashion (left mouse button), as well as zooming in and out (right mouse button).
  • The program lets you select the “power” of the Mandelbulb formula, as well as the number of iterations to perform.
  • The program lets you select the resolution of the point cloud.
  • It gives you a “selection cube” with which you can select a subset of the shape to zoom in on (with the “zoom to cube” button).
  • It has a number of other minor features like fog and anti-aliasing.
  • It uses multiple threads to render the shape, so it will take advantage of multiple cores/processors.

Here are some additional screen shots:

Manipulating the selection cube:

After zooming in on the cube:

Zooming in further:

Looking inside:

Colorized points:

The program was written in C# .NET, using the Open Toolkit Library (OpenTK) which provides an excellent OpenGL wrapper.

Of course, this program is very much in its early stages, so don’t expect it to be perfect. As always, comments and suggestions are welcome!

Share this article:
  • Facebook
  • LinkedIn
  • Reddit
  • Twitter

12 thoughts on “Discovering the 3D Mandelbulb”

  1. Hi, would it be possible to add an export option to export the point cloud data in some form, perhaps .txt files, in order to experiment with importing it into existing 3D packages?

  2. Hi,

    Would you be prepared to release the OpenGL code either for others to use, or as Open Source?

    I would love to incorporate the OpenGL component into an Open Source 3D modeller/renderer that I contribute to
    (Art Of Illusion)


  3. Hi,
    Thankyou for writing this! – It’d take me months to get an environment up and running for rendering the set into. If you wouldn’t mind, I’d suggest the following developments:
    1) Equation editor. For editing the iterative formula and escape condition. As this set is considered to be incomplete still, being able to edit the formula gives great freedom in searching for the true 3D set. If I could just plug in my own CUDA library, that would be even neater.
    2a) better particle representation. 3d spheres if possible, so they scale with camera perspective and provide a seamless surface at all camera positions. Some means of applying a pixel shader for lighting.
    and/or 2b) particle data export, so I can load it into something like vvvv or realsoft3d.
    3) particle parameter keying. The 2D set often uses the number of iterations taken to reach zero to represent colours or heights. Here we can use that data to set colour or transparency, or even particle size.
    4) half decent camera controls(6 axis + zoom), so one can examine details without re-rendering. Motion relative to camera or world. Fog control.
    Of course this is a wish list, not a contract, so do as you please =)

  4. Have just downloaded your excellent program. Mine runs OK under XP, unlike Xezlec. It is on a laptop and is a but slow but that’s OK

  5. Running under Windows 7, I just get the following stack trace.

    ************** Exception Text **************
    System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
    at OpenTK.Graphics.OpenGL.GL.Core.Clear(ClearBufferMask mask)
    at OpenTK.Graphics.OpenGL.GL.Clear(ClearBufferMask mask)
    at MiscTest.Form1.glControl1_Paint(Object sender, PaintEventArgs e)
    at System.Windows.Forms.Control.OnPaint(PaintEventArgs e)
    at OpenTK.GLControl.OnPaint(PaintEventArgs e)
    at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
    at System.Windows.Forms.Control.WmPaint(Message& m)
    at System.Windows.Forms.Control.WndProc(Message& m)
    at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
    at System.Windows.Forms.ContainerControl.WndProc(Message& m)
    at System.Windows.Forms.UserControl.WndProc(Message& m)
    at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
    at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
    at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

    ************** Loaded Assemblies **************
    Assembly Version:
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
    Assembly Version:
    Win32 Version:
    CodeBase: file:///C:/Users/Barney/Desktop/MandelbulbExplorer/MandelbulbExplorer.exe
    Assembly Version:
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/
    Assembly Version:
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/
    Assembly Version:
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/

  6. That’s great!!! I feel that MandelBulb is a great example and very interesting starting point for OpenGL and OpenTK beginners like me.

    Your app works very well in my Ubuntu Linux. It took just 3 seconds to download the binary and to run it with mono. So it’s very cross-platform also. Great! 😉

    Maybe, it will be interesting for you to add 3 more features:
    1. Stereo image (there are a lot of 3D-capable video devices already). The example of stereo rendering is included in OpenTK samples (at least it IS included in svn).
    2. Render it as solid (colored) surface (maybe with some isolevels presented). I know it’s hard to estimate normal for fractals, but MandelBulb is just a close approximation after all, so it IS a regular surface which has normal at every point.
    3. Render it as colored volume — present is as a set of colored transparent or partially-transparent voxels — I think you may get some VERY sweet pictures this way. =)

    Espesially I am appreciate you for this nice coloring palette which is best to be used without fog! It’s very cool. =)

    Best regards!

Leave a Reply

Your email address will not be published. Required fields are marked *