Logo by Trifox - 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: Follow us on Twitter
 
*
Welcome, Guest. Please login or register. July 22, 2018, 06:42:05 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 [2]   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: Mandelbox distance estimation problem  (Read 7673 times)
Description: Problem for scales in [-2,-1]
0 Members and 1 Guest are viewing this topic.
David Makin
Global Moderator
Fractal Senior
******
Posts: 2286



Makin' Magic Fractals
WWW
« Reply #15 on: August 13, 2011, 12:53:31 PM »

> ok, but dr isn't the distance right? The distance I have to calculate finally by
> distance = r * log(r) / dr

Yes - and to be quite honest when using combined transforms in an iteration (e.g. Mandelbox+Mandelbulb) then I'm not really sure what is correct here myself when using analytical DE, either the final calculation needs to be modified to somehow allow for the combined formulas/transforms or the final calculation should be based only on the last transform performed in the iteration loop - i.e. if the Mandelbulb was last then convert the running dr value to a de value using the Mandelbulb method but if a Mandelbox was last then convert running dr to de using the Mandelbox method.

> by the way log(r) to which base is it (I have a little  confusion there because everyone put's it like he wants)?

Traditionally natural log, but you can use whatever log is fastest to calculate, the only difference is modifying a scaler adjustment depending on the log base. Of course on the FPU log base 2 is fastest (I think?).

>So if I have a hybrid fractal with first a mandelbox transformation and later a trig. mandelbulb where can I put the
>"dr = @mpwr*dr*magn^(@mpwr-1.0)"?

Simply imagine your iterative loop made of however many separate transforms/formulas as a separate iteration for each formula and write code for each of those as if it were the only formula in the loop but then put all that code consecutively in the actual loop, so for a box and a bulb in the loop:

loop:
  Calculate Mandelbox and Mandelbox dr (various ways of doing this, I suspect my method is out of date)
  Calculate magn
  Calculate new dr using current dr, magn and the running Mandelbulb dr calculation
  Calculate Mandelbulb
  Test for bailout....

final:
  This is tricky, either find a custom conversion from dr to DE that works well for this particular combined formula, or possibly just use the calculation of DE from dr for the final transform/formula applied in the loop (in this case the Mandelbulb). To be honest I never got around to investigating this as much as I should - you're better asking Jesse or Buddhi what works here.

Of course using either my or Buddhi's delta DE methods then the number and combination of formulas/transforms in the iteration loop has no real effect on the algorithm.

Logged

The meaning and purpose of life is to give life purpose and meaning.

http://www.fractalgallery.co.uk/
"Makin' Magic Music" on Jango
Syntopia
Fractal Molossus
**
Posts: 681



syntopiadk
WWW
« Reply #16 on: August 13, 2011, 01:51:18 PM »

You are not the only one having wondered about that :-) Some of these formulas even use different number types (scalar, complex, quaternion, ...) for the running derivative.

What I have tried (with some luck), is much the same as David suggests above. I keep track of a running scalar derivate, and estimate the final distance as 'r*log(r)/dr' or just 'r/dr'.
Code:
float DE(vec3 p)
{
float dr = 1.0;
while (i < Iterations && r < breakout) {
boxFold(p,dr);
sphereFold(p,dr);
powN2(p,dr);
...
r = length(p);
}
return r*log(r)/dr;
}
Each of the function calls then modify the running 'dr' by a standard (scalar) formula for the given system.

This approach is not exact - in some cases it works good and in other cases it don't - and often needs to be compensated by a small DE multiplier to get good results.

I believe Buddhi uses the Delta DE algorithm when calculating hybrid systems (see e.g. here), but it would be interesting to know how Jesse does it.
Logged
David Makin
Global Moderator
Fractal Senior
******
Posts: 2286



Makin' Magic Fractals
WWW
« Reply #17 on: August 13, 2011, 01:53:57 PM »

