<p>Ray marching is a ray tracing method where you take multiple steps along a ray to find intersection with geometry or to perform integration of in-scattered light from participating media (fog, clouds, water, etc.) along the ray. Signed distance fields doesn't really help you with participating media rendering since it's a method of finding the ray intersection instead of helping with volume integration.</p>

<p>So when you perform ray marching along the ray for volume integration, for each step you need to calculate incoming light to that point and evaluate the "phase function" to calculate how much of that light scatters towards the eye. This phase function can be simple isotropic function (i.e. constant $\frac{\rho}{4\pi}$) or more complex anisotropic function such as Mie phase function shown below, depending on the modeled participating media.</p>

<p><a href="https://i.sstatic.net/WR0ZN.png" rel="noreferrer"><img src="https://i.sstatic.net/WR0ZN.png" alt="Mie Phase Function"></a></p>

<p>Additionally you need to take the extinction coefficient of the media into account, which is spatially varying for heterogeneous media, for calculating transmittance and to properly "attenuate" the in-scattered light as it's being blocked by media between eye and the point (<a href="https://en.wikipedia.org/wiki/Beer%E2%80%93Lambert_law" rel="noreferrer">Beer-Lambert law</a>). This approach assumes homogeneous media between steps and for proper physically based integration you could take a look at SIGGRAPH 2015 presentation "<a href="http://www.frostbite.com/2015/08/physically-based-unified-volumetric-rendering-in-frostbite/" rel="noreferrer">Physically-based &amp; Unified Volumetric Rendering in Frostbite</a>" by Sebastien Hillaire.</p>

<p>To know how much light reaches a point in space for each of those ray steps, you can use path tracing. This can get quite expensive though since light can take random paths in the media until it reaches the point. This is known as "multiple scattering", which is analogous to indirect illumination. When performing the integration over the sphere for each step along the ray, you can use <a href="http://www.cs.cornell.edu/courses/cs6630/2012sp/notes/09volpath.pdf" rel="noreferrer">Woodcock tracking</a> to get unbiased results for heterogeneous media. Also if you use Mie phase function you should use importance sampling as the phase function has very strong forward peak.</p>

CC BY-SA 3.0
2016-12-25T20:09:34.663Z
2016-12-25T20:09:34.663Z
JarkkoL
<p>I have a few doubts and questions regarding <strong>volume rendering</strong>, I was hoping someone here could help me understand.</p>

<ol>
<li>I commonly hear the terms <strong>'Ray-Marching'</strong> &amp; <strong>'Volume Rendering'</strong> being used together when it comes to <strong>rendering fog or any other volumetric object.</strong></li>
</ol>

<p><strong>Is Ray Marching the method used to render these volumes such as Fog, Smoke &amp; Fire</strong> <em>(this is regarding path tracing)</em>? Since we can use signed distance fields to <strong>easily manipulate the shape of the volume?</strong> At the <strong>approximated intersection point is a BSDF evaluated</strong> (BRDF + BTDF) or is it <strong>just a BRDF?</strong></p>

<hr>

<ol start="2">
<li>At the approximated intersection point for the volume <strong>what BRDF/BSDF do we use (if we do use one, I might have a wrong understanding of the topic)? Are there measured BRDFs &amp; BTDFs that is the common standard?</strong></li>
</ol>

<hr>

<brdf><pathtracing><volumetric><raymarching><volumetric-scattering>
Volume Rendering (Path Tracing & Real-Time)
Arjan Singh
# Volume Rendering (Path Tracing & Real-Time)

(Asked by: username_0 on 2016-12-25)

I have a few doubts and questions regarding **volume rendering**, I was hoping someone here could help me understand.

1. I commonly hear the terms **'Ray-Marching'** & **'Volume Rendering'** being used together when it comes to **rendering fog or any other volumetric object.**

**Is Ray Marching the method used to render these volumes such as Fog, Smoke & Fire** *(this is regarding path tracing)*? Since we can use signed distance fields to **easily manipulate the shape of the volume?** At the **approximated intersection point is a BSDF evaluated** (BRDF + BTDF) or is it **just a BRDF?**

---

2. At the approximated intersection point for the volume **what BRDF/BSDF do we use (if we do use one, I might have a wrong understanding of the topic)? Are there measured BRDFs & BTDFs that is the common standard?**

---

**Tags:** brdf, pathtracing, volumetric, raymarching, volumetric-scattering


---

## 1 answers

### Answer by username_1 on 2016-12-25. Score: 7 | Accepted answer

Ray marching is a ray tracing method where you take multiple steps along a ray to find intersection with geometry or to perform integration of in-scattered light from participating media (fog, clouds, water, etc.) along the ray. Signed distance fields doesn't really help you with participating media rendering since it's a method of finding the ray intersection instead of helping with volume integration.

So when you perform ray marching along the ray for volume integration, for each step you need to calculate incoming light to that point and evaluate the "phase function" to calculate how much of that light scatters towards the eye. This phase function can be simple isotropic function (i.e. constant $\frac{\rho}{4\pi}$) or more complex anisotropic function such as Mie phase function shown below, depending on the modeled participating media.

[![Mie Phase Function](https://i.sstatic.net/WR0ZN.png)](https://i.sstatic.net/WR0ZN.png)

Additionally you need to take the extinction coefficient of the media into account, which is spatially varying for heterogeneous media, for calculating transmittance and to properly "attenuate" the in-scattered light as it's being blocked by media between eye and the point ([Beer-Lambert law](https://en.wikipedia.org/wiki/Beer%E2%80%93Lambert_law)). This approach assumes homogeneous media between steps and for proper physically based integration you could take a look at SIGGRAPH 2015 presentation "[Physically-based & Unified Volumetric Rendering in Frostbite](http://www.frostbite.com/2015/08/physically-based-unified-volumetric-rendering-in-frostbite/)" by Sebastien Hillaire.

To know how much light reaches a point in space for each of those ray steps, you can use path tracing. This can get quite expensive though since light can take random paths in the media until it reaches the point. This is known as "multiple scattering", which is analogous to indirect illumination. When performing the integration over the sphere for each step along the ray, you can use [Woodcock tracking](http://www.cs.cornell.edu/courses/cs6630/2012sp/notes/09volpath.pdf) to get unbiased results for heterogeneous media. Also if you use Mie phase function you should use importance sampling as the phase function has very strong forward peak.


---

