Mandelbulbs Mandelbrot sets transformed into 3D…lb.html#renders

we definitely need a CUDA port ;-) UPDATE: we have one - see below.

To get this puppy to screen you need a fast voxel renderer (e.g. 1024x1024x1024 volume segments) ideally with self shadowing and good illumination. And of course you want to use CUDA to compute the formula in the first place. Any takers? I am busy with fractal flames right now.

The zooming process would be somewhat similar to operating an electron microscope, I suppose…

More background here:

Here’s a z^3+c mandelbrot. Or should I say “mandelbot” ?


It looks like someone has already done a GPU version. The iteration formula is pretty simple:…sg8493/#msg8493

Yes, Iñigo Quílez ( ) seems to be on it already. Currently he takes 2 seconds to render one voxel frame. If you look at his web page, he is the creator of some of the best (award winning) “demo scene” contributions in recent years - and he’s currently working for Pixar. You can’t really beat him at his game.

UPDATE: The realtime raytracing thread here hinted me at this. There is a procedural 3D Julia set sample in the Optix SDK. It should be a piece of cake to replace the 3D Julia set with the new Mandelbulb formula, right? ;-) Now if someone would please patch the Quadro FX / Tesla requirement out of the Optix DLLs…


Some early Mandelbulbs source code for the Optix SDK is attached. It was based on the “julia” sample, but I ripped out some unnecessary fluff. Place this in the Optix SDK subfolder where all the other projects are, and include this project in the SDK’s main CMakeLists.txt file. Then run CMake for the Optix SDK and build.

You can spin around this ugly barnacle ball which is an 8th order fractal in 3 dimensions. Rendering is done with the “distance estimation” method, i.e. we’re not intersecting with actual voxels, but instead we’re iteratively using a function that estimates the distance to the fractal’s surface.

I am still pretty dissatisfied with the shading and with the lighting in general. It is hard to make out any detail when zooming in. But still pretty rad for a 3 hour shot at this.

As far as I know the Optix SDK requires GT200 based cards, and without any binary patch only Teslas and Quadro FXs will work. UPDATE: Hmm I also was able to run the samples on a G92b card (Compute 1.1)

UPDATE2: new version of the source code. More surface detail, better key controls.

UPDATE3: can now toggle ambient occlusion, phong shading, reflection - but reflection don’t seem to produce reasonable results. I can’t see reflected images of the bulb on the bulb itself. Some problem with the surface normals?

UPDATE4: automatic level of detail algorithm (always fits window resolution). More controls.

UPDATE5: fixed serious bug in iteration formula, optimized the code, the animation mode now smoothly animates through powers 1-10

UPDATE6: supporting negative powers in the iterative formula, added fake ambient occlusion based on orbit traps, animation mode now includes negative powers.

UPDATE7: Added environment map, enabled reflections, the phong shader is now more similar to some other SDK samples and supports multiple light sources.

UPDATE 8: More animation modes, faster renderung (due to scalar derivative evaluation), go-inside mode

Christian (12.9 KB)

The current output of the program looks like the mouth of the giant Star Wars Sarlacc, or like some pollen under an Electron microscope. Either way, it’s gross.

I’ve updated the software such that the keys +,-, D,d and I,i have some notable effect on the fractal. More tuning to come…


Looks promising, and nice to see somebody using Optix! Could you add some fake ambient occlusion to improve the shading?

BTW, I found another GPU Mandelbulb renderer here:…tional-fun.html

There is an ambient occlusion term, but it is not that effective. In the latest version there is a key to toggle it. Others have successfully implemented A.O. using orbit trapping. I shall try this too.

One of the main problems with this renderer is that the shader is plain awful. I want some real light source, self-shadowing and some realistic material - not this pseudo phong shader. Note that I was getting 2 FPS on the image below (rendered to a 1920x1200 screen, nVidia 9600GSO, image cropped for uploading to this forum)

What an ugly son of a ball ;-)


Definitely try this win32 binary of the Mandelbulb program !!! Please use the free 7-zip ( program to decompress this archive. The .zip file is actually a .7z archive, but the forum software only accepted the .zip file extension.

This program can display a camera flight and smooth morph of a 3D fractal through various powers p=1…10. The program uses the well-known z^p+c iterative formula. The difference to a 2D fractal (e.g. Mandelbrot) is that some extra transformations define the term “z^p” (raise z to the power p) in 3D space. Otherwise it is basically the 2D Mandelbrot formula with arbitrary powers chosen. Power 2 is actually pretty boring in 3D, but higher powers exhibit a lot of fractal patterns. Because of its shape in higher powers it was given the name Mandelbulb.

Start the animation with the space bar. OMG it’s alive :banana: Looks a bit like it’s hatching from an egg.

Hit f for full screen (I recommend a fast card, e.g. GTX 260 or better). On my 9600 GSO I get some 10-30 FPS in the VGA sized window during the animation. A GTX295 might do full screen on 1920x1200 just fine.

When not in animation mode you have control of the camera. I recommend that for zooming instead of moving the camera extremely close to the fractal that you instead use shift+right mouse button to change the camera field of view (much like a telefocus zoom). This allows for finer zooming and panning across the surface. Add more iterations (i) and more surface detail (d) as needed.

You can turn off reflections ( r ) and the background ( b ) if you like, which is also good for frame rates. The other key commands are explained in the DOS box. Cheers.

Next thing to add would be proper self shadowing, possibly even refraction (if that is even possible). Remember, it’s a raytracer.

EDIT: binary has been moved to last post in this thread.



I’m getting 5-10 FPS on the animation when running fullscreen at 2048x1536 on my GTX 295. 50-100 FPS at VGA resolution.

I’ve discovered that negative powers lead to hollow objects when the iteration limit is an odd number.

I’ve named these things “mandeliers” because they have the appearance of a chandelier and are based on the Mandelbrot equation ;)