Actually I'm convinced that the correct final calculation for analytical DE i.e. converting dr to a DE value should simply be the correct one for the final formula/transform applied in the iteration loop because apart from how often the constant is added there is essentially no difference between say doing an alternating iteration with the Mandelbox say on the odd iterations (1,3,5...) and a Mandelbulb on the even (2,4,6) and of course in that case if the bailout occurs on an odd iteration then the final calculation should be the Mandelbox one, otherwise it should be the Mandelbulb one.

Obviously both the running dr and the final calculation of DE will need more adjustment if you use combined rather than consecutive formulas/transforms, e.g. on each iteration doing:

z = Mandelbox(z)+Mandelbulb(z)+c

Logged

The meaning and purpose of life is to give life purpose and meaning.

http://www.fractalgallery.co.uk/
"Makin' Magic Music" on Jango
barkeg
Alien
***
Posts: 29



« Reply #18 on: August 13, 2011, 04:19:54 PM »

I think I've got it working finally!
I use Buddhi's method for the mandelbox part. I tested before that works fine calculating the distance as
distance=r*log(r)/abs(DEfactor) and maybe multiplying it by a scalar to adjust.

So abs(DEfactor) is the same as dr in the mandelbulb part and can be modified there ( it's something like Syntopia said)

Thanks you all!

@David Thanks for having such a patience with me wink I haven't tried the delta DE yet but I think I understand it and it's the next thing I have to do!
Quote
Actually I'm convinced that the correct final calculation for analytical DE i.e. converting dr to a DE value should simply be the correct one for the final formula/transform applied in the iteration loop because apart from how often the constant is added there is essentially no difference between say doing an alternating iteration with the Mandelbox say on the odd iterations (1,3,5...) and a Mandelbulb on the even (2,4,6) and of course in that case if the bailout occurs on an odd iteration then the final calculation should be the Mandelbox one, otherwise it should be the Mandelbulb one.

Sounds interesting to use the different formulas  ...even you could use different bailouts for the mandelbox and the mandelbulb maybe? I'll try that.


I think this is what a mandel-box-bulb looks like (colored by number of iteration):

For scales in [-1 , -2] it seems to be more connected and for positive scales it seems to be made of little balls



« Last Edit: August 13, 2011, 04:55:56 PM by barkeg » Logged
Jesse
Download Section
Fractal Schemer
*
Posts: 1013


« Reply #19 on: August 13, 2011, 09:03:02 PM »

I believe Buddhi uses the Delta DE algorithm when calculating hybrid systems (see e.g. here), but it would be interesting to know how Jesse does it.

I use Buddhis 4 point method, my code is shown here:

http://www.fractalforums.com/index.php?topic=8262.msg35233#msg35233

Original thread of Buddhis method:

http://www.fractalforums.com/theory/a-new-simple-way-to-compute-de-for-any-trig-mandelbulb/msg11047/#msg11047
Logged
barkeg
Alien
***
Posts: 29



« Reply #20 on: August 13, 2011, 10:44:31 PM »

Thanks, Jesse! I'll take a look at your code! smiley
Logged
barkeg
Alien
***
Posts: 29



« Reply #21 on: August 15, 2011, 11:23:10 PM »

An image with some shadows .... it took a while to render them
Rendered at 2000x2000 and downscaled to 1000x1000 for 2x antialaising

Logged
knighty
Fractal Iambus
***
Posts: 819


« Reply #22 on: August 26, 2011, 02:06:32 AM »

About mandelbox DE, you can take a look here. smiley
Nice hybrid BTW!
Logged
barkeg
Alien
***
Posts: 29



« Reply #23 on: August 27, 2011, 12:28:36 PM »

Thanks, knighty!
I have some exams next time, after that I'll take a look at your variation and also at
the formula of the size of the mandelbox. Seems very intresting. I have to try that out.
Logged
Pages: 1 [2]   Go Down
  Print  
 
Jump to:  


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.212 seconds with 27 queries. (Pretty URLs adds 0.013s, 2q)