David Makin
|
|
« 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
|
|
|
|
Buddhi
|
|
« 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 . Hypercomplex formula: Trigonometric formula: Quaternionic formula:
|
|
|
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 . very nice renderings!
|
|
|
Logged
|
|
|
|
David Makin
|
|
« 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 . 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 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
|
|
|
|
David Makin
|
|
« 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
|
|
|
|
Buddhi
|
|
« 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
|
|
« 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
|
|
« 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
|
|
« 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
|
|
« 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?
|
|
|
Logged
|
|
|
|
Buddhi
|
|
« 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
|
|
« 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
|
|
|
Logged
|
|
|
|
David Makin
|
|
« 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
|
|
|
Logged
|
|
|
|
JosLeys
|
|
« 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
|
|
« Reply #29 on: January 09, 2010, 04:45:59 PM » |
|
If course . 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
|
|
|
|
|