Welcome to Fractal Forums

Fractal Software => Programming => Topic started by: laser blaster on March 29, 2013, 12:25:38 AM




Title: Anti-Aliasing using the distance esitmation formula... good idea?
Post by: laser blaster on March 29, 2013, 12:25:38 AM
From what I can gather, supersampling seems to be the common method for anti-aliasing mandelbrot renders. But why not use the distance estimation formula to approximate the M-set coverage area within a pixel? If you wanted to do it right, you'd have to estimate the distance for both interior and exterior pixels. Sure, it wouldn't be exact, but I have a hunch it would give nice smooth results in a much faster time.

Has anyone tried this? Is it a good idea, or a bad one?


Title: Re: Anti-Aliasing using the distance esitmation formula... good idea?
Post by: makc on March 29, 2013, 01:04:47 AM
and if you use de-based coloring, you don't need aa at all :)


Title: Re: Anti-Aliasing using the distance esitmation formula... good idea?
Post by: laser blaster on March 29, 2013, 04:04:51 AM
I just implemented it into my humble little fractal explorer, and it works pretty dang well. It well exceeds the quality of 4xSSAA, yet it's nearly as fast as no AA at all. Right now, I color all the interior pixels black, and darken the exterior pixels based on their distance, which results in a slight thickening of the thin tendrils (which may or may not be desirable). I might try and implement more accurate AA using interior DE as well as exterior, but I'm not sure if it will be worth it... it depends on how complex the interior DE algorithm is.

The only problem is, this method doesn't AA the color bands, so I need to find a way to AA those too, without resorting to SSAA. And you're right, DE coloring would obviate the need for any AA at all, but I think the escape time algorithm looks much more interesting.


Title: Re: Anti-Aliasing using the distance esitmation formula... good idea?
Post by: laser blaster on March 29, 2013, 04:30:01 AM
Ehh... now after zooming in and taking a closer look at the results, I'm not too crazy about this method.

The problem is that it underestimates the distance around long, thin tendrils, and especially the big needle sticking out of the left of the main cardioid, and it overestimates the distance in the valleys, especially the elephant valley. This leads to jagged valleys, and over-blurring near the needle (right now, since I've implemented exterior DE only, features on the needle have a 'hairy tarantula' look about them). It works great on the other areas of the M-set, though.

Now, this is a long shot, but does anyone know of a more accurate DE formula? I'm using exactly the one found here: http://www.ozone3d.net/tutorials/mandelbrot_set_p6.php (http://www.ozone3d.net/tutorials/mandelbrot_set_p6.php)

Otherwise, if I could find some sort of metric to differentiate valley-like areas from tendril areas from 'normal' areas, then I could easily come up with an approximate correction term for the DE. Any ideas?


Title: Re: Anti-Aliasing using the distance esitmation formula... good idea?
Post by: makc on March 29, 2013, 10:50:47 AM
I need to find a way to AA those too
Clicky here (http://linas.org/art-gallery/escape/smooth.html)

I think the escape time algorithm looks much more interesting.
You are not alone (http://www.fractalforums.com/mandelbrot-and-julia-set/%28and7448and7439and671and671%29-left-or-right/) ;)

it overestimates the distance in the valleys, especially the elephant valley.
Here (http://www.iquilezles.org/www/articles/distancefractals/distancefractals.htm) are some de images, are you getting anything like that?


Title: Re: Anti-Aliasing using the distance esitmation formula... good idea?
Post by: laser blaster on March 29, 2013, 08:46:51 PM
Yeah, my results look just like those images, but the accuracy is highly dependent on the area you're looking at. After thinking about it for a while, I don't think it's due to an inaccuracy with my DE formula. The problem is that distance is an imperfect metric for approximating pixel coverage in the first place. In areas with lots of thin tendrils, a pixel can have a very close distance to the M-set, yet have very little area coverage because the features are just so thin. In places with more compact geometry, like elephant valley, the opposite effect occurs.

It's a shame, because when this method works, it works really well. I tried to come up with a kludgy solution to correct for this inaccuracy, but it was slow and not worth a damn. So I guess the only solution is to adjust the distance threshold manually to best suit the area you're viewing. A slight inconvenience, which, in my opinion, is well worth the savings in rendering speed.

Once I finish implementing interior DE, I'll post some comparison pics.