<p>Your equation for the absorption-only model is correct: You multiply the luminance $L_x$ at the surface by the transmittance of the participating media between eye and the surface. For homogeneous media you can calculate this analytically using <a href="https://en.wikipedia.org/wiki/Beer%E2%80%93Lambert_law" rel="nofollow noreferrer">Beer-Lambert law</a>:
$$L_y=L_xe^{-\mu|x-y|}$$
For heterogeneous medium you can calculate the transmittance by ray march through the medium using for example Woodcock tracking explained in <a href="http://www.cs.cornell.edu/courses/cs6630/2012sp/notes/09volpath.pdf" rel="nofollow noreferrer">the paper you referred</a>.</p>

CC BY-SA 3.0
2017-11-02T02:49:39.857Z
2017-11-02T02:49:39.857Z
JarkkoL
<p>I want to do volume rendering using path tracing with a <strong>absorption only</strong> model. And my data is in a 3D grid, which is turned into a voxel medium in my renderer.</p>

<p>However, I can't seem to be correct implementing the algorithm.</p>

<p>According to <a href="https://www.cs.cornell.edu/courses/cs6630/2012sp/notes/09volpath.pdf" rel="nofollow noreferrer">this note</a> (however absorption-only heterogeneous case is not mentioned here), the radiance at point $x$, direction $\omega$, with <strong>emission-absorption</strong> model in a <strong>homogeneous</strong> medium is:</p>

<p>$L(x,\omega) = \int_{x}^{y} \tau(x,x') \epsilon(x')dx + \tau(x,y)L_e(x,\omega)$</p>

<p>where $\tau$ is the attenuation, y is a point on surface, and $\epsilon$ is emission at point $x'$.</p>

<p>So I come up with the <strong>heterogenous</strong>, <strong>absorption-only</strong> equation as:</p>

<p>$L(x, \omega) = \tau(x,y)L_e(x,\omega)$</p>

<p>since I think the emission term should be omitted. However this equation seems not correct intuitively and do not give correct image.</p>

<p>According to this equation, the radiance at every point $x'$ along the ray within the volume is not counted, which is where I think the problem lies.</p>

<p>So <strong>what is the correct heterogeneous volume path tracing equation?</strong>
<strong>How to derive the correct equation?</strong></p>

<p>I give more details of my implementation here. The scene is simply a <strong>cornell box</strong> where only a voxel medium is inside the box. I trace a ray from the eye(camera), and the ray go through the medium and intersect a surface(the wall). To simplify the procedure, I set <code>max_bounce</code> to <strong>1</strong> which means the path is 
<code>eye -&gt; medium -&gt; surface -&gt; light</code>.</p>

<p>So the value of this sample is simply the <em>throughput of the medium</em> times <em>the throughput of the surface</em> times <em>direct light at surface intersection</em>.</p>

<p><a href="https://i.sstatic.net/hoK2f.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/hoK2f.png" alt="enter image description here"></a></p>

<p>However I got the result image</p>

<p><a href="https://i.sstatic.net/8Omkw.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/8Omkw.png" alt="enter image description here"></a></p>

<pathtracing><volumetric>
How to do heterogeneous volume absorption using path tracing?
jinglei
# How to do heterogeneous volume absorption using path tracing?

(Asked by: username_0 on 2017-10-30)

I want to do volume rendering using path tracing with a **absorption only** model. And my data is in a 3D grid, which is turned into a voxel medium in my renderer.

However, I can't seem to be correct implementing the algorithm.

According to [this note](https://www.cs.cornell.edu/courses/cs6630/2012sp/notes/09volpath.pdf) (however absorption-only heterogeneous case is not mentioned here), the radiance at point $x$, direction $\omega$, with **emission-absorption** model in a **homogeneous** medium is:

$L(x,\omega) = \int\_{x}^{y} \tau(x,x') \epsilon(x')dx + \tau(x,y)L\_e(x,\omega)$

where $\tau$ is the attenuation, y is a point on surface, and $\epsilon$ is emission at point $x'$.

So I come up with the **heterogenous**, **absorption-only** equation as:

$L(x, \omega) = \tau(x,y)L\_e(x,\omega)$

since I think the emission term should be omitted. However this equation seems not correct intuitively and do not give correct image.

According to this equation, the radiance at every point $x'$ along the ray within the volume is not counted, which is where I think the problem lies.

So **what is the correct heterogeneous volume path tracing equation?**
**How to derive the correct equation?**

I give more details of my implementation here. The scene is simply a **cornell box** where only a voxel medium is inside the box. I trace a ray from the eye(camera), and the ray go through the medium and intersect a surface(the wall). To simplify the procedure, I set `max_bounce` to **1** which means the path is
`eye -> medium -> surface -> light`.

So the value of this sample is simply the *throughput of the medium* times *the throughput of the surface* times *direct light at surface intersection*.

[![enter image description here](https://i.sstatic.net/hoK2f.png)](https://i.sstatic.net/hoK2f.png)

However I got the result image

[![enter image description here](https://i.sstatic.net/8Omkw.png)](https://i.sstatic.net/8Omkw.png)

**Tags:** pathtracing, volumetric


---

## 1 answers

### Answer by username_1 on 2017-11-02. Score: 2 | Accepted answer

Your equation for the absorption-only model is correct: You multiply the luminance $L\_x$ at the surface by the transmittance of the participating media between eye and the surface. For homogeneous media you can calculate this analytically using [Beer-Lambert law](https://en.wikipedia.org/wiki/Beer%E2%80%93Lambert_law):
$$L\_y=L\_xe^{-\mu|x-y|}$$
For heterogeneous medium you can calculate the transmittance by ray march through the medium using for example Woodcock tracking explained in [the paper you referred](http://www.cs.cornell.edu/courses/cs6630/2012sp/notes/09volpath.pdf).


---