The updated version I’ve just attached in above postings has better ambient lighting and will also display the mandeliers in the animation mode.

For the mandeliers to render without overstepping errors, you may have to hit the “s” key a couple of times to reduce the raycasting step size.


Shiny new shaders and an environment map! For this screen shot I reduced the fractal detail so you can see the reflections better.

NOTE: I switched the .zip compression to 7-zip compression, but had to keep the original .zip file extension.

The updated binary is in my (cbuchner1’s) last post in this thread. Source code is a few more postings up (#4 I belive).

Who says that the algorithm doesn’t work for power 2?? Looks like a genuine 3D mandelbrot to me!

It gets even closer to a mandelbrot shape when you increase the iteration count. However the problem is that there is little fractal detail outside the x,y plane. For the low powers most of the 3D detail (when zoomed in) has the shape of “whipped cream” and is not all that interesting. It takes higher powers to get self-similar patterns. See the links in the first posting for more background and renders.

The guys on have continued their quest for the “true 3D mandelbrot” - the Mandelbulb was a hot contender, but not quite it.

Here’s a pretty cool render of a power 3 fractal. Looks a bit like an alien encounter. Definitely beats a Quaternion Julia fractal in terms of creepiness.


Hi, I also got some fun rendering the Mandelbul set on the GPU :-)
Here is a video of the set rendered in real-time by our GigaVoxels rendering engine implemented with CUDA. The fractal is computed on the GPU, not during the ray-casting as for Christian’s demo, but as voxels stored into an Octree. Voxels are produced on-the-fly and stored into a cache in video memory in order to be reused while they stay visible. The octree is also subdivided on-the-fly and the subdivision is triggered directly by the ray-casting kernel. That prevents to generated any occluded data.
I compute Ambient Occlusion very efficiently using filtered low resolution voxels and soft shadows are computed with secondary rays. Everything runs at around 20Hz.

GigaBroccoli: YouTube video

I have uploaded another video showing more small details and with a better and more impressive camera trajectory.

A better quality video can be downloaded there:


Nice rendering technique. But what is causing the strangely glowing color seams?

Will you make a binary of the broccoli available for download for all the vegetarians out there? ;)

EDIT: woohoo, 1000 views :bunny:

By the way I am working on a version where you can get “inside” the bulb. Well, not really inside, but I kind of swap outside and inside mathematically so the bulb fully surrounds the camera. Also I am trying to get a stereoscopic rendering done, for red/blue or red/green goggles.


About the blue glowing color, I just felt it looks better with it… :unsure: It is just added as a blue semi-transparent color at a given distance to the set with the transfer function.
I will make a binary available when it will be finished, and when I will have fixed the remaining bugs and artifacts.


Sorry to revive a dead bulb :yucky: , but here’s a new binary. :w00twave:

UPDATE: just corrected the path to HDR background image in this binary. The 10 downloaders so far might want to try again ;)

This new version adds:

    two new animation modes in addition to interactive mode (cycle with space bar)

    faster rendering (up to factor 2 speed gain)

    speed control for animations (t/T keys)

    go-inside mode (toggle with g) - you can move the camera inside the bulb when enabled

Reflections and shadowing are by default turned off for better rendering speed, use “r” and “o” to turn these features on if you wish.

WARNING: Attached .zip file is actually a .7z archive. You can only decompress it with 7-zip from (free software)

Potentially you’ll also have to grab the VC2008 SP1 ATL security fix runtime here (vcredist_x86.exe on the Microsoft site).

Doesn’t work in windows for me, can anyone link the source code for Linux?

Problems decompressing the .zip file - or did the binary not run? It was built with Visual C++ 2008 SP1 with the ATL security patch installed.

Maybe you don’t have the required VC++ runtimes yet (vcredist_x86.exe - there’s a Download button near the bottom of the page)…;displaylang=en

Source code: See Post #4, and you’ll need the CUDA 2.3 toolkit and the Optix SDK (which does require either a Tesla or a Quadro FX card without applying “hacks” - I hear they plan to drop this requirement with the release of Fermi)

P.S.: Mandelbulb binary is now lurking in Post #18 ;)