3D Mandelbrot - Multibrot

601 Views Asked by At

The basic Mandelbrot equation is well known $f(z) = z^2 + c$.

The formula for the 'MultiBrot' or 'MandelShape' varies the value '$2$' in the formula $f(z) = z^d + c$.

There are other descriptives for 3D versions of the Mandelbrot fractal but sadly these more commonly take the form of mere colouration - however pretty.

The attached link shows an animation of the Multibrot from $-8$ to $8$. What I am interested in is seeing how this would look from other than the simple vertical overview being shown; clearly this would be an infinite tower from the ring at $-1000$ and the fuzzy circle at $+1000$ (infinity) - so a choice of values and slice must be made.

Ideas please? JK

https://www.youtube.com/watch?v=lM5chKSP_6s&feature=related

2

There are 2 best solutions below

0
On

It is possible to render 3D fractals by ray-marching with distance estimators. The distance estimate tells you, given a point, how far the nearest point in the fractal is. The ray-marching algorithm calculates the distance from a point on the ray (in any direction, not necessarily the ray direction), and steps the ray forward by this amount, thus the ray gets closer and closer to the object (or passes by it and hits the background).

Syntopia has a blog with a series of posts on Distance Estimated 3D Fractals, applicable within the software Fragmentarium and its updated fork FragM. FragM 2.0.0 has a Complex.frag with complex dual numbers for automatic differentiation. Using FragM's DE Raytracer, a "Multibrot Stack" distance estimator can be implemented like this:

uniform float Iterations;     // e.g. 100
uniform float EscapeRadius;   // e.g. 30
uniform float DistanceFactor; // e.g. 0.5
float DE(vec3 position)
{
  vec4 c = vec4(position.xy, 1.0, 0.0);
  float d = position.z;
  vec4 z = c;
  int i = 0;
  float r = length(z.xy); // r = |z|
  while(r < Bailout && (i < Iterations))
  {
    z = cExp(cLog(z) * d) + c; // z = z^d + c
    r = length(z.xy); // r = |z|
    i++;
  }
  float dr = length(z.zw); // dr = |dz/dc|
  // compute scaled distance estimate
  return 0.5 * log(r) * r / dr * DistanceFactor;
}

Note the use of the DistanceFactor variable to scale the distance estimate. This is to try to mitigate the inherent problem with this approach: the distance estimate is only valid in the plane where the power $d$ is constant, but the ray direction in general has varying $d$. Small changes in $d$ might lead to large changes in the distance estimate, but hopefully the change is bounded above by a constant factor.

There is another problem: non-integer powers of complex numbers are multivalued, because complex $\log$ is multi-valued (the imaginary part can have arbitrary integer multiples of $2 \pi$ added to it). This leads to the "cut" that appears along the negative X axis. A proper rendering of the fractal (even in 2D with constant $d$) should better take into account the multiple values, but I don't know the best way to do this.

How does it look? This animation took about 45 minutes to render at an acceptable quality (with DistanceFactor = 0.5):

Multibrot Stack animation

1
On

I've been exploring such slices through Multibrot space with my own application. This is 2D-only, and can specify an arbitrary angle, offset, and rotation. The image is a 90-degree "vertical" slice through the space, where the imaginary component is held a zero, the real component changes along the X axis, and the exponent changes along the Y axis. The result is not "smooth," but displays the same complexity as the more traditional views "from the top."

Vertical Slice through Multibrot Space

enter image description here

The application is http://www.fractaleverywhere.com