Title: Distance Estimation for complex function Post by: M Benesi on June 15, 2015, 05:55:46 AM Is it even possible to do DE on an ABS function type?
Say you have a function, you rotate, take the absolute value of something -.5 (in this case), then rotate back. How would one go about doing DE with |absolute| value reflections, and the like, every freaking iteration! This is what I do before I apply a Mandelbulb formula, and I actually have another additional step in between the rotations occasionally, which makes it an even bigger.. bleh. Title: Re: Distance Estimation for complex function Post by: laser blaster on June 15, 2015, 07:47:20 AM In general, distance estimation can be done for any formula, using this technique: http://iquilezles.org/www/articles/distance/distance.htm
This is essentially just a simple root-finding technique. It's not very robust, though, if your function isn't "well-behaved", you will get overstepping, which you can alleviate by decreasing the fudge factor. Another option would be to resort to a completely general and accurate root-finding method, probably something involving interval arithmetic (this has never really been tried by the fractal community before, as far as I know). If your formula is close enough to the Mandelbrot formula, then you'll be better off using the classic Mandelbrot/Mandelbulb DE function, de = 0.5*log(r)*r/dr This function works on a similar principal as Quilez' version, but is specially designed to give accurate results for the 2D Mandelbrot (and seems to give improved results for any 2D or 3D abs variant of it). The derivative (which is necessary to compute the DE) can be calculated using the same techniques as with the Mandelbulb. The running scalar derivative approach is too inaccurate to give good results for the power 2 3D burning ship (actually, the scalar derivative method gives inaccurate results for all formulas, including the 2D Mandelbrot, but it's not really noticeable for the Mandelbulb), so I suggest using the 4-point delta DE approach. Even with the 4-point DE, there is still considerable overstepping and noisy/foamy areas, that can be corrected by a lower fudge factor. This is because the DE formula (de = 0.5*log(r)*r/dr[/b]) is only valid for the regular 2D Mandelbrot. This is because DE formula was derived using theorems that only apply to conformal maps, and all 3D Mandelbulb variants, along with all 2D abs variants, are non-conformal formulas. Title: Re: Distance Estimation for complex function Post by: M Benesi on June 16, 2015, 05:47:54 AM Yeah. I'm using a Mandelbulb after the above function is completed- and I'm using an additional function that adds more holes:
The 3d z^2 "Mandelbrot" I'm doing has... lots of space in it, so DE can't overstep. Now, I can calculate very close to the object, and then put the space inside, but I'm still doing some transformations that aren't easy to follow (if you look at the above math, there are rotations, absolute values, then more rotations- you can leave out the -.5 "seed" value and apply that to the x-axis later). (https://lh3.googleusercontent.com/-NrJF8IWKZ88/VXjQpbxxuGI/AAAAAAAAC3o/KpQ4BkzhSxw/s800/basilica.jpg) Title: Re: Distance Estimation for complex function Post by: KRAFTWERK on June 17, 2015, 04:19:50 PM WOW, this looks powerful my friend! 88)
I hope Luca can implement in M3D... Title: Re: Distance Estimation for complex function Post by: M Benesi on June 19, 2015, 04:11:59 AM Well, unless M3D can do non DE, some math is ahead. Code: only do torpart(z) every few iterations. Great about 2-3 iterations and 4-5 iterations back from final iteration. I generally start it at iteration 4, and then skip every 2 or 3 iterations. (https://lh3.googleusercontent.com/tvYF3sgtqE-LahDcAxPvEOQpIVSrYUHKaB1kp0EmEPg=s640-no) This video shows that you can rotate individual portions of the fractal (rotate by iteration): https://www.youtube.com/watch?v=SXx36wiDpN0 (https://www.youtube.com/watch?v=SXx36wiDpN0) just torpart video: https://www.youtube.com/watch?v=kXa4qdG8a3w (https://www.youtube.com/watch?v=kXa4qdG8a3w) |