Welcome to Fractal Forums

Fractal Software => Programming => Topic started by: Geometrian on April 03, 2014, 04:02:06 AM




Title: Inaccurate Mandelbulb DE for far Distances
Post by: Geometrian on April 03, 2014, 04:02:06 AM
I have written code that will raytrace a Mandelbulb using the distance estimator here (http://blog.hvidtfeldts.net/index.php/2011/09/distance-estimated-3d-fractals-v-the-mandelbulb-different-de-approximations/).

I know that the estimate is only accurate in the limit, but I have cycles to spare, and so I threw 800 iterations at it.

I have noticed that, despite this, for (relatively) large distances (like 100.0), the distance estimate returns an estimate that is far too large. Therefore, if you are far away from the bulb, the rays can step right through it.

Is this expected? If not, is there a consistent way to limit it?


Title: Re: Inaccurate Mandelbulb DE for far Distances
Post by: Syntopia on April 03, 2014, 08:17:42 AM
Is this expected? If not, is there a consistent way to limit it?

Yes, this is standard behavior. One way to get around it, is to calculate a bounding sphere around the Mandelbulb, and advance the ray to the sphere before starting the ray marching. Another way is to simply multiply the step length by a suitable number less than one (a "Fudge Factor").


Title: Re: Inaccurate Mandelbulb DE for far Distances
Post by: Geometrian on April 04, 2014, 01:55:08 AM
Quote
Yes, this is standard behavior.
Thanks.
Quote
One way to get around it, is to calculate a bounding sphere around the Mandelbulb, and advance the ray to the sphere before starting the ray marching.
I thought of this shortly after my first post. I just tried it and it seems to work fine. I'm using 6.0 as the radius of the sphere (same as bailout of Mandelbulb).
Thanks,


Title: Re: Inaccurate Mandelbulb DE for far Distances
Post by: Geometrian on September 15, 2014, 09:17:36 PM
Actually, using radius 6 is a bad idea; for certain rays, you can still step too far.

Some previous work I did indicated that a good bounding sphere for the mandelbulb is about 2.2 (I'd be interested if anyone has anything more accurate/rigorous). Currently, I'm using a radius of 3 to step rays close enough, and then a bailout radius of 6. This seems to work much better.


Title: Re: Inaccurate Mandelbulb DE for far Distances
Post by: cKleinhuis on September 15, 2014, 10:02:44 PM
try including the "fudge factor" variable that syntopia mentioned, you multiply the calculated distance by this value - usually fudgefactor<1 - by that you can correct glithes that can appear all the time when rendering such objects with that fudge factor you have a method to control the detail a little bit (at the cost of longer calculation time, but affordable )