Logo by bib - 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: Did you know ? you can use LaTex inside Postings on fractalforums.com!
 
*
Welcome, Guest. Please login or register. April 20, 2024, 04:15:53 AM


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] 3   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: A new? Simple way to compute DE for any trig. Mandelbulb  (Read 14961 times)
0 Members and 1 Guest are viewing this topic.
David Makin
Global Moderator
Fractal Senior
******
Posts: 2286



Makin' Magic Fractals
WWW
« Reply #15 on: January 05, 2010, 05:37:59 PM »

I see.
What about setting a scale factor for DE that underestimates the distance more?
Or will it still overestimate the last step if you scale ?

Using a high "accuracy" setting i.e. actually stepping distances much smaller than the actual distance estimate effectively performs the same function as the binary search, but to be as accurate at finding the exact threshold surface as a binary search the step distances would have to be so much smaller than the distance estimates as to make rendering incredibly slow.
For instance let's say it takes 20 steps to hit the surface using say distance estimate/2 step distances, if you then perform 4 binary steps to find the exact surface (24 steps in total) then your maximum distance from the threshold is distance estimate/2*(1/2)^4 i.e. distance estimate/32, so to get the same accuracy by reducing the step sizes you'd have to use step sizes of distance estimate/32 instead of distance estimate/2 so instead of 20 steps to hit the surface it could easily take over 200.

Logged

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

http://www.fractalgallery.co.uk/
"Makin' Magic Music" on Jango
Buddhi
Fractal Iambus
***
Posts: 895



WWW
« Reply #16 on: January 06, 2010, 09:10:26 PM »

I made investigation why Delta DE causes artifacts on images. I found that artefacts was in areas where last value of theta (theta = atan2(y,x)) is changing value very fast. It caused very high values of dr (dr = |z2 - z1| / delta) because there was very big difference between z2 and z1 (nearly the same absolute value but almost opposite direction). I attached images with artefacts and theta value.

Regarding to this I changed a little algorithm for calculating Delta DE value:

delta = 1e-10
z1 = CalculateIterations(a,b,c)            //z1, z2 last values of z (after last iteration)
z2 = CalculateIterations(a+delta,b,c)   // I tried also (a+delta, b+delta, c+delta)
r = |(z1+z2)/2|
dr = (|z2| - |z1|) / delta
distance = r * log(r) / dr

Now dr is calculated as difference between absolute values. Results was better but estimator was very "directional". Without shading fractal looks well but when I tried to use shading algorithms, fractal has very unnatural surface (fractal was deformed along axis perpendicular to screen plane).

Finally I decided to calculate distance in three directions and calculate resultant distance dr = sqrt(dr.x^2 + dr.y^2 + dr.z^2). It needs to calculate iterations for 4 points but result is very accurate. Images are without any artifacts when programs don't have any additional procedures for avoiding errors. There are some examples bellow. For all images I used exactly the same Delta DE algorithm. IMHO I can say that this is very universal algorithm  cheesy.

Hypercomplex formula:


Trigonometric formula:


Quaternionic formula:






* delta DE artefacts.png (144.45 KB, 810x810 - viewed 1438 times.)

* Delta DE alfa.jpg (196.45 KB, 810x810 - viewed 1450 times.)
Logged

gaston3d
Guest
« Reply #17 on: January 06, 2010, 10:26:19 PM »

...
There are some examples bellow. For all images I used exactly the same Delta DE algorithm. IMHO I can say that this is very universal algorithm  cheesy.

very nice renderings!
Logged
David Makin
Global Moderator
Fractal Senior
******
Posts: 2286



Makin' Magic Fractals
WWW
« Reply #18 on: January 07, 2010, 12:28:11 AM »

Regarding to this I changed a little algorithm for calculating Delta DE value:

delta = 1e-10
z1 = CalculateIterations(a,b,c)            //z1, z2 last values of z (after last iteration)
z2 = CalculateIterations(a+delta,b,c)   // I tried also (a+delta, b+delta, c+delta)
r = |(z1+z2)/2|
dr = (|z2| - |z1|) / delta
distance = r * log(r) / dr

Now dr is calculated as difference between absolute values. Results was better but estimator was very "directional". Without shading fractal looks well but when I tried to use shading algorithms, fractal has very unnatural surface (fractal was deformed along axis perpendicular to screen plane).

