Welcome to Fractal Forums

Fractal Software => Programming => Topic started by: tryptophan on April 01, 2013, 10:39:45 PM




Title: Why are these artifacts happening?
Post by: tryptophan on April 01, 2013, 10:39:45 PM
Hi I'm wondering if someone can explain why this artifacts are happening in the image below. I've modified the menger2 formula from Fragmentarium and am just wondering why these appear with certain settings. I've found I can remove them by cranking the detail parameter higher but I wondering if there is a mathematical solution. I've posted the code for the fractal also.

Any help would be greatly appreciated
thanks
Keith
Code:
float DE(vec3 p)
{
if (Fold.w != 1.0) flip = Fold.w;

p += Position;
p *= fullRotate;
p=p*0.5+vec3(0.5);
vec3 pp = abs(p-0.5)-0.5;
pp *= ScaleVary * -1 +1;


pp += Julia;
float k=1.0 * (Fatness + 1);
float d1 = max(pp.x,max(pp.y,pp.z));
float d=d1;
for (int i = 0; i < Iterations ; i++)
{
p = p * rot2 + Offset * 0.1;
vec3 pa = mod(3.0*p*k, 3.0);

k *= Scale;


pp = 0.5-abs(pa-1.5)+(Fold.xyz*.2);
pp *= 1 - flip;
        pp*=rot;
d1=min(max(pp.x,pp.z),min(max(pp.x,pp.y),max(pp.y,pp.z)))/k;//distance inside the 3 axis aligned square tubes
d=max(d,d1);
if (i<ColorIterations) orbitTrap = min(orbitTrap, abs(vec4(pp,dot(pp,pp))));

}
orbitTrap*=ColorScale+ColorOffset;
return d;
}


Title: Re: Why are these artifacts happening?
Post by: cKleinhuis on April 01, 2013, 11:41:33 PM
ehrm, what artifacts do you mean ?!
you might have to use a nonDE approach, meaning just implement a BruteForce Inside outside test, when modifying a formula which rendering relies on a DistanceEstimation you need to adjust the DE as well, but this can be quite demanding ....


Title: Re: Why are these artifacts happening?
Post by: tryptophan on April 02, 2013, 04:57:38 AM
Awesome - Thanks for the reply. Sorry I wasn't more clear about what I was talking about. I was referring to the circular bands which only happen at when certain parameters are at particular values.

I've studied a bunch distance estimation stuff (mostly from the Iquilez site)and am able to use it and understand it as far as the ray marching goes but I still don't really understand what DE values for a point make it visible or not visible and how the value of point can describe it's angle either to the light or the camera.

Maybe if I search this forum and check out some of your ChaosTV I'll get a clear understanding.

thanks for tips!
Keith


Title: Re: Why are these artifacts happening?
Post by: cKleinhuis on April 02, 2013, 09:59:17 AM
you will especially enjoy the lates news issue ;) your videos are featured there

back to the topic:
you wont find any help in the show right now :( right now the show covers just the basicst of ideas, nevertheless, lols i cant help on developing de formulas as well, the only thing i understand is that the estimation works by measuring the width of the iteration bands that for example are the colors of the mandelbrot, the smaller those bands become the closer you are to a surface, it is done using derivations (lols i really cant explain how it works, really!!!), DE estimation does not work for inside areas because there is no bailouting happening that could be used to determine the speed

for playing around with arbitrary formulas ( which i advise, and is the most funny and relaxating thing you can do ;) ) one needs a brute force raytracer, the only difference is that
the step can not be adjusted while shooting the ray depending on the distance to the object, but this affects the calculation only minor ( in my eyes ) stable zero point search algorithms like the newton approach lead to very useable results ( this is something i am going to cover in my show, targeting school girls/boys explaining why the zero points are so important in analytics )

the inside outside test is the straitforward thing, you are inside your fractal if a point doesnt diverge ( no-bailout   )

i think syntopia has not officially released the build of fragmentarium with the brute force raymarcher, but you can find it here
http://www.fractalforums.com/3d-fractal-generation/rendering-3d-fractals-without-distance-estimators/msg54477/#msg54477


Title: Re: Why are these artifacts happening?
Post by: eiffie on April 02, 2013, 05:22:09 PM
I am guessing there are thin sections that get jumped over so yes lowering the detail would help. They are circular because those rays travel exactly the same distance to hit the fractal and just happen to step through. I think the best answer is probably just to avoid those settings where very thin sections are created.


Title: Re: Why are these artifacts happening?
Post by: tryptophan on April 02, 2013, 08:40:43 PM
Thanks Effie I knew had to do with the thin areas but just didn't know why. If just rendering images the thin areas are easy to avoid but I'm doing animations where the fractal has to get thin. The detail solution does work I was just wondering if there was some sort of thinness test I could do (set some sort of threshold) - or is that part of what the detail is doing already?



Title: Re: Why are these artifacts happening?
Post by: eiffie on April 02, 2013, 10:10:05 PM
If you are able to modify the renderer you can look at adding a back step with some jitter when the DE starts getting larger after coming close to the surface. Maybe?? Multiplying the first ray step by a random number will remove the circular banding but you will still see some pixels ramming through. I am afraid it is just an issue with distance estimation. In reality those thin sections probably have zero width so what should the tracer do?

The other way to look at it is as artistic license. Maybe the walls should dissappear in circular sections:) Like Kleinhuis said "what artifacts?"


Title: Re: Why are these artifacts happening?
Post by: tryptophan on April 04, 2013, 12:58:31 AM
Thanks for the help guys. Yeah the backstep and dither don't really remove the banding but cranking the detail up does in most cases. Once in while it still pops through but not to bad. I've got something decent working for now.

thanks
Keith


Title: Re: Why are these artifacts happening?
Post by: eiffie on April 04, 2013, 05:39:05 PM
After thinking about this it seems a higher fudgeFactor is probably most important. dunno