Mandelbulb rendering

Last friday a friend of mine was talking about ray marching, the Mandelbulb and programming his own 3D fractal engine. He also kind of challenged me to do the same… So I picked up the challenge and set to work on my own 3D (CPU only) ray marching fractal engine (in Java). It was a very steep learning curve for a programmer with limited math knowledge, but I’m pretty pleased with the first results!

My first 3d engine (tm)

On sunday I had the first things ready, lighting (Blinn-Phong), soft shadows, but still I had no perspective build on (all rays travelled in the same direction) and I had no way to change the view point/camera position:

Simple ray marching example, wrong perspective, two balls and a cube

Next step was to render something other than spheres and cubes, and get the camera position under control, that breakthrough came monday evening:

First Mandelbulb render, full of programming bugs

My first mandelbulb! The perspective is still flat and it misses detail, we’ve also rendered through the camera/near field.
So I made some more improvements and managed to render a nice wallpaper for myself:

First Mandelbulb render, full of programming bugs

Yesterday I’ve been playing around with optimizing the code a little bit (less memory usage, already twice as fast as it was, but still slow). And I’ve added some glow and the ability to add ‘distance fog’. Also I’ve recorded my first movie, just to show some moving fractals:

(yes, it has a glitch with the pink mandelbulb, can’t be bothered to fix…)