Title: (Beginner) Escape conditions for mandelbox Post by: barkeg on July 25, 2011, 11:31:52 PM Hello,
I'm new here. I'm just playing arround with the renderer I've written. So 2D fractals and mandelbulb went fine. But when it comes to the mandelbox I don't know at which number I have breake the loop of iterating. Is there something like in the mandelbulbs if magnitude(v)>2 it diverges? I've read something like that if it's a scale 2 fractal it diverges if magnitude(v)>6 and magnitude(v)>2 for fractals with negative scale. But that doesn't work for me. It only rendered a cloud of points. I had to put the limit to 11 (at scale 2) and it worked fine. Is there any relation between the scale and the escape value? (some formula?) Well, here go some pics: (http://i52.tinypic.com/300qjcy.jpg) (http://i52.tinypic.com/348psa0.jpg) A mandelbulb (cosine version) (http://i51.tinypic.com/wjugp4.jpg) And a test with environmentmapping (http://i51.tinypic.com/992ukh.jpg) By the way, very nice forum! It helps me a lot! (and sorry for my english, I hope you understand what I mean) Title: Re: (Beginner) Escape conditions for mandelbox Post by: cKleinhuis on July 26, 2011, 12:09:44 AM according to the site:
http://sites.google.com/site/mandelbox/what-is-a-mandelbox the escape condition is the same as for the mandelbrot, dont let you confuse by the "foldings" it is the same logik as for the mandelbrot, when a certain limit is reached it can never get back ... and your 2 first images look nice as a mandelbox should look: http://www.cinn-almonds.com/roasters/original.htm :D Title: Re: (Beginner) Escape conditions for mandelbox Post by: cKleinhuis on July 26, 2011, 12:14:50 AM but you have to keep in mind that the mandelbox uses a bit greate value for deciding if the formula escapes,
the mandelbox is "bigger" than the mandelbrot, i think it covers -6 to 6, so checking for abs(z)>6 should do the trick ;) as a side note: the bailout condition is always just an "optimisation" or "heuristic" it can be as big as you like, the "inside" points will stay inside, regardless which bailout condition you take, and the others just bailout a little later when using a bigger bailout value, so shifting of colors could occur, so, as a general rule: "it doesnt matter how big your bailout value is, your inside/outside test will yield correct results, but keeping this value as low as possible can dramatically decrease your rendering time!" some coloring algorithms need BIG bailout conditions to look good Title: Re: (Beginner) Escape conditions for mandelbox Post by: barkeg on July 26, 2011, 01:22:22 AM First: Thank you for replying!
Second: That's right! Inside points will keep inside but on the other hand points that aren't inside will keep inside with to lower values. I think it depends on the number of iterations too. Some images to show you what happens: All were done with 10 iterations (please ignore the white pixels, its a bug on the shading function) this one is a scale=2 and has a escapa value of abs(z)>6: (http://i56.tinypic.com/xanjib.jpg) scale=2 and abs(z)>11 (I think this is what a scale 2 should look like) (http://i56.tinypic.com/1t0t8z.jpg) scale=2 abs(z)>30 (http://i56.tinypic.com/sgspqb.jpg) They are very small but I hope you get an idea. Well, it's true that it has a range of -6 to 6 but I thought to get the corners in it, it would be sqrt(6^2+6^2+6^2)=10.392 which is pretty close to the 11 I used. It's just an idea ;) Title: Re: (Beginner) Escape conditions for mandelbox Post by: cKleinhuis on July 26, 2011, 11:11:58 AM ah yes, its 3d ;)
but all in all you are correct, you can experiment with it ;) Title: Re: (Beginner) Escape conditions for mandelbox Post by: barkeg on July 26, 2011, 12:03:01 PM Ok, thanks! I'll upload some images when I get it colored.
Title: Re: (Beginner) Escape conditions for mandelbox Post by: DarkBeam on July 26, 2011, 02:27:18 PM Try with 60 iters and bail 1024, it should look perfect :D
Title: Re: (Beginner) Escape conditions for mandelbox Post by: barkeg on July 26, 2011, 04:03:15 PM iter=60 , bailout=1024
(http://i53.tinypic.com/2dmhvyc.jpg) I think it's because it has to much detail so it couldn't show it per pixel. Anyway, I've read somewhere in this forums that 20 is the maximum of iterations to do to look good. But when you zoom in it could be more, so I'm thinking of increasing the iterations when doing more zoom. Title: Re: (Beginner) Escape conditions for mandelbox Post by: DarkBeam on July 26, 2011, 05:20:03 PM I am not so expert of these details, ask Buddhi or Jesse ... Or look at Buddhi's source code it should be very handy :)
Title: Re: (Beginner) Escape conditions for mandelbox Post by: barkeg on July 26, 2011, 10:52:35 PM I'll take a look at the source code maybe but I think I'll let it as a number you can input and to change the shape.
Thanks,anyway ;) Title: Re: (Beginner) Escape conditions for mandelbox Post by: marius on July 26, 2011, 11:55:58 PM I'll take a look at the source code maybe but I think I'll let it as a number you can input and to change the shape. Thanks,anyway ;) You need to implement some dynamic level of detail, depending on distance and projected on screen error. That's what the raymarchers all do and how you get decent pictures from near to far without getting the pixie dust appearance for high iteration counts like you show earlier in this thread. Yet you want the high iteration count for detail nearby. See for instance http://code.google.com/p/boxplorer2/source/browse/trunk/cfgs/menger.cfg.data/fragment.glsl#215 and how m_zoom gets used further down that main() to control the raymarching end condition. In general, the simple .glsl fragments that implement some of the formulae are pretty instructive and self-contained. See source for boxplorer, boxplorer2, fragmentarium, http://fractal.io and various posts all over this forum. Have fun! Title: Re: (Beginner) Escape conditions for mandelbox Post by: barkeg on July 27, 2011, 02:40:49 PM That was what I had in mind ;)
I think I understand the zoom algorithm: -it stops "if (D < m_dist) break;" where m_dist = max(min_dist, m_zoom * totalD) And I think I don't need a bailout when using the distance estimator because a ray actually never "hits" the fractal (tell me when I'm wrong) I'll try to implement it. I was using a simple voxel system looking if each voxel diverges or not (it's so slow!!) Thanks! Title: Re: (Beginner) Escape conditions for mandelbox Post by: marius on July 27, 2011, 06:40:44 PM That was what I had in mind ;) Right, a proper distance estimation will give smaller and smaller estimates until you run out of numerical precision.I think I understand the zoom algorithm: -it stops "if (D < m_dist) break;" where m_dist = max(min_dist, m_zoom * totalD) And I think I don't need a bailout when using the distance estimator because a ray actually never "hits" the fractal (tell me when I'm wrong) Quote I'll try to implement it. I was using a simple voxel system looking if each voxel diverges or not (it's so slow!!) With the raymarching approaches you get occlusion culling for free and easy access to lots of raytracing techniques like reflection, refraction, shadowing etc. But you have to compute for every new view. Keeping a voxel cloud of interesting detail in memory is going to be challenging real quick. The distance estimation functions for the various fractals are hard to come up with and kind of magic at first. Title: Re: (Beginner) Escape conditions for mandelbox Post by: barkeg on July 27, 2011, 07:02:06 PM Oh, i think you were writting when I did another post ;)
I did only compute the voxel wich are visible (for every frame). Well, it's not really a voxel (I began with voxel). I did the same as the distance estimator but with fixed step and when I found something "solid" I did half of the old step backwards and so on. But the fixed step still had to be small to not loose too much detail. Title: Re: (Beginner) Escape conditions for mandelbox Post by: knighty on August 26, 2011, 01:50:09 AM First: Thank you for replying! Second: That's right! Inside points will keep inside but on the other hand points that aren't inside will keep inside with to lower values. I think it depends on the number of iterations too. Some images to show you what happens: All were done with 10 iterations (please ignore the white pixels, its a bug on the shading function) this one is a scale=2 and has a escapa value of abs(z)>6: (http://i56.tinypic.com/xanjib.jpg) scale=2 and abs(z)>11 (I think this is what a scale 2 should look like) (http://i56.tinypic.com/1t0t8z.jpg) scale=2 abs(z)>30 (http://i56.tinypic.com/sgspqb.jpg) They are very small but I hope you get an idea. Well, it's true that it has a range of -6 to 6 but I thought to get the corners in it, it would be sqrt(6^2+6^2+6^2)=10.392 which is pretty close to the 11 I used. It's just an idea ;) If you are still interrested, here is the post where I have given the formula of the size of the mandelbox (http://www.fractalforums.com/3d-fractal-generation/mandelbox-size/). |