News: Check out the originating "3d Mandelbulb" thread here
 
*
Welcome, Guest. Please login or register. October 01, 2014, 06:00:07 AM


Login with username, password and session length



Pages: [1]   Go Down
  Print  
Share this topic on DiggShare this topic on FacebookShare this topic on GoogleShare this topic on RedditShare this topic on StumbleUponShare this topic on Twitter
Author Topic: What is ray marching  (Read 5008 times)
Description: What is ray marching - algorithms used
0 Members and 1 Guest are viewing this topic.
ricbennet
Forums Newbie
*
Posts: 9


« 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
Logged
cKleinhuis
Administrator
Fractal Senior
*******
Posts: 5623


formerly known as 'Trifox'


WWW
« Reply #1 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/
Logged

---

divide and conquer - iterate and rule - chaos is No random!
ricbennet
Forums Newbie
*
Posts: 9


« Reply #2 on: January 11, 2012, 09:49:47 PM »


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...
Logged
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 1666


The spaghetti formula coder


« Reply #3 on: January 11, 2012, 11:57:00 PM »

Look for Inigo Quilez articles
Good luck
Logged

Formulas are never too much (?)

Syntopia
Fractal Bachius
*
Posts: 587



syntopiadk
WWW
« Reply #4 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.
Logged
ricbennet
Forums Newbie
*
Posts: 9


« Reply #5 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.  cheesy
Logged
ker2x
Fractal Molossus
**
Posts: 718


WWW
« Reply #6 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  grin

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 ? smiley

and a picture worth a thousahds words, so here it is :


And as said : Look for Inigo Quilez articles and good luck smiley
Logged

often times... there are other approaches which are kinda crappy until you put them in the context of parallel machines
(en) http://www.blog-gpgpu.com/ , (fr) http://www.keru.org/ ,
Sysadmin & DBA @ http://www.over-blog.com/
ricbennet
Forums Newbie
*
Posts: 9


« Reply #7 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  grin

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 ? smiley

and a picture worth a thousahds words, so here it is :
<Quoted Image Removed>

And as said : Look for Inigo Quilez articles and good luck smiley

Hi ker2x,

I started reading articles, but your picture changes everything ... now I understood ray marching ... grin

Thank you.
Logged
asimes
Iterator
*
Posts: 194

Programmer and Web Developer at EVL of UIC


asimes
WWW
« Reply #8 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?
Logged
taurus
Fractal Schemer
****
Posts: 999



profile.php?id=1339106810
WWW
« Reply #9 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  grin
http://www.subblue.com/blog/2009/12/13/mandelbulb
Logged

when life offers you a lemon, get yourself some salt and tequila!
ker2x
Fractal Molossus
**
Posts: 718


WWW
« Reply #10 on: April 02, 2012, 05:48:31 PM »

take a look at IQ's website (as usual  grin ) 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)
Logged

often times... there are other approaches which are kinda crappy until you put them in the context of parallel machines
(en) http://www.blog-gpgpu.com/ , (fr) http://www.keru.org/ ,
Sysadmin & DBA @ http://www.over-blog.com/
Syntopia
Fractal Bachius
*
Posts: 587



syntopiadk
WWW
« Reply #11 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.
Logged
David Makin
Global Moderator
Fractal Senior
******
Posts: 2269



Makin' Magic Fractals
WWW
« Reply #12 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)

smiley 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).
Logged

The meaning and purpose of life is to give life purpose and meaning.

http://www.fractalgallery.co.uk/
"Makin' Magic Music" on Jango
Pages: [1]   Go Down
  Print  
 
Jump to:  


Related Topics
Subject Started by Replies Views Last post
Marching Cubes and attractor 3D Fractal Generation mishafe01 0 961 Last post November 28, 2007, 01:42:09 PM
by mishafe01
Ray Marching Distance Functions Programming asimes 10 1806 Last post April 12, 2012, 03:56:35 PM
by eiffie
rod marching Programming willvarfar 14 674 Last post August 02, 2012, 10:42:16 AM
by willvarfar
Ray tracing without marching? Programming willvarfar 12 644 Last post August 07, 2012, 11:35:35 AM
by willvarfar
Hello all!! One more Newb in the marching ranks Meet & Greet mtnlivin23 3 148 Last post October 04, 2013, 06:33:03 PM
by Nahee_Enterprises

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 2.327 seconds with 28 queries. (Pretty URLs adds 0.205s, 2q)