Logo by mclarekin - Contribute your own Logo!

END OF AN ERA, FRACTALFORUMS.COM IS CONTINUED ON FRACTALFORUMS.ORG

it was a great time but no longer maintainable by c.Kleinhuis contact him for any data retrieval,
thanks and see you perhaps in 10 years again

this forum will stay online for reference
News: Support us via Flattr FLATTR Link
 
*
Welcome, Guest. Please login or register. March 29, 2024, 02:15:57 PM


Login with username, password and session length


The All New FractalForums is now in Public Beta Testing! Visit FractalForums.org and check it out!


Pages: [1]   Go Down
  Print  
Share this topic on DiggShare this topic on FacebookShare this topic on GoogleShare this topic on RedditShare this topic on StumbleUponShare this topic on Twitter
Author Topic: "Smooth" folding  (Read 5425 times)
0 Members and 1 Guest are viewing this topic.
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  smiley)
   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?  embarrass
« 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 Azn. 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
Fractal Fertilizer
*****
Posts: 362


The pwnge.


WWW
« 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 »

Quote
I think you mean it gives exactly the same result when a = 0
Yes. Sorry, i've forgetten to mention it.

Quote
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...?

Quote
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. wink
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 wink
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. smiley
Needs some refinement for sure but somebody can do a test render plz? cheesy
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, wink enjoy if u can cheesy
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! cheesy It has the raw code and the transcription in pseudo c...
Have lots of fun wink
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! wink

Quote
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!
Pages: [1]   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
"19th Hole Terraces" fractal zoom in HD (XviD and H.264) Movies Showcase (Rate My Movie) ericbigas 4 6655 Last post January 05, 2007, 04:19:43 AM
by Zoom
"True 3D" Mamdelbrot, solid based on orbit trapping animation 3D Fractal Generation David Makin 5 18378 Last post September 02, 2009, 10:23:26 PM
by David Makin
Mandelbox with "smooth" conditions 3D Fractal Generation Buddhi 5 3553 Last post May 22, 2011, 03:02:08 PM
by knighty
A "smooth" transition ... Mandelbulb 3d « 1 2 » DarkBeam 19 5224 Last post September 28, 2011, 04:41:27 PM
by DarkBeam
Extension of "folding" Programming « 1 2 » David Makin 27 2847 Last post February 01, 2012, 12:07:50 AM
by David Makin

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.254 seconds with 24 queries. (Pretty URLs adds 0.014s, 2q)