Programming.

DE based raymarcher is not the best for this formula. It is not analytical so derivatives - DE can't fully predict formula growth.

*Well, Darkbeam once mentioned discontinuities destroying DE function. *

It have some problems with DE but it is mostly a matter of parameter tuning (internal parameter .DEScale = 0.0105 works OK; Mandelbulbs have .DEScale = 1, for boxes works = 0.5, and for some brots = 2 or 4) and it required unusual bailout value (= 4, 6 or more but not the default 16).

It have a bitt of "sand" - noise. With larger "DE stop" value it dissapears but fractal becomes solid.

Minimisation of ".DEScale" even more improves quality but I think it have one bad side efect. If you increase image size by x2 it will alsou increase "DE stop" x2 and the fractal will become mutch thicker. Probably this internal variable non-lineary interacts with scale and "DE stop".

On another hand DE noise could look as sandstone texture. What is nice for plastic 3D.

This is not too problematic. viewing 1:2 can do miracles.

It takes just single transformation to generate this fractal Zvector=baguafold(Zvector) + C.

`//Baguafold, easy to understand code:`

//Zvector(zx,zy,zz)

// lenght, add - parameters

modulus =sqrt(sqr(zx) + sqr(zy)+ sqr(zz))

if (zx > lenght)

{

zx=-zx/modulus -add;

}

else if (zx < -lenght)

{

zx=-zx/modulus +add;

}

if (zy > lenght)

{

zy=-zy/modulus -add;

}

else if (zy < -lenght)

{

zy=-zy/modulus +add;

}

if (zz > lenght)

{

zz=-zz/modulus -add;

}

else if (zz < -lenght)

{

zz=-zz/modulus +add;

}

It isn't a fold. Transformation turns Z vector outside of defined area into negative of it's unit vector + Add. (Unit vector - vector of same orientation but of the lenght = 1.) With +C this is enought for fractal behaviour.

On X axis on positive side with lenght =2 this would be:

if X > 2 then X=-1; X=X+Xstart

Xstart = 1 will loop forever: 1, 2, 3, -1, 0, 1, 2, 3, -1, ....

`//Mandelbulb3D JIT code, optimised:`

modulus := sqrt( x*x + y*y + z*z);

negativeX := -x;

negativeY := -y;

negativeZ := -z;

// to awoyd division / 0; Not necessary in M3D but still benefitial

if modulus = 0 then

begin

modulus := 1e-15;

end;

if x > Lenght then

begin

x := negativeX/modulus - AddValue;

end

else if negativeX > Lenght then

begin

x := negativeX/modulus + AddValue;

end

else

begin

//walk along

end;

if y > Lenght then

begin

y := negativeY/modulus - AddValue;

end

else if negativeY > Lenght then

begin

y := negativeY/modulus + AddValue;

end

else

begin

//walk along

end;

if z > Lenght then

begin

z := negativeZ/modulus - AddValue;

end

else if negativeZ > Lenght then

begin

z := negativeZ/modulus + AddValue;

end

else

begin

//walk along

end;

x := x*scale + PIteration3D^.J1;

y := y*scale + PIteration3D^.J2;

z := z*scale + PIteration3D^.J3;

Positive baguafold. Here it turns Zvector outside of certain area into it's unit vector.

Xstart = 1 will loop forever: 1, 2, 3, 1, 2, 3, 1, ....

`modulus := sqrt( x*x + y*y + z*z);`

//baguafold, positive version

//optimisation for speed

negativeLenght:= -Lenght;

// to awoyd division / 0; Not necessary in M3D but still benefitial

if modulus = 0 then

begin

modulus := 1e-15;

end;

///=========x==========================

if x > Lenght then

begin

x := x/modulus + AddValue;

end

else if x < negativeLenght then

begin

x := x/modulus - AddValue;

end

else

begin

//walk along

end;

///=========y==========================

if y > Lenght then

begin

y := y/modulus + AddValue;

end

else if y < negativeLenght then

begin

y := y/modulus - AddValue;

end

else

begin

//walk along

end;

///=========z==========================

if x > Lenght then

begin

z := z/modulus + AddValue;

end

else if z < negativeLenght then

begin

z := z/modulus - AddValue;

end

else

begin

//walk along

end;

X/0

Mandelbulb3D like other fractal programms allows of N/0. But the conditional eliminating division by 0 seems to increase render speed. It took off some 0.7 secunds on 2 minutes, but the PC is quite old. Not mutch, but just putting conditional into executable must decrease render speed.

I think Mandelbulb3D JIT compiler is slower than ChaosPro compiler.

QUESTION:

What is PIteration3D^.J? If J = 1,2,3 it is Cx, Cy, Cz. But do this thing have some other variables like zOld or iteration number?

p.s.

For non users of Mandelbulb3D. JIT formulas can be read in notepad as .txt file.