<p>I've been looking <a href="http://advances.realtimerendering.com/s2015/The%20Real-time%20Volumetric%20Cloudscapes%20of%20Horizon%20-%20Zero%20Dawn%20-%20ARTR.pdf" rel="nofollow noreferrer">The Real-time Volumetric Cloudscapes of Horizon-Zero Dawn</a>, but I'm very confused by a few terms.  </p>

<p>The presentation mentions "The Henyey-Greenstein phase function" on page 54, however does not mention how it is used nor what parameters are needed for it.  In fact they act like it is a constant, but it doesn't appear as if it is.  I've seen a <a href="http://www.astro.umd.edu/~jph/HG_note.pdf" rel="nofollow noreferrer">couple</a> different <a href="http://glossary.ametsoc.org/wiki/Henyey-greenstein_phase_function" rel="nofollow noreferrer">formulations</a> of the same equation, and I don't understand how to use it.  If <code>theta</code> corresponds to the scattering angle, I'm not sure what actually constitutes the scattering angle in our rendering.  Is it the initial ray march angle, or light source marching angle? If theta corresponds to the light source march angle, that would be confusing since there isn't just one angle, there are 6 that they randomly select in a cone progressively further out according to page 83. </p>

<p>Additionally the final equation used on page 77 is <code>e^(-d*r)*HG*P</code>.  Where I assume <code>P</code> is powder equation <code>(1.0 - e^(-d *2))</code>, HG is Henyey-Greenstein, and where <code>d</code> corresponds with "depth", but normally combines both depth and density and where it looks like <code>r</code> is "absorption increasing for rain clouds" otherwise it just came out of nowhere. </p>

<p>I'm further confused by how they use the equations, they seem to sample <em>alpha</em> with forward marching, then sample <em>energy</em> with the light cone/ light direction marching.  The lack of a separate depth and density coefficient is what is concerning.  </p>

<p>Going off of the presentation and other sources, my perception of the approach is as follows (ignoring the optimizations of the coarse steps, the fine grained steps, and the cone method for shadow marching): </p>

<ul>
<li><p>Forward march with a fixed size until you have a non zero density.  </p></li>
<li><p>Then march in the direction of the light accumulating the density values at each step.</p></li>
<li><p>plugin this summed density into the equation as <code>d</code>,  <code>e^(-d*r)*HG*(1.0 - e^(-d *2))</code></p></li>
<li><p>multiply this product by our current forward marched density</p></li>
<li><p>multiply this value by some sort of transmittance value which is a function of how much "stuff" we've gone through in our cloud. </p></li>
<li><p>return this value of transmittance, and the value of the light intensity as our final result, transmittance will represent our alpha in some form (either as the actual value, or 1.0 - transmittance) with range 0.0 to 1.0. </p></li>
</ul>

<p><strong>Are these steps correct and what does theta correspond to for this application in Henyey-Greenstein <code>HG</code> and which form of the <code>HG</code> equation do I need to use?</strong></p>

CC BY-SA 3.0
2018-04-11T23:26:12.933Z
`theta` is the angle between the view vector and the light vector. In volume rendering Henyey-Greenstein its used to describe the probability of forward scattering, isometric scattering, or backward scattering
Nadir
CC BY-SA 3.0
2018-04-12T18:14:13.307Z
@Nadir, but then what version of the equation is used? Additionally they use that wierd conal sampling and accumulate to a single value, and they use it as if its one angle then?
Krupip
CC BY-SA 4.0
2018-05-25T17:08:38.560Z
sorry for the delay, I recently implemented this clouds. The equation used is the standard equation (1) which you can find here https://www.astro.umd.edu/~jph/HG_note.pdf . About the cone sampling, the only angle used is that between the raymarch direction and the light vector at the point you start cone-sampling
Nadir
<rendering><shader><lighting><volumetric><raymarching>
Not understanding the lighting equation for volumetric cloud rendering
Krupip
# Not understanding the lighting equation for volumetric cloud rendering

(Asked by: username_0 on 2018-04-11)

I've been looking [The Real-time Volumetric Cloudscapes of Horizon-Zero Dawn](http://advances.realtimerendering.com/s2015/The%20Real-time%20Volumetric%20Cloudscapes%20of%20Horizon%20-%20Zero%20Dawn%20-%20ARTR.pdf), but I'm very confused by a few terms.

The presentation mentions "The Henyey-Greenstein phase function" on page 54, however does not mention how it is used nor what parameters are needed for it. In fact they act like it is a constant, but it doesn't appear as if it is. I've seen a [couple](http://www.astro.umd.edu/~jph/HG_note.pdf) different [formulations](http://glossary.ametsoc.org/wiki/Henyey-greenstein_phase_function) of the same equation, and I don't understand how to use it. If `theta` corresponds to the scattering angle, I'm not sure what actually constitutes the scattering angle in our rendering. Is it the initial ray march angle, or light source marching angle? If theta corresponds to the light source march angle, that would be confusing since there isn't just one angle, there are 6 that they randomly select in a cone progressively further out according to page 83.

Additionally the final equation used on page 77 is `e^(-d*r)*HG*P`. Where I assume `P` is powder equation `(1.0 - e^(-d *2))`, HG is Henyey-Greenstein, and where `d` corresponds with "depth", but normally combines both depth and density and where it looks like `r` is "absorption increasing for rain clouds" otherwise it just came out of nowhere.

I'm further confused by how they use the equations, they seem to sample *alpha* with forward marching, then sample *energy* with the light cone/ light direction marching. The lack of a separate depth and density coefficient is what is concerning.

Going off of the presentation and other sources, my perception of the approach is as follows (ignoring the optimizations of the coarse steps, the fine grained steps, and the cone method for shadow marching):

* Forward march with a fixed size until you have a non zero density.
* Then march in the direction of the light accumulating the density values at each step.
* plugin this summed density into the equation as `d`, `e^(-d*r)*HG*(1.0 - e^(-d *2))`
* multiply this product by our current forward marched density
* multiply this value by some sort of transmittance value which is a function of how much "stuff" we've gone through in our cloud.
* return this value of transmittance, and the value of the light intensity as our final result, transmittance will represent our alpha in some form (either as the actual value, or 1.0 - transmittance) with range 0.0 to 1.0.

**Are these steps correct and what does theta correspond to for this application in Henyey-Greenstein `HG` and which form of the `HG` equation do I need to use?**

**Tags:** rendering, shader, lighting, volumetric, raymarching

> **Comments:**
> **username_1**: `theta` is the angle between the view vector and the light vector. In volume rendering Henyey-Greenstein its used to describe the probability of forward scattering, isometric scattering, or backward scattering  
> **username_0**: @username_1, but then what version of the equation is used? Additionally they use that wierd conal sampling and accumulate to a single value, and they use it as if its one angle then?  
> **username_1**: sorry for the delay, I recently implemented this clouds. The equation used is the standard equation (1) which you can find here https://www.astro.umd.edu/~jph/HG_note.pdf . About the cone sampling, the only angle used is that between the raymarch direction and the light vector at the point you start cone-sampling  

---

## 0 answers

