Title: Better DE estimate using orbit traps Post by: knighty on January 23, 2010, 10:29:14 PM Hi!
First of all sorry for my terrible english :-X Ok! I'm not a mathematician. I found this using my very basic knowledge, trial and error and feeling ;). It addresses overstepping of the distance estimator for the mandelbulb and Juliabulb. There are two types of overstepping: - For mandelbulb and juliabulb near the "stars"... I mean this: (http://i395.photobucket.com/albums/pp36/jnosof/Mandelbulb/Mandelbulb%20distance%20estimation/MB_No_rCorrection.jpg) The dust at the center of the above picture is due to overstepping. One can notice that these areas have the property that at some point of the Zn+1=Zn^p+C iteration, Zn comes close to the Z axis. Here is a picture that shows the areas where Zn comes close to x (red), z (green) and y (blue). note that unlike the above image, in this one "y" axis is up (and its order is 5). (http://i395.photobucket.com/albums/pp36/jnosof/Mandelbulb/EVAL0047.png) The Idea is simple: just get the orbit trap of the z axis and use a function of that value to scale the estimated distance. Because we need that scaling Near the surface, It's important to scale the scale factor itself by a function of the estimated distance. - For the juliabulb: (The overstepping is more embarrassing ;)) (http://i395.photobucket.com/albums/pp36/jnosof/Mandelbulb/Mandelbulb%20distance%20estimation/MB_DF_test_d0r0.jpg) The areas where the estimated distance diverges are those where the orbit trap of (0,0,0) is very small. It happens that the radius of those regions is related to the distance of (cx,cy,cz) to the mandelbulb. ((cx,cy,cz) are the julia parameters.) Here is how I do (hope you will understand this crap) : Code: // mi is the iterations number Unlike the "julia" correction scale, the "star" correction scale have a formula that seems to be ad-hoc. Well... it is ;). It's "very" empirical and there is room for improvement. The formula for the "julia" correction scale is cleaner. That doesn't mean that I really know the mathematical reasons behind it ;) The results: (http://i395.photobucket.com/albums/pp36/jnosof/Mandelbulb/Mandelbulb%20distance%20estimation/MB_DF_test_d1r1.jpg) (http://i395.photobucket.com/albums/pp36/jnosof/Mandelbulb/Mandelbulb%20distance%20estimation/MB_rCorrection.jpg) There is practically very small overhead when using these "correction scales". Here are some evaldraw (http://advsys.net/ken/download.htm (http://advsys.net/ken/download.htm)) scripts to try: http://implicit.googlecode.com/files/tests.zip (http://implicit.googlecode.com/files/tests.zip) Title: Re: Better DE estimate using orbit traps Post by: David Makin on January 23, 2010, 11:44:49 PM Awesome !
This (and something I mentioned to Jos Leys privately) gives me an idea.....will post it in this thread shortly :) Title: Re: Better DE estimate using orbit traps Post by: David Makin on January 24, 2010, 12:05:40 AM OK, here are two images, both solid based on DE alone.
Scaled smooth iteration colouring: (http://www.fractalforums.com/gallery/1/141_23_01_10_11_54_50.jpeg) Orbit trap (to origin) colouring: (http://www.fractalforums.com/gallery/1/141_23_01_10_11_58_27.jpeg) Spot the difference !! So the suggestion of using orbit trap values to fix the DE overstepping along with the above amazing similarity between the two colouring methods prompted me to think that maybe we can get a distance estimate more simply by using the smooth iteration value and the orbit trap (to origin) value using something like: Distance = a*f(smooth iteration) - g(orbit trap) Obviously this requires more work but if suitable f() and g() can be found then it should be even faster than the normal analytical method since the only code in the iteration loop beyond the main iteration would be the orbit trap test. Title: Re: Better DE estimate using orbit traps Post by: JosLeys on January 24, 2010, 01:12:25 AM Code: rxy-=1;rxy*=exp(-20*d^2);rxy+=1;// scale the "star" correction term by a function of d. Could you please give the explicit expression for rxy? I'm confused about what you do here. I'm trying to implement this, and it looks like it works very well! Title: Re: Better DE estimate using orbit traps Post by: knighty on January 24, 2010, 01:21:26 PM I forgot to say that even if I'm happy with the results, I'm not satisfyed by the formulas. I hope that someone with better math background will find the good formulas with their justification.
Code: rxy-=1;rxy*=exp(-20*d^2);rxy+=1;// scale the "star" correction term by a function of d. Could you please give the explicit expression for rxy? I'm confused about what you do here. I'm trying to implement this, and it looks like it works very well! "rxy" is named "kz" in juliabulb(). its value is: 1-(1/(16*rz+1))*(1-1/((2*rt)^expo+1)); I could have done it more simple: in juliabulb(): kz(aka rxy)=1/(16*rz+1)*(1-1/((2*rt)^expo+1)); in nextd0():rxy=1-rxy*exp(-20*d^2); OK, here are two images, both solid based on DE alone. Scaled smooth iteration: (http://www.fractalforums.com/gallery/1/141_23_01_10_11_54_50.jpeg) Orbit trap (to origin): (http://www.fractalforums.com/gallery/1/141_23_01_10_11_58_27.jpeg) Spot the difference !! So the suggestion of using orbit trap values to fix the DE overstepping along with the above amazing similarity between the two colouring methods prompted me to think that maybe we can get a distance estimate more simply by using the smooth iteration value and the orbit trap (to origin) value using something like: Distance = a*f(smooth iteration) - g(orbit trap) Obviously this requires more work but if suitable f() and g() can be found then it should be even faster than the normal analytical method since the only code in the iteration loop beyond the main iteration would be the orbit trap test. Interresting! :) What happens around the surface? maybe a 2D slice will show the relation between the two values. Title: Re: Better DE estimate using orbit traps Post by: David Makin on January 24, 2010, 02:49:57 PM One thing I discovered that I should also mention.
When changing the DE "solid threshold" the smooth iteration colouring normally "drifts" because obviously at smaller distances we get higher iteration counts - this is particularly a problem when using a dynamic distance threshold based on distance from viewpoint and image plane distance. When investigating this I discovered that merely offsetting UF's palette as the solid threshold changed was fixing the problem and surmised that maybe simply adding a multiple of the distance threshold to the smooth iteration value would fix the problem. It turns out I was correct and not only that but the scale required appears to be a universal constant of approx. 0.521 i.e. it works for the various different Mandelbulb powers and for all the different variations of the Mandelbulb formula that I have implimented (about 15). Basically this means that you calculate your smooth iteration value for the solid point and then adjust as follows: smiter = smiter + 0.521*threshold To see this in action I just uploaded an animation to YouTube: http://www.youtube.com/watch?v=B31c3IUXEq0 (http://www.youtube.com/watch?v=B31c3IUXEq0) Edit: I should add that (surprisingly) the apparently universal nature of the constant 0.521 making the results consistent under changes to the solid threshold seems to hold for different bailout values (e.g. from testing the square of the magnitude against values ranging from 4 to 1e20) though changes in bailout do require a further offset to the smooth iteration value to make the results consistent with different bailouts. Title: Re: Better DE estimate using orbit traps Post by: kram1032 on January 24, 2010, 04:28:49 PM Interesting :)
Maybe, the exact value is represented by one of these? http://www.wolframalpha.com/input/?i=0.521 Title: Re: Better DE estimate using orbit traps Post by: David Makin on January 24, 2010, 05:51:34 PM Interesting :) Maybe, the exact value is represented by one of these? http://www.wolframalpha.com/input/?i=0.521 <Quoted Image Removed> is just above that... sqr(tan(5/8)) looks favourite :) Title: Re: Better DE estimate using orbit traps Post by: kram1032 on January 24, 2010, 09:37:28 PM if you could find the analythical value, it will quite likely be related to tangens, I guess :)
Note, that if you click "more", you'll get more possible values, one being even more exact, as in, accurate to also the 1, however, they also start to get more complex and I guess, it's rather unlikely that they are correct... ^^ Title: Re: Better DE estimate using orbit traps Post by: knighty on January 25, 2010, 10:04:58 PM I've made some small improvements to the correction terms formulas.
1- For the juliabulb:
2- For the mandelbulb: We need only the star-overshoot correction term, because there is no "inside". Thus, we also don't need the second term discussed above. Thus: cs =1- (1/(16*rz+1))*exp(-20*(ED-SOLID_THRESHOLD)^2). Note that the coefficients that are underlined may be changed. I hope you'll find it useful. Title: Re: Better DE estimate using orbit traps Post by: David Makin on January 26, 2010, 02:04:30 AM 2- For the mandelbulb: We need only the star-overshoot correction term, because there is no "inside". Thus, we also don't need the second term discussed above. Did you check for the Julia-style problem on perturbated Mandelbrots ? Title: Re: Better DE estimate using orbit traps Post by: knighty on January 26, 2010, 05:37:28 PM Oh! I've forgotten to say that in the case of the mandelbulb It's better to skip the z axis trap in the first iteration.
Anyway the "star" correction term is not "perfect". It doesn't work well with power 2. I'll try to find better one. 2- For the mandelbulb: We need only the star-overshoot correction term, because there is no "inside". Thus, we also don't need the second term discussed above. Did you check for the Julia-style problem on perturbated Mandelbrots ? http://www.fractalforums.com/mandelbulb-implementation/mandelbulb-ray-tracing-plugin-for-photoshop-aftereffects-and-quartzcomposer/msg10121/#msg10121 (http://www.fractalforums.com/mandelbulb-implementation/mandelbulb-ray-tracing-plugin-for-photoshop-aftereffects-and-quartzcomposer/msg10121/#msg10121) Well! in principle, one have to recompute d2M (distance to mandelbrot) for each point, but this is not sufficient. It works well in general, when calculating d2M only for the julia seed, but there are some areas where the estimated distance is too large. I think this problem occures even if one doesn't use the "correction terms" because of the difference between the ways "dr" is calculated in mandelbrot and in julia (the +1). The result seem to be perfect when recomputing d2M for each point AND adding this term: cd*MJI to dri. where:
Well! this is quite slow. :) In the case where one compute d2M once for the julia seed and add cd*MJI to dri, the results seem to be good. For now, I only have done the tests on 2D slices. I'll see what they give in 3D and post the results. Title: Re: Better DE estimate using orbit traps Post by: David Makin on January 26, 2010, 06:21:53 PM By "perturbated Mandelbrots", do you mean the morphing between julia and mandelbrot bulbs described here? I just meant Mandelbrots where the start value is not zero, which can have the same stepping problem that you get in Julia Sets. Edit: More generally I should say I mean Mandelbrots where the starting value is not a critical value :) Title: Re: Better DE estimate using orbit traps Post by: knighty on January 26, 2010, 10:11:05 PM sorry! I'm not familiar with fractals' terminology.
It seems that the origin trap is useless in this case. There is a a kind of shift (perhaps because the 0 period attractor is not 0?). Moreover I have no idea about the size of the regions where overshooting occures. I'll try to investigate further but it seem more difficult :(. Any idea? ::) About my previous post. It's quite strange that "cd*MJI" works better than just adding "MJI" to "dri" because the former looks more logical. Mistery! :hmh: What about the 0.521? I'm curious about its origin and closed form expression (if it exists). Title: Re: Better DE estimate using orbit traps Post by: David Makin on January 27, 2010, 12:08:11 AM What about the 0.521? I'm curious about its origin and closed form expression (if it exists). The 0.521 is purely experimental/observational in origin - if you render a 3D+ fractal using solid based solely on distance estimate threshold and then colour it using (accurate) smooth iteration colouring for the surface points (at threshold distance) then it appears that adjusting the smooth iteration value by (approx) 0.521*threshold keeps the colouring consistent as threshold changes. More accurately it keeps the "iteration densest" regions consistent, the less dense iteration regions (which appear as threshold is reduced) have higher iteration counts and hence higher colouring values - see the "Snow" animation - the dark areas only appear as solid threshold is reduced. I find it astonishing that the 0.521 value appears consistent not only for the z^p+c Mandelbulbs/Juliabulbs (all "bulb-type" maths and seemingly for all values of p>=2) but also works on hypercomplex fractals (bicomplex, quaternion etc). Actually that prompts a question - is it also consistent on 2D fractals ? Hmmmmmm...... Anyone fancy finding the analytical route to the 0.521 ? Title: Re: Better DE estimate using orbit traps Post by: Timeroot on January 27, 2010, 01:49:26 AM I don't know very much at all about DE (especially its computation) but I thought that I would add to the discussion of this 0.521 constant that this DE is not accurate - it can be off by a factor as much as 4 or 1/4 at times. This will make it significantly harder to find an analytical value for 0.521, I predict. If someone uses Distance Calculation (completely ridiculous for high-speed renders), which involves truly checking each point in the vicinity until one is found sufficiently close to the set, and that also seems affected by 0.521.... that would probably give could clues to determining it.
Title: Re: Better DE estimate using orbit traps Post by: David Makin on January 27, 2010, 03:43:48 AM I don't know very much at all about DE (especially its computation) but I thought that I would add to the discussion of this 0.521 constant that this DE is not accurate - it can be off by a factor as much as 4 or 1/4 at times. This will make it significantly harder to find an analytical value for 0.521, I predict. If someone uses Distance Calculation (completely ridiculous for high-speed renders), which involves truly checking each point in the vicinity until one is found sufficiently close to the set, and that also seems affected by 0.521.... that would probably give could clues to determining it. Well yes, analytical DE is an estimate after all, but until a better way of rendering 3D+ objects is found I'll stick with it - using "solid on iteration" is nowhere near as nice since you'll always end up either with areas without any detail and/or areas with significant aliasing (unless you use a volumetric or pseudo-volumetric method which would be much slower anyway, though it produces nice results). I was just hoping/wondering if a method based on the apparent universality of the "0.521" (and the fact that the min distance to origin trap value can match the variation in the smooth iteration colouring) could be arrived at that produces results comparable with the current analytical DE but faster :) Also I think you'll find that generally DE is actually pretty accurate, the problem with the "stars" on the Mandelbulbs is something new - I can't think of any similar problems on hypercomplex fractals (in the widest sense) - the problem with Julia Sets is admittedly pretty universal. Utilising the 0.521 result directly and applying it as a "delta" method yields: DE = 0.521*delta/abs(smoothiter1-smoothiter0) Under experimentation this actually needs adjusting to match the analytical method and I found that using 0.2 instead of 0.521 works fine. This is essentially one of the delta methods I tried previously - arrived at based on applying Newton's method, at the time I settled on this instead: DE = 0.4/(distadjust + abs(smoothiter1-smoothiter0)/delta) Where the default value of distadjust is 1.0. The problem with the delta methods is that they are directional so one has to program around the problem of points where the rays are parallel or near parallel to the fractal surface. Also the "stars" on the Mandelbulbs present a different problem for the delta methods :) Title: Re: Better DE estimate using orbit traps Post by: Timeroot on January 27, 2010, 06:17:07 AM I wasn't suggesting that we render with distance calculation, only that someone tries it to see if the 0.521 constant still applies.
Title: Re: Better DE estimate using orbit traps Post by: knighty on January 30, 2010, 05:19:14 PM As promised, here is a rendering of the mix between Mandelbulb and juliabulb. I did compute d2M only once for this picture.
(http://www.fractalforums.com/gallery/1/932_30_01_10_4_56_51_2.jpeg) Here is a picture showing the iterations number used (the blue component IS the iterations number used at each pixel) (http://www.fractalforums.com/gallery/1/932_30_01_10_4_56_51_3.jpeg) Here are the mandelbulb and juliabulb with their used iterations number. (http://www.fractalforums.com/gallery/1/932_30_01_10_4_47_12_0.jpeg) (http://www.fractalforums.com/gallery/1/932_30_01_10_4_56_50_0.jpeg) (http://www.fractalforums.com/gallery/1/932_30_01_10_4_56_51_1.jpeg) (http://www.fractalforums.com/gallery/1/932_30_01_10_4_56_51_4.jpeg) Do you notice the "plumes" :) Have anyone tried this method? :D Title: Re: Better DE estimate using orbit traps Post by: KRAFTWERK on February 04, 2010, 09:47:51 AM It is so quiet in here...
This threads subject is something I have been wondering about, here is a closeup of a minibulb flowr, or star or whatever ;) So the "noise" in the flower is really a fault in the DE... Bigger image here: http://MANDELWERK.deviantart.com/art/Flower-of-the-Power-Eight-152854734 (I use subblues pixelbender-script) Title: Re: Better DE estimate using orbit traps Post by: kram1032 on February 04, 2010, 11:42:11 AM That's pretty nice :)
Looks like cartoon wind/clouds Title: Re: Better DE estimate using orbit traps Post by: knighty on February 09, 2010, 09:40:45 PM So the "noise" in the flower is really a fault in the DE... Yes it is! Nice rendering BTW :) Title: Re: Better DE estimate using orbit traps Post by: hobold on February 10, 2010, 09:15:53 AM And the fault in the DE is caused by the spherical coordinates having poles. All of the problematic areas where the DE oversteps are close to points where fractal structures radiate from a single central point such that they keep shrinking the closer they approach that center.
If one could reliably detect the presence of such a "black hole" that is sucking in the fractal, one could selectively reduce the distance estimates in only those areas. Title: Re: Better DE estimate using orbit traps Post by: KRAFTWERK on February 10, 2010, 09:17:08 AM So the "noise" in the flower is really a fault in the DE... Yes it is! Nice rendering BTW :) Thanks! O0 Title: Re: Better DE estimate using orbit traps Post by: Timeroot on February 10, 2010, 07:19:46 PM And the fault in the DE is caused by the spherical coordinates having poles. All of the problematic areas where the DE oversteps are close to points where fractal structures radiate from a single central point such that they keep shrinking the closer they approach that center. Unfortunately, it's self similar, so I think (not 100% sure) that essentially the entire fractal acts that way. To get a relevant DE, it would need to behave differently based not only on the local "poleness", but also whether the "poleness" was how it actually behaves on that scale.If one could reliably detect the presence of such a "black hole" that is sucking in the fractal, one could selectively reduce the distance estimates in only those areas. Title: Re: Better DE estimate using orbit traps Post by: hobold on February 10, 2010, 08:22:39 PM Unfortunately, it's self similar, so I think (not 100% sure) that essentially the entire fractal acts that way. To get a relevant DE, it would need to behave differently based not only on the local "poleness", but also whether the "poleness" was how it actually behaves on that scale. Yes and no. Obviously, the fractal iteration spreads such local poles potentially over the whole structure. But the math only really breaks down for points that are very close to the pole (it really only blows up right in the pole, but the numerics close to that will be red hot even some distance away).I have wondered if an orbit trap around the poles would suffice to detect such points. But then, I don't have a grasp of what orbit traps mean mathematically. I don't understand why they work as a faked ambient occlusion, either. To me that was just voodoo. :-) Title: Re: Better DE estimate using orbit traps Post by: knighty on February 10, 2010, 09:13:36 PM And the fault in the DE is caused by the spherical coordinates having poles. All of the problematic areas where the DE oversteps are close to points where fractal structures radiate from a single central point such that they keep shrinking the closer they approach that center. Exact. The DE "breaks down" when zN goes near the z (up) axis for some N. If one could reliably detect the presence of such a "black hole" that is sucking in the fractal, one could selectively reduce the distance estimates in only those areas. This is exactly what I have suggested. The regions where the DE should be adapted are detected using an orbit trap on the 'up' axis. I'm getting pretty good restuls with this trick but it is empirical. Thanks! you have explained in two sentences what I was trying to explain in 10 posts ;D. Unfortunately, it's self similar, so I think (not 100% sure) that essentially the entire fractal acts that way. To get a relevant DE, it would need to behave differently based not only on the local "poleness", but also whether the "poleness" was how it actually behaves on that scale. Yes and no. Obviously, the fractal iteration spreads such local poles potentially over the whole structure. But the math only really breaks down for points that are very close to the pole (it really only blows up right in the pole, but the numerics close to that will be red hot even some distance away).Also, new copies generated at each new iteration are smaller so the areas to refine are much smaller even if they are more numerous. I have wondered if an orbit trap around the poles would suffice to detect such points. But then, I don't have a grasp of what orbit traps mean mathematically. I don't understand why they work as a faked ambient occlusion, either. To me that was just voodoo. :-) Well, it works for me :D . Perhaps I should use the angle to the up axis instead. This sounds more logical... still ivestigating... and wish I have better math skills :'( Title: Re: Better DE estimate using orbit traps Post by: kram1032 on February 10, 2010, 10:23:46 PM as the poles are on the north and on the south, it should be pretty easy to find out when they are: always when the height-angle is close to +/- 90°
Title: Re: Better DE estimate using orbit traps Post by: hobold on February 10, 2010, 10:34:52 PM Thanks! you have explained in two sentences what I was trying to explain in 10 posts ;D. *blush* I was only trying to explain it to myself ... you're welcome!But if it is the case that I actually got this, then yes, angle to z axis would be a more appropriate orbit trap. Instead of the cylinder around z that you are currently using, you'd want to use a cone. This can be done without trigonometry, using the implicit cone equation x^2 + y^2 = k*z^2, where smaller k makes for pointier (longer, thinner) cones, that capture a smaller neighbourhood of the pole. So you could just store the minimum k = (x^2 + y^2)/z^2 over all iterations as a measure of closeness to a pole. Beware of divide by zero in the z=0 plane. The value of k is undefined then, but you know that you are at the equator, which is as far from the pole as you can get. So you can just skip these for purposes of finding a minimum k. Edit: you will probably want to use the square root of the minimum k value. That would be proportional to the angle in radians, at least near the pole. And then ... hmm ... maybe the value of that minimum k could directly be used to shrink the distance estimates, in good accordance with the shrinking feature size near the pole. Title: Re: Better DE estimate using orbit traps Post by: knighty on February 10, 2010, 11:20:32 PM Thanks, I'll try it. It's also posible to use
zo0 = asin( z/r ); which is already present in the formula. Your suggestion is useful in the case where I use polynomial (quick) form of the formula.(not fully implemented yet). You have reminded me an important issue. It's important to prevent divides by zero. I'm curently using evaldraw which doesn't generate floating point exceptions. My script have not yet failed but this doesn't mean that I'm doing it right. Title: Re: Better DE estimate using orbit traps Post by: hobold on February 11, 2010, 12:02:23 AM One more thing just occurred to me. The mandelbulb is notorious for the need to scale down the distance estimates derived from the standard 2D Mandelbrot construction. Maybe the instability near the pole is the underlying reason for this. This would mean that the aforementioned polar orbit trap, when done the "right" way (i.e. with more rigorous and more stringent mathematical analysis) could end up accelerating the mandelbulb renderers, because it would replace the global fudge factors that reduce DE everywhere across the board (rather than just in the places where it is really needed). So you would no longer do ten times the number of required steps everywhere, only to still overstep near the polar features.
Dang, I think I need to abandon my voxel based renderer, and play with ray marching instead. :-) Title: Re: Better DE estimate using orbit traps Post by: knighty on February 13, 2010, 01:50:25 AM Hi,
I absolutely agree. I hope that some day, someone with good math background will study this stuff and give us the right answers. Meanwhile, the tricks I'm giving here really do the job. :whistle2: I was curious about what would give the full DE would give. Because an full analytic formulation is not yet available I've tried the numerical approache to compute the gradient (as described in the famous mandelbulb thread). Of cours, I do the tests on the mandelbulb variant that have the most adverse case: positive Z-component method. The result without the correction trick: (http://i395.photobucket.com/albums/pp36/jnosof/Mandelbulb/Mandelbulb%20distance%20estimation/MB_P8_Numerical_DE_without_star_cor.jpg) With the correction trick: (http://i395.photobucket.com/albums/pp36/jnosof/Mandelbulb/Mandelbulb%20distance%20estimation/MB_P8_Numerical_DE_with_star_correc.jpg) The analytic DE I'm curently using (because it's simple and fast. See post:http://www.fractalforums.com/mandelbulb-implementation/realtime-renderingoptimisations/msg9072/#msg9072 (http://www.fractalforums.com/mandelbulb-implementation/realtime-renderingoptimisations/msg9072/#msg9072)) without the correction trick: (http://i395.photobucket.com/albums/pp36/jnosof/Mandelbulb/Mandelbulb%20distance%20estimation/MB_P8_Analytic_DE_without_star_corr.jpg) With the correction trick: (http://i395.photobucket.com/albums/pp36/jnosof/Mandelbulb/Mandelbulb%20distance%20estimation/MB_P8_Analytic_DE_with_star_correct.jpg) Humm... maybe the full analytic DE will do the job! if the artifacts are due to the numerical approximations. Title: Re: Better DE estimate using orbit traps Post by: hobold on February 13, 2010, 03:47:17 PM Did you use a cylindrical or a conical orbit trap for these test renders?
Title: Re: Better DE estimate using orbit traps Post by: knighty on February 13, 2010, 05:52:18 PM I used cylindrical traps. Have not yet modified it to conical.
Title: Re: Better DE estimate using orbit traps Post by: hobold on February 13, 2010, 06:34:32 PM I didn't mean to order you to get to work. :-) I just wanted these experiments to be documented well.
I still don't feel confident about my grasp of whats happening during the computation of the mandelbulb, in particular this whole idea of turning a smooth iteration function into a distance estimate. Nevertheless, I want to wager a guess as to what the "right" correction for pole artifacts would be. Picture a globe with the standard spherical coordinate grid of latitude and longitude. At the equator, the grid cells are nearly perfect squares. Towards the poles, the grid cells turn rectangular, getting taller and taller. Until eventually, at the pole, the final row of grid cells is triangular, with the pole as the common tip of all triangles. In the case of the 2d Mandelbrot, where the equations for distance estimation were originally derived, the situation is like an equator everywhere. No poles, no distortions anywhere. This is the assumption that the distance estimator is based on. I believe the "correct correction" for the Mandelbulb distance estimates would be to shrink them proportionally to the shorter edge of a spherical grid cell at the respective latitude, to compensate for the rectangular distortion. So you would use a conical orbit trap, keeping track of the closest position to a pole. Then compute the latitude of that closest position, and shrink the distance estimate by cos(latitude). With a bit of luck, this compensation of all orbits (not just those that move close to a pole) should remove the need for global downscaling of distance estimates. Title: Re: Better DE estimate using orbit traps Post by: knighty on February 13, 2010, 09:36:43 PM I didn't mean to order you to get to work. :-) I just wanted these experiments to be documented well. LOL ;DI said so just because I was about to try it. My Provisional conclusion is that it doesn't make a big difference because the mandelbulb (I'm talking about power 8 mandelbulb) surface is near the radius 1 sphere. I still don't feel confident about my grasp of whats happening during the computation of the mandelbulb, in particular this whole idea of turning a smooth iteration function into a distance estimate. The DE formula usually used gives an estimate. It looks to me like the newton root finding method.You can take a look at this:http://www.evl.uic.edu/hypercomplex/ (http://www.evl.uic.edu/hypercomplex/). It's about quaternion julia set BTW. There is a PDF book with the distance estimate formulas and their proofs. If I've understood well, there exist a "perfect" DE for Mandebrot and connected julia sets (with complex and quaternion) but wich is practically difficult to use. The DE formula usually used (G/G') is an approximation. The DEs for the mandelbulb (and its relatives :)) have, to my knowledge, never been proved. Nevertheless, I want to wager a guess as to what the "right" correction for pole artifacts would be. This makes sens but using cos(latitude) gives me too small estimates. I think that the contribution of each trap should be weighted with a function of the magnitude. Will see what it gives.Picture a globe with the standard spherical coordinate grid of latitude and longitude. At the equator, the grid cells are nearly perfect squares. Towards the poles, the grid cells turn rectangular, getting taller and taller. Until eventually, at the pole, the final row of grid cells is triangular, with the pole as the common tip of all triangles. In the case of the 2d Mandelbrot, where the equations for distance estimation were originally derived, the situation is like an equator everywhere. No poles, no distortions anywhere. This is the assumption that the distance estimator is based on. I believe the "correct correction" for the Mandelbulb distance estimates would be to shrink them proportionally to the shorter edge of a spherical grid cell at the respective latitude, to compensate for the rectangular distortion. So you would use a conical orbit trap, keeping track of the closest position to a pole. Then compute the latitude of that closest position, and shrink the distance estimate by cos(latitude). With a bit of luck, this compensation of all orbits (not just those that move close to a pole) should remove the need for global downscaling of distance estimates. Title: Re: Better DE estimate using orbit traps Post by: hobold on February 13, 2010, 11:26:47 PM Just to be clear: the cos(latitude) factor should be applied only once per orbit, not once per iteration. Only for the one iteration where the orbit came closest to a pole.
Title: Re: Better DE estimate using orbit traps Post by: knighty on February 14, 2010, 05:06:23 PM Taking the minimum zi angle or a combination of the zi angles doesn't make a big difference. The important thing here is that we want to do the correction near the rendered surface and to not scaling down the ED far from the actual surface. That's why I multiply the "star" correction term by a function of the estimated distance (yeah! it's like a snake bitting it's tail).
The trouble with using cos(latitude) is that for some zi with the smallest cos(latitude), |zi| may be very big. the region where the correction will occure will be unnecessarily large. I notice (now) that using cylindrical trap instead corrects somehow this situation. We have: cos(latitude(zi))=sqrt((xi2+yi2)/|zi|2) for the angular trap. The cylindrical trap is (xi2+yi2)=cos(latitude(zi))2*|zi|2. It also seems that using squared cos(latitude) gives better results. I'll try to post some pictures to illustrate what happens. I want to add a comment about orbit traps in this particular case. taking the minimum is not the only choice we have. Moreover, it doesn't give the smoothest results. Some other possible formulas are: 1-product(1-exp(- positive_constant * xi2)), and 1-product(1-1/(xi2/positive_constant+1)) xi is some property of zi. positive_constant acts on the zone of influence of each xi. These functions give smooth results. They are some sort of fuzzy minimum. Title: Re: Better DE estimate using orbit traps Post by: hobold on February 14, 2010, 09:27:33 PM Well, one thing I learned is that I really don't understand this orbit trap business. :) But it's true; distance estimates far from the surface don't really need the correction. Hm ... so maybe the traps should be flattened spheres (ellipsoids) on both poles ... ?
Title: Re: Better DE estimate using orbit traps Post by: knighty on February 15, 2010, 09:18:09 PM Don't worry! I understood the orbit traps last november :nerd:.
Here are two pictures to illustrate what I said in my previous post. The yellow and green areas are where the value (cos²(latitude) or x²+y²) is low: Cos²(latitude) -squared because it looks better and works better for me- (http://www.fractalforums.com/gallery/1/932_15_02_10_9_05_49_0.jpeg) A closeup: (http://www.fractalforums.com/gallery/1/932_15_02_10_9_05_49_2.jpeg) Cylinder trap: (http://www.fractalforums.com/gallery/1/932_15_02_10_9_05_49_1.jpeg) Closeup: (http://www.fractalforums.com/gallery/1/932_15_02_10_9_05_49_3.jpeg) Edit: These are vertical slices along the x axis Title: Re: Better DE estimate using orbit traps Post by: knighty on February 15, 2010, 09:26:41 PM Hm ... so maybe the traps should be flattened spheres (ellipsoids) on both poles ... ? Good idea. I'll try it ASAP!EDIT: wow! works well. Thanks :) (http://www.fractalforums.com/gallery/1/932_15_02_10_9_49_52_0.png) EDIT2: And you say you dont really understand that busness? :surprise: Title: Re: Better DE estimate using orbit traps Post by: hobold on February 16, 2010, 01:37:01 AM I guess I have relatively high standard for "to understand" ... let me elaborate. As I mentioned in another thread, I was allowed to enjoy the privilege of a thorough mathematical education. However, my brain does not seem to be a good match for the formal, disciplined, stringent, goal oriented methods in the mathematical toolkit. Don't get me wrong, I love math, there is much beauty in it, and it is a very powerful tool in the hands of a true master.
But I am more of a seeker, a wanderer. I never quite know where I will end up. In fact, I like it not to know where I will end up. That's one of the better ways to encounter surprises. :-) There is a phrase that is often used as an euphemism for "I don't know what I am talking about". That phrase is: "I have an intuitive approach to <insert topic>". I think that phrase describes me fairly accurately ... including the occasional case where it assumes its euphemistic meaning. :-) I sometimes have a knack for making good guesses, but then I tend to have a very hard time justifying those guesses with solid theoretical reasoning. But such reasoning is one of the best ways to explain an idea to somebody else. And the ability to explain is, in my book, the one relevant mark to understanding. Only one who really understood something will be able to truly explain it to somebody else. That's my standard. Glad I guessed right. :-) Title: Re: Better DE estimate using orbit traps Post by: knighty on February 16, 2010, 01:29:16 PM Only one who really understood something will be able to truly explain it to somebody else. That's my standard. "Ce qui se conçoit bien s'énonce clairement - Et les mots pour le dire arrivent aisément.""What is conceived well is clearly stated - and the words to say it come easily." Nicolas Boileau-Despréaux - L'Art poétique (1674) :) Glad I guessed right. :-) And thank you for your valuable feedback.Title: Re: Better DE estimate using orbit traps Post by: KRAFTWERK on February 16, 2010, 02:05:12 PM And both of you amaze me, great thread, love it!
Good "guessing" hobold! O0 Title: Re: Better DE estimate using orbit traps Post by: hobold on February 16, 2010, 02:29:32 PM And thank you for your valuable feedback. I expect to be rewarded with beautiful images and animations of the intricate Mandelbulb details which were overlooked so far. :angel1: |