Most amazing fractal renderer: Buddhabrots comes with source code and ready-to-run binaries


Win32 binaries and source code are attached, see bottom of posting.

I have used a week off to implement a really cute fractal renderer. This is still work in progress. It displays the Mandelbrot set in an unusual way, often referenced as “Buddhabrots” or “Nebulabrots”. It plots the escape trajectories of all points not belonging to the Mandelbrot set (those that escape to infinity when iterated). So in essence it is a scattered write torture test for your graphics card.

I think that I may have written the fastest Buddhabrot renderer on the planet. Prove me wrong.

Due to the statistical nature of rendering the fractal, generating deeply zoomed images was a challenge. You’ll simply not have enough trajectories hitting pixels in the zoomed region. I use an algorithm called Metropolis-Hastings to speed up rendering deep zooms. Otherwise you’d literally wait forever for an image. When zoomed, you can expect rendering to occur about at the speed a Polaroid photo appears. Image quality gets better over time.

I’ve implemented a novel physics-inspired coloring method which is now the default. It creates most astonishing images, some ressembling an oil sheen on water ;)

EDIT: This coloring method was originally suggested by kram1032 on This is currently the forum where you’ll find the most interesting novel ideas in fractal generation (see e.g. the Mandelbulb or Mandelbox).

To zoom, drag a rectangle with the left mouse button and then right click into it. Right click outside the selection to remove it. Press and hold Ctrl and/or Shift to modify the behavior of the selection rectangle. All other key commands are explained on the console window (DOS box).

Feel free to make screenshots of the window contents and attach them here. The program cannot yet save images, so you’ve got to use your favorite screenshot or window capture tool. You can do renders at Full HD, but the window needs to fit the screen so you can take screen captures. The window’s maximize button can be useful here.

Place the DLLs from the attached zip archives in the Release folder in case the program yells for DLLs (they should all be part of CUDA toolkit and SDK). The various .BAT files contain parameter sets for different coloring methods and can also be used to start the program. Feel free to edit them, in particular the default window size and coloring parameters.

Use of GTX 260 or better is recommended. It still runs admirably on my laptop’s Geforce 9600M graphics card

Source code builds with CUDA toolkit 2.3 (or later?) when you place the Buddhabrot folder in the SDK’s C/src directory. Compute capability 1.1 or better is required due to global atomics used in Analysiskernel. This kernel can be commented out and compile options set to use sm_10 if you have a 8800 GTX card.

Linux and Mac persons will have to create a makefile for this project, best to base it on e.g. the “Sobel” SDK sample’s makefile.

Click on the thumbnails to see some test renders, and try the program for yourself. It’s free, no strings attached.

fractal_oil_spill2.jpg (125 KB)
[This file was removed because it was flagged as potentially malicious] (255 KB) (158 KB)


Christian, that looks really nice! I remember that someone else made a CUDA-based fractal renderer a while back (I think it was called ‘Fractron 9000’), but I had a few problems with it when I tried it out. This is awesome simply for the extra effort you put into the algorithms! And, it might make a good test case for our first product – which I’m unveiling at GTC (or shortly before) – if you don’t mind, that is.

I am not putting any restrictions on use, other than retaining my copyright to the parts of the code that are not copied from SDK samples. The code as it currently is doesn’t have any benchmark features really, but if it makes a good showcase then use it ;) Some attribution would be kind though.

The Fractron 9000 you mention renders iterated function systems, an entirely different breed of fractals.

I am attaching a version that has a little less red bias in deep zooms in wavelength color mode. This is because I now let the visible spectrum fade to black when going above and below 380 and 780nm. In the previous version the wavelength was simply clamped to the violet or red limits.

Following a zoom it should resume rendering a little faster because it will keep those random seeds that generate orbits intersecting the newly defined zoom window. I also fixed some spurious pixels that would sometimes appear when zooming (memory access race during global memory writes). (161 KB)