### DE computation (simplified / pseudocode)

• 6 Replies
• 321 Views

0 Members and 1 Guest are viewing this topic.

• Posts: 63

#### DE computation (simplified / pseudocode)

« on: April 01, 2020, 09:01:22 PM »
Hi, for a while I've been wondering how the hybrids work in Mandelbulber / MB3D, and while the code is available (at https://github.com/buddhi1980/mandelbulber2/blob/master/mandelbulber2/opencl/engines/compute_fractal.cl) I find it a little difficult to understand; there are a great many cases and variables with somewhat opaque names (e.g. tweak005).

I'd greatly appreciate it if anyone can provide a kind of overview or simplified/pseudo code for how this works. I understand how "Delta DE" (finite differences) works, but how the mixing of the formulae works and how the final DE computation is done is a bit of a mystery still.

Thanks!

• Posts: 63

#### Re: DE computation (simplified / pseudocode)

« Reply #1 on: April 01, 2020, 11:36:47 PM »
I'm getting some help from Bezo97 in the Fractal Chats Discord server with making a doc for this effort, here's a view-only link (just ask if you'd like write access!): https://docs.google.com/document/d/1SOpp1DYGZoo4oyIqJAZ418jembmAR3JTpaGVoGVgEO0/edit?usp=sharing

When the reference hybrid DE fractal tracer is up and running I'll post a link here too.

#### mclarekin

• Fractal Freak
• Posts: 784

#### Re: DE computation (simplified / pseudocode)

« Reply #2 on: April 02, 2020, 11:25:43 AM »
@lycium As you know I have now joined Discord  to help, but to answer your question about hybrids in Mandelbulber:

generalized answer, we have the DE stuff inside the formulas/transforms updating the DE, then we do the final calculation at termination. If all formulas used in a hybrid are of the type that can use  Linear DE, then we use Linear DE final calc   outDistance = r / DE.  Similarly if all logarithmic we use log final calc. But when we are making a hybrid which mixes  linear and log types we generally use log final calc, but occasionally linear is better. By default the program initially calculates what the likely DE function should be (called automatic). We have a drop down menu that allows us to test different final calculation DE functions. Most of the transforms work OK with either linear of log types

• Posts: 63

#### Re: DE computation (simplified / pseudocode)

« Reply #3 on: April 12, 2020, 12:57:25 PM »
With help from claude, mclarekin and Buddhi in the Fractal Chats Discord server (thanks you guys!) the first code release is available: https://github.com/lycium/FractalTracer

There still is a lot to do, but already there should be some useful information and techniques in there; in particular the use of dual number arithmetic for distance estimation may be of interest.

• Posts: 63

#### Re: DE computation (simplified / pseudocode)

« Reply #4 on: May 03, 2020, 07:28:32 AM »
SpongeBulb SphereLights, a Menger sponge / Mandelbulb hybrid

• Posts: 63

#### Re: DE computation (simplified / pseudocode)

« Reply #5 on: May 16, 2020, 02:38:17 PM »
A more recent example with materials and HDR environment mapping:

• Posts: 63

#### Re: DE computation (simplified / pseudocode)

« Reply #6 on: May 18, 2020, 11:01:56 PM »
Small update to mention that we've confirmed, this code is producing excellent SSE and AVX compiled results:

Some random benchmark results when rendering a 1280x1280 Mandelbulb of 16 iterations, with 5 bounces of global illumination and double precision: 12.4 seconds per pass on my 4.7GHz i7 8700K, watercooled 8core Ryzen 3700x at 4.1GHz gets about 12.5s, and the 32core Threadripper 3970x of Julius Horsthuis gets 3.2s per pass!

### Similar Topics

###### Matt Benesi's Heightmap for Planes, Simplified

Started by Sabine62 on Code Snippets (fragments)

1 Replies
70 Views
August 09, 2020, 03:20:51 PM
by Sabine62