Finally I decided to calculate distance in three directions and calculate resultant distance dr = sqrt(dr.x^2 + dr.y^2 + dr.z^2). It needs to calculate iterations for 4 points but result is very accurate. Images are without any artifacts when programs don't have any additional procedures for avoiding errors. There are some examples bellow. For all images I used exactly the same Delta DE algorithm. IMHO I can say that this is very universal algorithm  cheesy.


Excellent ! I think that's going to be faster than my smooth iteration delta DE - though it would still need testing on something more transcendental like quaternionic sin(z)+c for example or something including conditionals such as 3D+ versions of the Barnsley formulas smiley
Have you tried it out on complex Julibrots ?
Also please check it out on disconnected Julias, or at least Julia Sets where back areas are visible through holes in front areas - you may find an issue with over-stepping (which using the min distance on each iteration array method will fix - you should note that the array method even fixes such problems that occur when using analytical DE and the overhead is considerably less than you might think - at least on a CPU, and is considerably more optimum than reducing all step distances to a point where such errors go away).

« Last Edit: January 07, 2010, 01:33:50 AM by David Makin » Logged

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

http://www.fractalgallery.co.uk/
"Makin' Magic Music" on Jango
David Makin
Global Moderator
Fractal Senior
******
Posts: 2286



Makin' Magic Fractals
WWW
« Reply #19 on: January 09, 2010, 12:38:41 AM »

@Buddhi: Did you have any overstepping problems with the Julias you recently posted to the gallery ? (i.e. did you need to reduce the step distances more than normal)
I'm going to try your method over the weekend anyway - also watch out for a post from me (in "Mandelbulb Implimentation") describing a good position/framing of the degree 8 "-sine" Mandelbulb for really testing out rendering algorithms.
Logged

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

http://www.fractalgallery.co.uk/
"Makin' Magic Music" on Jango
Buddhi
Fractal Iambus
***
Posts: 895



WWW
« Reply #20 on: January 09, 2010, 11:13:53 AM »

@David Makin: Unfortunately I had overstepping problems and I reduced step distances. The highest overstepping is on those places where fractal is very flattened. I'm interpreting this as the space around those places is also flattened and dimensions are deformed.
Plus of this method is that I didn't observed any artifacts on images and I don't have to use trigonometric versions of formulas, which are very slow.
I'm thinking now about some self regulating factor for reducing distance. If I have some results I will share.
Logged

Buddhi
Fractal Iambus
***
Posts: 895



WWW
« Reply #21 on: January 09, 2010, 11:17:30 AM »

Example of using Delta DE method for Julia z^2+c fractals. Factor for reducing step distance was 0.2. It was not so fast to render but any flat details was misses.

Logged

JosLeys
Strange Attractor
***
Posts: 258


WWW
« Reply #22 on: January 09, 2010, 12:21:44 PM »

Buddhi, I'm trying to reproduce your image in UF.
Can you tell me what Julia seed you used exactly?
Logged
Buddhi
Fractal Iambus
***
Posts: 895



WWW
« Reply #23 on: January 09, 2010, 12:24:51 PM »

Buddhi, I'm trying to reproduce your image in UF.
Can you tell me what Julia seed you used exactly?
c = {0.51766599571757, -0.27872405784328, 0}
Logged

JosLeys
Strange Attractor
***
Posts: 258


WWW
« Reply #24 on: January 09, 2010, 01:54:51 PM »

Thanks!

here is the same Julia using Analytical DE in UF. I must say yours looks a lot better!
How about timing? This 640*640 image took 35 seconds to render onscreen (so no anti-aliasing)

I plan to test your method for DE also.
Just to be clear : you iterate a point Px,Py,Pz which gives you an R after bailout. (R=sqrt(Px^2+Py^2+Pz^2) )
You then iterate also <Px+delta,Py,Pz>, <Px,Py+delta,Pz>, <Px,Py,Pz+delta>, which gives you Rx,Ry, Rz as values after bailout..
is then drx=|R-Rx|/delta, dry=|R-Ry|/delta, drz=|R-Rz|/delta, to give you dR=sqrt(drx*drx+dry*dry+drz*drz) 
and DE=R*log(R)/dR..?
At first sight this would not give a good DE..

Or do I have it totally wrong?



* 4D_test_144.jpg (411.83 KB, 634x634 - viewed 1466 times.)
Logged
Buddhi
Fractal Iambus
***
Posts: 895



