JosLeys


« on: March 23, 2010, 12:45:39 AM » 

I found that the following very simple formula works quite well; DE=1/(1+exp(s4)) , where s is the smooth iteration value s=iters+1 log(log(R)/log(@bailout))/log(@pow). The picture below was made using that formula (in UF)



Logged




reesej2
Guest


« Reply #1 on: March 23, 2010, 12:56:10 AM » 

Very nice. This is for scale = 2, yes? Does it work equally well for other scales?



Logged




JosLeys


« Reply #2 on: March 23, 2010, 01:14:43 AM » 

Yes it was scale 2. Here is scale 2.5. (Scales lower than 2 appear to be more difficult.)



Logged




David Makin


« Reply #3 on: March 28, 2010, 04:17:17 AM » 

Hi all, Jos sent me a copy of his method (as posted here) and I immediately asked him if it would work on Mandelbulbs etc. as well and I decided to play around to see if I could get something similar that would do so  though I've still yet to try Jos's method on the Mandelbox properly.
The difference between implimenting these methods and the DE methods (analytical and delta) is that only a single normal iteration loop is required i.e. we don't have to iterate twice nor do we need to calculate the derivative. The difference in the results is that these methods produce a solid where the solid isosurface is the isosurface of a given potential rather than a given distance from "inside" which means that these methods tend to have a greater variance in detail levels in the resulting renders  specifically the "busier" areas are more detailed and the less busy areas less detailed than is the case using the DE methods. This is good because it gives us an alternative view that matches what you get if you just do "solid on given iteration".
Anyway I played around and found an adapted version of Jos' method that works for Mandelbulbs, quaternions etc., here it is:
Iterate the formula normally Calculate the smooth iteration value If Mandelbrot subtract 2 from the smooth iteration value, if Julia subtract 1 from it. calculate distance value = 1.0/(adjust + divergence^smooth iteration) test the distance value against your minimum threshold value (could be calculated directly for solid on a given iteration value) if not hit solid then step forwrd by distance value*0.1/accuracy
Where: adjust is a user parameter (usual values 0 or 1, larger values for fractals of very high divergence), divergence is either a user parameter giving the estimated divergence of the fractal (e.g. 8 for z^8+c) or a calculated value based on the last two values of z from iteration and accuracy is a user parameter (normally 1, larger values for increased accuracy, smaller for faster less accurate renders).
Note that the 0.1 in "distance value*0.1/accuracy" is required because the behaviour of the raw smooth iteration contours is such that the calculation above for the distance value is often overestimated by up to 10 times (sometimes more but that's allowed for by allowing the accuracy parameter).
Unfortunately the method as I've outlined above doesn't work on the Mandelbox or my escapetime IFS formula, nor have I been able to get Jos' method to work for the Mandelbox  I can't seem to work out the correct parameters in a/(b+c*exp(smd)) !
As to timings, for the degree 8 Mandelbulb (and other similar style fractals) the method renders in times comparable to using the analytical distance estimator but is slower on simpler formulas such as quaternions, bicomplex and the various formulas based on the unit vector multiplication tables. This is because the iteration part is faster because it's only done once or doesn't have the extra derivative calculation but the stepping is slower because the step sizes are not as accurate as the other methods. Ignoring the visual differences in the results it's best to use the DE methods for simpler fractal formulas and this method for the more complex ones.
I hope to find a way to satisfactarily apply the method to the Mandelbox and escapetime IFS formulas tomorrow.....



Logged




Buddhi
Fractal Molossus
Posts: 741


« Reply #4 on: March 28, 2010, 06:12:20 PM » 

Hi
I found some interesting method for calculating Mandelbox distance estimate. It is very simple method based on calculation resultant multiplication of input values. Below is my algorithm (there are marked additional lines in code):
inside iteration loop:
DEfactor = scale;
fixedRadius = 1.0; fR2 = fixedRadius * fixedRadius; minRadius = 0.5; mR2 = minRadius * minRadius;
if (x > 1.0) x = 2.0  x; else if (x < 1.0) x = 2.0  x; if (y > 1.0) y = 2.0  y; else if (y < 1.0) y = 2.0  y; if (z > 1.0) z = 2.0  z; else if (z < 1.0) z = 2.0  z;
r2 = x*x + y*y + z*z;
if (r2 < mR2) { x = x * fR2 / mR2; y = y * fR2 / mR2; z = z * fR2 / mR2; DEfactor = DEfactor * fR2 / mR2; } else if (r2 < fR2) { x = x * fR2 / r2; y = y * fR2 / r2; z = z * fR2 / r2; DEfactor *= fR2 / r2; }
x = x * scale + cx; y = y * scale + cy; z = z * scale + cz; DEfactor *= scale;
resultant estimated distance (after iteration loop):
distance = sqrt(x*x+y*y+z*z)/abs(DEfactor);
Results are very good. Distance is very accurate for all scale values and it doesn't need to much additional calculations.



Logged




fractalrebel


« Reply #5 on: March 29, 2010, 12:57:20 AM » 

Here is scale = 3 in UF using my Delta DE method:



Logged




fractalrebel


« Reply #6 on: March 29, 2010, 01:23:27 AM » 

Here is scale = 1.5. Its a little weird looking.



Logged




Timeroot


« Reply #7 on: March 29, 2010, 02:41:57 AM » 

Here is scale = 1.5. Its a little weird looking.
Looks like something is wrong. No matter what the scale value, it should always keep it's cubic symmetry...



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.



Tglad
Fractal Bachius
Posts: 627


« Reply #8 on: March 29, 2010, 02:49:57 AM » 

It's just clipping the near plane. Something to watch out for.



Logged




Timeroot


« Reply #9 on: March 29, 2010, 06:47:57 AM » 

ooh, is it a spherical clip? It looked so... round, I guess, I wasn't expecting that. Now I feel dumb.



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.



fractalrebel


« Reply #10 on: March 29, 2010, 05:33:56 PM » 

Here is a Juliabox with a seed of (2,2,2) and scale = 2.5, using my Delta DE method.



Logged




JosLeys


« Reply #11 on: March 29, 2010, 08:52:22 PM » 

Buddhi, your distance formula works like a dream! Much better than the one I suggested.



Logged




cKleinhuis


« Reply #12 on: March 29, 2010, 11:46:56 PM » 

awesome, this really is going to speed things up



Logged


divide and conquer  iterate and rule  chaos is No random!



Jesse
Download Section
Fractal Schemer
Posts: 1013


« Reply #13 on: March 30, 2010, 10:08:41 PM » 

Thank you Buddhi, seems to be very fast Dont know if i made something different (the "DEfactor = scale" term is outside the loop, i guess), so far i have additional DEscaling factors of about (MandBox) scale*1.2 + 1 for positive scales and scale*0.65 for negative scales to adjust the estimates. But when MandBox scalings comes closer to 1 or 1, things are getting more difficult. But that hasnt changed, seems to be a global problem... Just wondering if this method can be extended for alternated hybrids with common powerX bulbs?



Logged




subblue


« Reply #14 on: April 01, 2010, 11:08:20 AM » 




Logged




