3

So I'm trying to render participating media like clouds/sky/fog (Sky is the first step) etc. I had already implemented a normal pathtracer and I was thinking of extending it. But I heard terms like Ray marching/Sphere tracing are used for rendering volumes.

A quick search brings up this question where the guy is trying to use Monte Carlo methods to render the Sky. This has me confused. Does this mean we can use Path tracing together with ray marching? Or do we have to choose 1 over the other? Or is it that both are actually solving different problems? I have read up on what ray marching actually means, I just want to get a clear understanding of the connection between raymarching - raytracing/pathtracing.

gallickgunner
  • 2,438
  • 1
  • 12
  • 34
  • 1
    Ray marching simply solves for the intersection numerically. So it's more logical to compare it to ray casting as a technique. You can obviously use a combination of both for path tracing - you'll evaluate some points/intersections through ray marching, and others analytically. – lightxbulb Jul 01 '19 at 18:44
  • ^^ This. There are tons of other sources which imply that Ray marching is more of a an algorithm used for volume rendering, even wikipedia suggest that. Where as after getting to know it, it feels just, as you said, an algorithm to solve the intersection problem. I mean the core part of ray marching lies in using variable/fixed steps to keep marching and find the intersection point along that ray, the sampling along that ray part is more related to volumetric rendering and not to ray marching in general. Is that correct? – gallickgunner Jul 02 '19 at 07:07
  • The articles and wikipedia are not wrong per se. The issue is that based on the context it can mean different things. You use ray marching both for volume rendering (since you march along the ray to integrate over space) and for numerical surface intersection. It's just how some "terms" work in CG - they've been overloaded with various meanings in multiple papers. – lightxbulb Jul 02 '19 at 07:28
  • 1
    Okay but if we are using progressive Monte Carlo methods, we don't necessarily have to take n samples or steps along the ray to integrate over the space, right? We'd just probabilistically select a sample point along the ray and weigh the whole thing by the probability of selecting that point. – gallickgunner Jul 02 '19 at 08:40
  • Not always, you may want to march in probabilistic steps. Due to the attenuation law (or for anisotropic media) you may not want to just pick sample randomly over the ray, but rather march along it, so when the contribution becomes too small you can exit early. Just take the term as is - a very general term. The same way ray tracing is a very general term. – lightxbulb Jul 02 '19 at 09:24
  • 1
    I dont think the term is overloaded. Its just describing how its done. I mean i can describe traveling to work as taking the bus, driving car or walking. But that doea not man my mode of transportation tells where im going. So its valid to do other things with those modes of transportation. – joojaa Jul 02 '19 at 23:14

0 Answers0