Title: What is ray marching Post by: ricbennet on January 10, 2012, 09:08:32 PM Hi,
Mandelbulber uses ray marching to render 3d fractals. I do not know at all. Does anyone know a good website which would explain the algorithms (if there is simple examples in C + + is even better). thank you Title: Re: What is ray marching Post by: cKleinhuis on January 10, 2012, 09:35:49 PM quick search yielded this:
http://graphicsrunner.blogspot.com/2009/01/volume-rendering-101.html http://cg.alexandra.dk/tag/ray-marching/ Title: Re: What is ray marching Post by: ricbennet on January 11, 2012, 09:49:47 PM quick search yielded this: http://graphicsrunner.blogspot.com/2009/01/volume-rendering-101.html http://cg.alexandra.dk/tag/ray-marching/ Thank you for your help. In fact, I had already done research on this subject. I was looking for more of a known and trusted website. But these one are good... Title: Re: What is ray marching Post by: DarkBeam on January 11, 2012, 11:57:00 PM Look for Inigo Quilez articles
Good luck Title: Re: What is ray marching Post by: Syntopia on January 12, 2012, 08:28:59 AM I've written some blog posts on this: http://blog.hvidtfeldts.net/index.php/2011/06/distance-estimated-3d-fractals-part-i/
There are also links to Hart's and Quilez's excellent papers there. Title: Re: What is ray marching Post by: ricbennet on January 12, 2012, 11:03:43 PM Look for Inigo Quilez articles Good luck I've written some blog posts on this: http://blog.hvidtfeldts.net/index.php/2011/06/distance-estimated-3d-fractals-part-i/ There are also links to Hart's and Quilez's excellent papers there. Thank you. :D Title: Re: What is ray marching Post by: ker2x on January 13, 2012, 10:41:24 AM May i explain in very simple words ?
You probably know what i'm going to say but.... just in case ;D By using raytracing you assume that you can calculate directly the intersection between a ray and a primitive (eg : triangle). However, this is not always possible to calculate directly this intersection. That's why there is raymarching. you launch a "ray", at every step you use a Distance Estimator (some kind of black magic function) that estimate the distance between the actual position of the ray and the closest surface of all objects in the scene, and advance by this estimated distance multiplied by a factor < 1.0 and do it again 'til you consider you're close enough to the surface of the object. (at this stage you can calculate color, reflection, and so on). One of the others advantage of raymarching (beside the fact that it "just" works) is that some stuffs like Ambiant Occlusion is almost free to compute. Simple, huh ? :) and a picture worth a thousahds words, so here it is : (http://http.developer.nvidia.com/GPUGems2/elementLinks/08_displacement_05.jpg) And as said : Look for Inigo Quilez articles and good luck :) Title: Re: What is ray marching Post by: ricbennet on January 13, 2012, 08:04:36 PM May i explain in very simple words ? You probably know what i'm going to say but.... just in case ;D By using raytracing you assume that you can calculate directly the intersection between a ray and a primitive (eg : triangle). However, this is not always possible to calculate directly this intersection. That's why there is raymarching. you launch a "ray", at every step you use a Distance Estimator (some kind of black magic function) that estimate the distance between the actual position of the ray and the closest surface of all objects in the scene, and advance by this estimated distance multiplied by a factor < 1.0 and do it again 'til you consider you're close enough to the surface of the object. (at this stage you can calculate color, reflection, and so on). One of the others advantage of raymarching (beside the fact that it "just" works) is that some stuffs like Ambiant Occlusion is almost free to compute. Simple, huh ? :) and a picture worth a thousahds words, so here it is : (http://http.developer.nvidia.com/GPUGems2/elementLinks/08_displacement_05.jpg) And as said : Look for Inigo Quilez articles and good luck :) Hi ker2x, I started reading articles, but your picture changes everything ... now I understood ray marching ... ;D Thank you. Title: Re: What is ray marching Post by: asimes on April 02, 2012, 06:18:31 AM How do I go about making (or at least learning about) the "Black Magic Function", the Distance Estimator. I'd like to get into rendering code, and I feel like I mostly understand how Ray Marching works now, but figuring out the closest surface is beyond me. Even if I have a REALLY simple scene, like one cube and one sphere randomly in front of a camera, how do I determine the closest point to where a ray currently is?
Title: Re: What is ray marching Post by: taurus on April 02, 2012, 05:01:36 PM How do I go about making (or at least learning about) the "Black Magic Function", the Distance Estimator. I'd like to get into rendering code, and I feel like I mostly understand how Ray Marching works now, but figuring out the closest surface is beyond me. Even if I have a REALLY simple scene, like one cube and one sphere randomly in front of a camera, how do I determine the closest point to where a ray currently is? subblues blog containes a quite simple description of distance estimation for the mandelbulb. just take a look ;D http://www.subblue.com/blog/2009/12/13/mandelbulb (http://www.subblue.com/blog/2009/12/13/mandelbulb) Title: Re: What is ray marching Post by: ker2x on April 02, 2012, 05:48:31 PM take a look at IQ's website (as usual ;D ) that show a lot of DE function for basic primitives :
http://www.iquilezles.org/www/articles/distfunctions/distfunctions.htm it help a lot to understand DE. But i still don't understand how magician managed to find a DE function for mandelbulb. I think it's about partial-derivative-of-thingystuff (+ some pepermint and frog's eye boiled with unicorn golden wing, just in case) Title: Re: What is ray marching Post by: Syntopia on April 02, 2012, 09:09:32 PM If you are interested in how to actually construct a distance estimator and a running derivative for the Mandelbulb (and other fractals), this is covered in part 3-7 in my blog posts linked to earlier in this thread.
There are no real formal proofs for the Mandelbulb and Mandelbox, however. The closest thing with a formal mathematical proof is the 4D Quaternion distance estimator which was proven in the book Hyperdimensional Iteration in 2002. It is very complicated, though. Title: Re: What is ray marching Post by: David Makin on April 02, 2012, 09:48:41 PM I think it's about partial-derivative-of-thingystuff (+ some pepermint and frog's eye boiled with unicorn golden wing, just in case) :) Actually AFAIK it was Jos Leys who basically figured that the complex/quaternion DE method might work in the simplified form for triplex without bothering with Jacobians or such for "correct" derivatives and he was quite surprised at how well it worked - though once more esoteric formulas are tried I'm guessing that some "issues" will be encountered (and of course the surface hasn't been scratched yet even in terms of straight triplex polys). |