Welcome to Fractal Forums

Fractal Software => 3D Fractal Generation => Topic started by: subblue on April 14, 2010, 09:45:39 AM




Title: Mandelbox smooth iteration count
Post by: subblue on April 14, 2010, 09:45:39 AM
Due to the planer surfaces present in the Mandelbox structures colourings based on the iteration count can create noticeable shading bands, so I was wondering if anyone has any approaches for determining a smooth/fractional iteration count?



Title: Re: Mandelbox smooth iteration count
Post by: David Makin on April 14, 2010, 01:48:16 PM
The method I use works well enough - but any method based on iteration count (smooth or not) has discontinuities in the Mandelbox.

I use:

   smooth iter = iter + 1 + (log(0.5*log(@bailout))-log(0.5*log(|z|)))/log(log(|z|)/log(|zold|))

Except when bailout occurs on the first iteration when I use:

   smooth iter = 1 + (log(0.5*log(@bailout))-log(0.5*log(|z|)))/log(estimated divergence)


Where @bailout is the value you test the square of the magnitude against and |z| is the square of the magnitude and |zold| is the square of the penultimate magnitude.


Title: Re: Mandelbox smooth iteration count
Post by: reesej2 on April 15, 2010, 12:40:58 AM
I think Timeroot had something based on log base scale^2, but I don't remember the details and can't seem to find the thread.


Title: Re: Mandelbox smooth iteration count
Post by: Timeroot on April 15, 2010, 01:32:08 AM
I was trying to get something to work, with a concept similar to that of Mandelbrot's smoothed count. It worked pretty well, but it did require one parameter which seemed to behave somewhat mysteriously. The thread is at http://www.fractalforums.com/general-discussion-b77/smooth-coloring-of-2d-mandelbox-slices/ (http://www.fractalforums.com/general-discussion-b77/smooth-coloring-of-2d-mandelbox-slices/)


Title: Re: Mandelbox smooth iteration count
Post by: David Makin on April 15, 2010, 02:15:55 AM
For the most part using the log of the divergence at bailout log(log(|z|/log(|zold|) fixes the issues - in just about any formula with divergence >1 (works best for divergence 2 or more, the closer you get to 1 the less accurate it is).


Title: Re: Mandelbox smooth iteration count
Post by: knighty on April 16, 2010, 05:14:25 PM
You can try this formula:

i + ( log( bailout ) - log( r2 ) ) * 0.5 / log(abs( scale ));

here:  r2 = x*x + y*y + z*z.
It works ok -for any scale- but needs a big bail out value, something like 1000000. It becomes less accurate far from the mandelbox. this depends in fact on the bailout value.

you can also use: r2=max(abs(x),max(abs(y),abs(z)))
In this case the "0.5" must be removed and you can use bailout=1000 for example.

Hope this helps :)