knighty
Fractal Iambus
Posts: 819
|
|
« on: April 07, 2010, 09:41:45 PM » |
|
Melting scale 3.0 mandelbox raytraced using Buddhi's DE. This is my attempt at "smoothing" the foldings of the original mandelbox. I've replaced the cube folding by: y = sqrt( a + ( x + 1 )^2 ) - sqrt( a + ( x - 1 )^2 ) - x. (thanks Timeroot ) I used a=0.1 And the "sphere" folding by: r = sqrt( x^2 + y^2 + z^2 ) k = 3 * r - 2 ; new_r = 1 / 3 * ( k^3 - k + 6 ) / ( k^2 + 1 ) x *= new_r / r y *= new_r / r z *= new_r / r (DEfactor*=new_r / r; for the distance Estimation) it's very slow. Moreover, a good distance estimator (taking into account the smoothing) is to be found. What do you think of it?
|
|
« Last Edit: April 07, 2010, 09:44:26 PM by knighty »
|
Logged
|
|
|
|
reesej2
Guest
|
|
« Reply #1 on: April 09, 2010, 08:44:49 AM » |
|
Oh, very interesting. It looks like the Mandelbox, but with all the edges rounded. What happens if you vary the value of a?
|
|
|
Logged
|
|
|
|
knighty
Fractal Iambus
Posts: 819
|
|
« Reply #2 on: April 10, 2010, 12:45:53 AM » |
|
Yes! this is because of the smoothness of the "foldings". It looks like if it was made out of clay . Unfortunately, the details are also washed out. I don't know if it's due to the distance estimation method I'm using. Here are renderings for different parameters of a and smooth sphere "folding" (scale=3): a=0.0 a=0.1 a=0.2 a=0.3 Things get less interresting for bigger a. Here are renderings for different parameters of a and the original sphere folding (scale=2): a=0.1 a=0.2 a=0.3 a=0.4 a=0.5 a=0.5 and a small solid threshold (I have a bug with my shadow rendering code so I've disabled it)
|
|
|
Logged
|
|
|
|
reesej2
Guest
|
|
« Reply #3 on: April 10, 2010, 08:44:42 AM » |
|
Hmm... it does seem like larger a-values produce blockier results. 0 looks like it's very close to the original box... what about negative a-values? Will that work?
|
|
|
Logged
|
|
|
|
knighty
Fractal Iambus
Posts: 819
|
|
« Reply #4 on: April 10, 2010, 06:07:15 PM » |
|
the function:
f(x) = sqrt( a + ( x + 1 )^2 ) - sqrt( a + ( x - 1 )^2 ) - x.
gives exactly the same result as:
if(x>1.0) x=2.0-x; else if(x<-1.0) x=-2.0-x;
Using negative a doesn't work because for some x you will get a+(x+-1)^2<0.
|
|
|
Logged
|
|
|
|
reesej2
Guest
|
|
« Reply #5 on: April 11, 2010, 07:54:06 AM » |
|
Oh, yes, that makes sense. Also, I think you mean it gives exactly the same result when a = 0. Hm... it doesn't produce the exact same Mandelbox though. That would be because of the smooth sphere folding. I'd be interested to see what happens as that formula is varied, but I'm not sure if there's a convenient parameter in that.
|
|
|
Logged
|
|
|
|
Timeroot
|
|
« Reply #6 on: April 11, 2010, 08:15:07 PM » |
|
That's interesting, the way it turned out. The sphere folding could also be done with some like hyperbolas... you can make a smooth approximation of any piecewise function with them. It would end up being really computationally expensive, though. With the current formula, I've been playing around with what happens as I change the powers to something like 1 / 3 * ( k^11 - k^3+ 6 ) / ( k^10 + 1 ), with interesting results. It makes it "sharper", so it could be used as a smoothness parameter, but it completely loses the area where it acts like 1/x. It's like setting minRadius to 1.
|
|
|
Logged
|
Someday, man will understand primary theory; how every aspect of our universe has come about. Then we will describe all of physics, build a complete understanding of genetic engineering, catalog all planets, and find intelligent life. And then we'll just puzzle over fractals for eternity.
|
|
|
knighty
Fractal Iambus
Posts: 819
|
|
« Reply #7 on: April 11, 2010, 08:57:38 PM » |
|
I think you mean it gives exactly the same result when a = 0 Yes. Sorry, i've forgetten to mention it. it doesn't produce the exact same Mandelbox though. That would be because of the smooth sphere folding. I'd be interested to see what happens as that formula is varied, but I'm not sure if there's a convenient parameter in that. Indeed, It's the effect of smooth sphere folding. I'm still looking for a function which limit is the original sphere folding. Any idea...? The sphere folding could also be done with some like hyperbolas... you can make a smooth approximation of any piecewise function with them. It would end up being really computationally expensive, though. With the current formula, I've been playing around with what happens as I change the powers to something like 1 / 3 * ( k^11 - k^3+ 6 ) / ( k^10 + 1 ), with interesting results. It makes it "sharper", so it could be used as a smoothness parameter, but it completely loses the area where it acts like 1/x. It's like setting minRadius to 1. ... These are two ideas... thanks... again.
|
|
|
Logged
|
|
|
|
eiffie
Guest
|
|
« Reply #8 on: May 24, 2011, 05:17:59 PM » |
|
Just thought I'd add a fast smoothing method in glsl is to use the function smoothstep on the spherical folding.
|
|
|
Logged
|
|
|
|
DarkBeam
Global Moderator
Fractal Senior
Posts: 2512
Fragments of the fractal -like the tip of it
|
|
« Reply #9 on: July 25, 2011, 11:44:11 AM » |
|
Well well! I think smooth folding expression is very complex and it can be reduced a bit Why not mess around with this a=sgn(x) x=abs(x) x=a*(x/(1+x*x*x*x)+(2fold-x)*x*x/(1+x*x)) It is zero if x is zero and tends to the exact value if x is big. Needs some refinement for sure but somebody can do a test render plz?
|
|
|
Logged
|
No sweat, guardian of wisdom!
|
|
|
DarkBeam
Global Moderator
Fractal Senior
Posts: 2512
Fragments of the fractal -like the tip of it
|
|
« Reply #10 on: August 09, 2011, 10:59:43 AM » |
|
Okay now the smooth ABox is for MB3D too. My formula is simplified and different from knighty's, and for now I didn't modified the sphere fold, enjoy if u can
|
|
|
Logged
|
No sweat, guardian of wisdom!
|
|
|
knighty
Fractal Iambus
Posts: 819
|
|
« Reply #11 on: August 26, 2011, 01:33:01 AM » |
|
Hi, DarkBeam: How are you computing the running derivative? I'm curious because I couldn't get a good distance estimate. Also, have you tried Buddhi's method? It looks better than mine.
|
|
|
Logged
|
|
|
|
DarkBeam
Global Moderator
Fractal Senior
Posts: 2512
Fragments of the fractal -like the tip of it
|
|
« Reply #12 on: September 13, 2011, 11:49:42 PM » |
|
Well, the current formula is far more complex than that. I even don't remember it 'cause it is long, so look at my formula archive! It has the raw code and the transcription in pseudo c... Have lots of fun
|
|
|
Logged
|
No sweat, guardian of wisdom!
|
|
|
DarkBeam
Global Moderator
Fractal Senior
Posts: 2512
Fragments of the fractal -like the tip of it
|
|
« Reply #13 on: September 18, 2011, 12:23:53 PM » |
|
Here I paste the description from my formula! An Amazing Box, with Folding function modified as follows (x is each spatial coord);
xp = fix1*x**p; (fast int pow, p is forced to be > 2) u=sgn(x)*xp; x=x+xp*(2*Fold-x); x=x/u;
Also radius folding is smooth (when r<0.99);
r = (x*x+y*y+z*z); if r>0.99 r=1; // prevents fp troubles and speeds up a lot in this case else m=(1+minr)/2; n=(1-minr)/2; r1=(r-m)/n; rs=sgn(r1); r1=abs(r1); rsqrt = sqrt(r1); // this slows down the convergence rp=fix2*(rsqrt**p); (fast int pow, p is forced to be > 3) r = rs*((rp+r1)/(rp+1) * n) + m; endif
(then r = scale / r and is used as a multiplier for x,y,z)
|
|
|
Logged
|
No sweat, guardian of wisdom!
|
|
|
|