Welcome to Fractal Forums

Fractal Software => 3D Fractal Generation => Topic started by: khyperia on March 03, 2012, 04:07:11 AM




Title: Coloring mandelbulb
Post by: khyperia on March 03, 2012, 04:07:11 AM
I made a mandelbulb program (from scratch) in C#, but my current coloring algorithm is... underwhelming. A quick render I did is over here- http://khyperia.deviantart.com/art/The-tunnel-to-everywhere-288260051 (http://khyperia.deviantart.com/art/The-tunnel-to-everywhere-288260051) (basic information about the program is also on that page)

My question is this- What is a good coloration method for a 3d fractal? Currently I'm doing "orbit trapping", where I take the smallest absolute value and use that for color. This, however, produces the rather dull, everything-the-same-color look in that image I linked. I also cannot use total iterations until escape, as the final point I use is at an unknown (yet very small) distance away from the fractal, so the result would be quite random. What other coloring methods are there, and how do I implement them?
(google has failed me on this, not many people have done the mandelbulb so documentation is sparse)


Title: Re: Coloring mandelbulb
Post by: Mrz00m on March 06, 2012, 05:50:15 AM
does this help? i think i modded it abit, the original formula is from mandelbulber1.11 name mandelbulb.cl


Code:
		float th0 = (native_divide((z.y),r));
float ph0 = atan2(z.y, z.x);
float rp = native_powr(r, power - 1.0f);
float th = th0 * power;
float ph = ph0 * power;
float cth = cos(th);
r_dz = rp * r_dz * power + 1.0f;
rp *= r;
z = (float4) {cth * native_cos(ph), cth * native_sin(ph), sin(th), 0.0f};
z*=rp;
z+=c;
r = fast_length(z);
if (r < colourMin) colourMin = r;
if(r>4.0f || any(isinf(z)))
{
distance = 0.5f * r * native_log(r) / (r_dz);
out.colourIndex = colourMin * 5000.0;
break;
}


Title: Re: Coloring mandelbulb
Post by: asimes on March 06, 2012, 06:13:33 PM
Hello, Mrz00m put a link on my own Mandelbulb coloring question to here. I figured I might as well share that incase any of my questions are similar enough to yours. The topic is here: http://www.fractalforums.com/programming/basic-3d-fractal-coloring/

I had tried distance estimation but don't know how to calculate a derivative so I had to simplify the equation (which makes for a lousy distance estimation). The distance estimation equation can be found here: http://www.subblue.com/blog/2009/12/13/mandelbulb


Title: Re: Coloring mandelbulb
Post by: Alef on March 06, 2012, 06:39:52 PM
Looks nice. Maybe you should look at Chaos pro database.

Actually interesting are orbit traps with displacement. Colour by orbit=cabs(z+2); Probably you will see nice dots around regions where z=-2. Of corse if colour goes around, what allredy are implemented in Chaos pro engine.

Tray exponent smoothing calculated just from the first few iterations. But using  |z+somenumber|. Actualy it is in Chaos Pro database as number seeker colouring.

Look at my code:
http://www.chaospro.de/formulas/display.php?fileid=224 (http://www.chaospro.de/formulas/display.php?fileid=224)