WWW
« Reply #25 on: January 09, 2010, 03:06:59 PM »

How about timing? This 640*640 image took 35 seconds to render onscreen (so no anti-aliasing)
Using my program it takes 20 seconds to render 640x640 image (step distance was 0.3*DE).

I plan to test your method for DE also.
Just to be clear : you iterate a point Px,Py,Pz which gives you an R after bailout. (R=sqrt(Px^2+Py^2+Pz^2) )
You then iterate also <Px+delta,Py,Pz>, <Px,Py+delta,Pz>, <Px,Py,Pz+delta>, which gives you Rx,Ry, Rz as values after bailout..
is then drx=|R-Rx|/delta, dry=|R-Ry|/delta, drz=|R-Rz|/delta, to give you dR=sqrt(drx*drx+dry*dry+drz*drz)
and DE=R*log(R)/dR..?
At first sight this would not give a good DE..

As I write before I changed way to calculate differences, because numeric errors was to high on areas where angle of triplex number was changing very fast. It should be:

(EDITED! There was mistake in formulas)
drx=|R-Rx|/delta
dry=|R-Ry|/delta
drz=|R-Rz|/delta

Rest of formulas looks properly.

My image looks very good because I used very small factor for step distance (step = 0.1*DE) and It was rendered in 2560x2560 resolution with ambient occlusion based on many rays. Render time was 1 hour.
« Last Edit: January 10, 2010, 12:41:21 PM by Buddhi » Logged

David Makin
Global Moderator
Fractal Senior
******
Posts: 2286



Makin' Magic Fractals
WWW
« Reply #26 on: January 09, 2010, 03:27:09 PM »

How about timing? This 640*640 image took 35 seconds to render onscreen (so no anti-aliasing)
Using my program it takes 20 seconds to render 640x640 image (step distance was 0.3*DE).

Hi guys, just to point out that if you're comparing timings you really need to state the computing power used wink
Logged

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

http://www.fractalgallery.co.uk/
"Makin' Magic Music" on Jango
David Makin
Global Moderator
Fractal Senior
******
Posts: 2286



Makin' Magic Fractals
WWW
« Reply #27 on: January 09, 2010, 03:29:04 PM »

@David Makin: Unfortunately I had overstepping problems and I reduced step distances. The highest overstepping is on those places where fractal is very flattened. I'm interpreting this as the space around those places is also flattened and dimensions are deformed.
Plus of this method is that I didn't observed any artifacts on images and I don't have to use trigonometric versions of formulas, which are very slow.
I'm thinking now about some self regulating factor for reducing distance. If I have some results I will share.

OK, and thanks smiley
Logged

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

http://www.fractalgallery.co.uk/
"Makin' Magic Music" on Jango
JosLeys
Strange Attractor
***
Posts: 258


WWW
« Reply #28 on: January 09, 2010, 04:39:16 PM »

I'm not sure I understand, Buddhi, R being a distance from the origin, is this not always positive?
Logged
Buddhi
Fractal Iambus
***
Posts: 895



WWW
« Reply #29 on: January 09, 2010, 04:45:59 PM »

If course  shocked. My mistake. I don't know why I thought that R is the last value of triplex number after iterations. It should be:
drx=|R-Rx|/delta
dry=|R-Ry|/delta
drz=|R-Rz|/delta
It is exactly the same as you wrote. It means that your formulas are completely the same as mine.
Logged

Pages: 1 [2] 3   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Simple 2D IFS animation Movies Showcase (Rate My Movie) David Makin 0 1976 Last post December 09, 2006, 11:41:48 PM
by David Makin
Plain and Simple Mandelbulb3D Gallery lenord 0 1170 Last post February 27, 2011, 07:14:47 PM
by lenord
Non-trig expansion for RuckerBrot? Help & Support DarkBeam 1 949 Last post March 16, 2011, 01:41:42 PM
by DarkBeam
Does anyone know a trick to compute the derivative of Mandelbrot ? General Discussion tit_toinou 9 5158 Last post April 02, 2012, 03:53:12 AM
by David Makin
VTune Results; Compute vs. CVector3::IsNotANumber. Mandelbulber mancoast 0 3854 Last post August 03, 2016, 03:42:16 AM
by mancoast

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.201 seconds with 26 queries. (Pretty URLs adds 0.016s, 2q)