<p>The inverse square law does not apply to radiance. We can compute irradiance as <span class="math-container">\begin{align}
E(x, \Omega) &amp;= \int_{\Omega} L_i(x, \omega_i) \underbrace{\cos\theta_x}_{N_x \cdot \omega_i} \, dA(\omega_i) \\
&amp;= \int_{\Omega} L_o(\underbrace{r(x,\omega_i)}_{y}, \underbrace{-\omega_i}_{y\to x}) \cos\theta_x \, dA(\omega_i) \\
&amp;= \int_{\Omega} L_o(y, y\to x) \cos\theta_x dA(\omega_i) \\
&amp;= \int_{\Omega_M} L_o(y, y\to x) \cos\theta_x \underbrace{\cos\theta_y}_{N_y \cdot (y\to x)} \frac{1}{\|y-x\|^2_2} \, dA(\underbrace{y}_{r(x, \omega_i)}) \\
&amp;= \int_{M} L_o(z, z\to x) \frac{\cos\theta_x \cos\theta_z}{\|z-x\|^2_2}V(x,z) \, dA(z) \\
&amp;= \int_M L_o(z, z\to x) G(x,z) \,dA(z).
\end{align}</span></p>
<p>Here <span class="math-container">$\Omega$</span> is some subset of the hemisphere at <span class="math-container">$x$</span> around the normal <span class="math-container">$N_x$</span>. The term <span class="math-container">$L_i(x, \omega_i)$</span> is incident radiance at <span class="math-container">$x$</span> from direction <span class="math-container">$\omega_i$</span> (this direction points outwards from <span class="math-container">$x$</span>). The <span class="math-container">$dA(\omega_i)$</span> is the differential area element on this hemisphere. In vacuum the incident radiance at <span class="math-container">$x$</span> along <span class="math-container">$\omega_i$</span> is equal to the outgoing radiance from <span class="math-container">$y=r(x, \omega_i)$</span> along <span class="math-container">$-\omega_i$</span>, where <span class="math-container">$r(x, \omega_i)$</span> is the ray-tracing function and returns the first intersection <span class="math-container">$y$</span> along the ray from <span class="math-container">$x$</span> in direction <span class="math-container">$\omega_i$</span>. The <span class="math-container">$\cos\theta_x$</span> is due to Lambert's law. In line four I have done a change of variables <span class="math-container">$y=r(x, \omega_i)$</span> - so now I integrate over the projection of <span class="math-container">$\Omega$</span> onto the scene surfaces: <span class="math-container">$\Omega_M=\{r(x, \omega_i) \in M \, : \, \omega_i \in \Omega\}$</span>. This change of variables is accounted for by the factors <span class="math-container">$\cos\theta_y$</span> and <span class="math-container">$\|y - x\|^{-2}_2$</span>. The <span class="math-container">$\cos\theta_y$</span> accounts for how slanted a small area around <span class="math-container">$y$</span> is wrt <span class="math-container">$\omega_i$</span>, and <span class="math-container">$\|y-x\|^{-2}_2$</span> accounts for the fact that further away objects subtend a smaller solid angle. The step before last is just rewriting the integral over all scene points <span class="math-container">$M$</span> instead of just <span class="math-container">$\Omega_M$</span>, by introducing a visibility function <span class="math-container">$V(x,z)$</span> which is one if <span class="math-container">$r(x, x\to z) = z$</span>, and zero otherwise. That is what is typically termed the area formulation.</p>
<p>As you can see, the inverse square distance term arises from parametrising integration over points as opposed to directions. But the two integrals are equal, so in theory it doesn't matter which you use (in practice you use the area formulation for light sampling). There's no issue that this isn't part of radiance, since radiance does not fall off quadratically.</p>
<p>There is no issue in a path tracer either as it is estimating integrals that either implicitly (solid angle formulation) or explicitly (area formulation) include the quadratic falloff term.</p>

CC BY-SA 4.0
2024-02-16T15:33:32.840Z
I know the inverse square law does not apply to radiance, but I'm still confused as to how light falloff is captured. When I trace a ray from the camera to some point $x$, if that point $x$ is exposed to a light emitting radiance $L_o$, then (in vacuum) it doesn't matter how far $x$ is from the light, it will still always receive $L_o$. How do points further away from the light render as if they are darker, if they receive the same radiance?  I brought irradiance into this only because in that context, it makes sense to me why they'd appear darker.  But dealing purely with radiance, I am lost.
Chris Gnam
CC BY-SA 4.0
2024-02-16T15:38:30.420Z
@ChrisGnam When you trace a ray from the camera to a point $x$, in order to tell how much light is scattered back to the camera you need to compute an integral. If the light source is further away the subtended solid angle is smaller, then the integral is non-zero over a solid angle that scales inversely quadratically with distance. Alternatively you could rewrite it as an integral over the surface of the light source, and then the inverse squared distance term becomes explicit as I noted.
lightxbulb
CC BY-SA 4.0
2024-02-16T15:50:16.203Z
I follow the intuition of that, however if I take the radiance (units of $W/(sr \cdot m^2)$), by the solid angle subtended by the light source, I'd end up with a value with units of $W/m^2$, which is irradiance, no?  I think I'm getting tripped up on units and should probably just try to actually work out a simple example by hand to better grasp this
Chris Gnam
CC BY-SA 4.0
2024-02-16T16:01:04.760Z
@ChrisGnam The rendering equation is:
$$L_o = Le + \int_{\Omega} f L_i \cos\theta_i d\omega_i$$
Here $L_o$ is outgoing radiance, $L_e$ is emitted radiance, the integral is taken over solid angle so it would get rid of one $sr^{-1}$, but the brdf has units $sr^{-1}$ and the incident radiance has units $W m^{-2} sr^{-1}$, so you still get the correct units.
lightxbulb
CC BY-SA 4.0
2024-02-16T09:04:40.670Z
2024-02-16T12:07:41.517Z
2024-02-16T12:07:41.517Z
lightxbulb
<p>My understanding is that path tracers deal with radiance because radiance is constant along a ray.  You simply go through and evaluate the light transport equation:</p>
<p><span class="math-container">$$
L_o(p, \omega_o) = L_e(p,\omega_o) + \int_S f(p,\omega_o,\omega_i)L_i(p,\omega_i) | \cos{\theta_i}| \ d\omega_i
$$</span></p>
<p>with the goal of tracing a path through the scene and calculating the total radiance contributed to that path.  My confusion comes from the following:</p>
<p>Say I have a spherical light, that has a radius of <span class="math-container">$1m$</span>, and has a total radiant power of <span class="math-container">$100W$</span>.  Assuming the light is isotropic, I can calculate the radiant exitance from this light by dividing the total radiant power, by its surface area, giving:</p>
<p><span class="math-container">$$
M_e = \frac{100 W}{4\pi(1m)^2} = 7.9577 \frac{W}{m^2}
$$</span></p>
<p>Using the following relations:</p>
<p><span class="math-container">\begin{align}
M_e &amp;= \frac{\partial \Phi_e}{\partial A} \\
L_{e,\Omega} &amp;= \frac{\partial^2 \Phi_e}{\partial\Omega \partial (A\cos{\theta})}\\
\end{align}</span></p>
<p>I can calculate the emitted radiance from its surface by the following:</p>
<p><span class="math-container">\begin{align}
L_{e,\Omega} &amp;= \frac{\partial M_e}{\partial \Omega} \frac{1}{\cos{\theta}}\\
\int_SL_{e,\Omega} \cos{\theta} \ d\Omega &amp;= M_e\\
\int_0^{2\pi}\int_0^{\pi/2} L_{e,\Omega}\cos{\theta}\sin{\theta} \ d\theta \ d\phi &amp;= M_e\\
L_{e,\Omega} \pi &amp;= M_e\\
L_{e,\Omega} &amp;= \frac{M_e}{\pi}\\
\boxed{L_{e,\Omega} = 2.533 \frac{W}{sr \cdot m^2}}
\end{align}</span></p>
<p>Now if I cast two rays into the scene, one which lands 100m from the light, and the other which lands 10m from the light, they should be illuminated very differently.  Yet, when I sample the light source, I'll obtain a ray which carries a radiance of <span class="math-container">$2.533 \frac{W}{sr \cdot m^2}$</span>.  How is the fact that less total energy (and thus less &quot;illumination&quot;) makes it to the further away spot, accounted for in this process?</p>
<p>My first thought would be to account for the angular size of the light.  That is to say, for a point <span class="math-container">$100m$</span> away (<span class="math-container">$d$</span>) I can calculate the solid angle subtended by the light with respect to the point I'm evaluating using:</p>
<p><span class="math-container">\begin{align}
\Omega &amp;= 2\pi\left(1 - \frac{\sqrt{d^2 - R^2}}{d}\right)\\
&amp;= 3.1417\times10^{-4} \ sr
\end{align}</span></p>
<p>I can use this to get the irradiance by multiplying this solid angle by the previously calculated radiance, I get:</p>
<p><span class="math-container">\begin{aligned}
E_e &amp;= \Omega\cdot L_{e,\Omega}\\
&amp;= (3.1417\times10^-4 \ sr) \cdot (2.533 \frac{W}{sr \cdot m^2})\\
&amp;= 7.9579\times 10^{-4} \frac{W}{m^2}
\end{aligned}</span></p>
<p>This matches with the irradiance you'd calculate from a point light with a radiant power of <span class="math-container">$100W$</span>, so it appears as if all has been calculated correctly.</p>
<p>But that quantity is irradiance, with units of <span class="math-container">$\frac{W}{m^2}$</span>.  And without multiplying by this solid angle, the radiance remains constant regardless of the distance to the light source.  So how exactly does a path tracer accurately simulate light falloff, if it only tracks the radiance along the whole path?</p>
<p>Looking at <a href="https://www.pbr-book.org/3ed-2018/Light_Transport_I_Surface_Reflection/Sampling_Light_Sources" rel="nofollow noreferrer">PBR's section of Sampling Light Sources</a> still leaves me confused.  Part of it states:</p>
<blockquote>
<p>The Light’s <code>Pdf_Li()</code> method returns the probability density with respect to solid angle for the light’s <code>Sample_Li()</code> method to sample the direction <code>wi</code> from the reference point ref.</p>
</blockquote>
<p><strong>This feels similar in spirit to what I have done.  As the light is further away, it subtends a much smaller solid angle, and so conceivably you'd weight its radiance contribution less (as the further away the light gets, the less likely it is you'd intersect the light).  But I'm struggling to see how this weighting process is different than simply multiplying the radiance by the solid angle subtended by the light, which would yield <em>irradiance</em>, thus breaking the whole path tracing concept of summing radiance along a path.  And why do we even need to weight the ray this way?  If a light is visible to a point, the radiance from that light is landing on the point.  So I'm not following how to properly compute this kind of direction illumination</strong></p>
<p><a href="https://i.sstatic.net/ppz3q.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/ppz3q.jpg" alt="Light Falloff Example" /></a></p>

<rendering><pathtracing><lighting><sampling><importance-sampling>
How does a path tracer capture light falloff if it deals exclusively with radiance?
Chris Gnam
# How does a path tracer capture light falloff if it deals exclusively with radiance?

(Asked by: username_0 on 2024-02-15)

My understanding is that path tracers deal with radiance because radiance is constant along a ray. You simply go through and evaluate the light transport equation:

$$
L\_o(p, \omega\_o) = L\_e(p,\omega\_o) + \int\_S f(p,\omega\_o,\omega\_i)L\_i(p,\omega\_i) | \cos{\theta\_i}| \ d\omega\_i
$$

with the goal of tracing a path through the scene and calculating the total radiance contributed to that path. My confusion comes from the following:

Say I have a spherical light, that has a radius of $1m$, and has a total radiant power of $100W$. Assuming the light is isotropic, I can calculate the radiant exitance from this light by dividing the total radiant power, by its surface area, giving:

$$
M\_e = \frac{100 W}{4\pi(1m)^2} = 7.9577 \frac{W}{m^2}
$$

Using the following relations:

\begin{align}
M\_e &= \frac{\partial \Phi\_e}{\partial A} \\
L\_{e,\Omega} &= \frac{\partial^2 \Phi\_e}{\partial\Omega \partial (A\cos{\theta})}\\
\end{align}

I can calculate the emitted radiance from its surface by the following:

\begin{align}
L\_{e,\Omega} &= \frac{\partial M\_e}{\partial \Omega} \frac{1}{\cos{\theta}}\\
\int\_SL\_{e,\Omega} \cos{\theta} \ d\Omega &= M\_e\\
\int\_0^{2\pi}\int\_0^{\pi/2} L\_{e,\Omega}\cos{\theta}\sin{\theta} \ d\theta \ d\phi &= M\_e\\
L\_{e,\Omega} \pi &= M\_e\\
L\_{e,\Omega} &= \frac{M\_e}{\pi}\\
\boxed{L\_{e,\Omega} = 2.533 \frac{W}{sr \cdot m^2}}
\end{align}

Now if I cast two rays into the scene, one which lands 100m from the light, and the other which lands 10m from the light, they should be illuminated very differently. Yet, when I sample the light source, I'll obtain a ray which carries a radiance of $2.533 \frac{W}{sr \cdot m^2}$. How is the fact that less total energy (and thus less "illumination") makes it to the further away spot, accounted for in this process?

My first thought would be to account for the angular size of the light. That is to say, for a point $100m$ away ($d$) I can calculate the solid angle subtended by the light with respect to the point I'm evaluating using:

\begin{align}
\Omega &= 2\pi\left(1 - \frac{\sqrt{d^2 - R^2}}{d}\right)\\
&= 3.1417\times10^{-4} \ sr
\end{align}

I can use this to get the irradiance by multiplying this solid angle by the previously calculated radiance, I get:

\begin{aligned}
E\_e &= \Omega\cdot L\_{e,\Omega}\\
&= (3.1417\times10^-4 \ sr) \cdot (2.533 \frac{W}{sr \cdot m^2})\\
&= 7.9579\times 10^{-4} \frac{W}{m^2}
\end{aligned}

This matches with the irradiance you'd calculate from a point light with a radiant power of $100W$, so it appears as if all has been calculated correctly.

But that quantity is irradiance, with units of $\frac{W}{m^2}$. And without multiplying by this solid angle, the radiance remains constant regardless of the distance to the light source. So how exactly does a path tracer accurately simulate light falloff, if it only tracks the radiance along the whole path?

Looking at [PBR's section of Sampling Light Sources](https://www.pbr-book.org/3ed-2018/Light_Transport_I_Surface_Reflection/Sampling_Light_Sources) still leaves me confused. Part of it states:

> The Light’s `Pdf_Li()` method returns the probability density with respect to solid angle for the light’s `Sample_Li()` method to sample the direction `wi` from the reference point ref.

**This feels similar in spirit to what I have done. As the light is further away, it subtends a much smaller solid angle, and so conceivably you'd weight its radiance contribution less (as the further away the light gets, the less likely it is you'd intersect the light). But I'm struggling to see how this weighting process is different than simply multiplying the radiance by the solid angle subtended by the light, which would yield *irradiance*, thus breaking the whole path tracing concept of summing radiance along a path. And why do we even need to weight the ray this way? If a light is visible to a point, the radiance from that light is landing on the point. So I'm not following how to properly compute this kind of direction illumination**

[![Light Falloff Example](https://i.sstatic.net/ppz3q.jpg)](https://i.sstatic.net/ppz3q.jpg)

**Tags:** rendering, pathtracing, lighting, sampling, importance-sampling


---

## 1 answers

### Answer by username_1 on 2024-02-16. Score: 2 | Accepted answer

The inverse square law does not apply to radiance. We can compute irradiance as \begin{align}
E(x, \Omega) &= \int\_{\Omega} L\_i(x, \omega\_i) \underbrace{\cos\theta\_x}\_{N\_x \cdot \omega\_i} \, dA(\omega\_i) \\
&= \int\_{\Omega} L\_o(\underbrace{r(x,\omega\_i)}\_{y}, \underbrace{-\omega\_i}\_{y\to x}) \cos\theta\_x \, dA(\omega\_i) \\
&= \int\_{\Omega} L\_o(y, y\to x) \cos\theta\_x dA(\omega\_i) \\
&= \int\_{\Omega\_M} L\_o(y, y\to x) \cos\theta\_x \underbrace{\cos\theta\_y}\_{N\_y \cdot (y\to x)} \frac{1}{\|y-x\|^2\_2} \, dA(\underbrace{y}\_{r(x, \omega\_i)}) \\
&= \int\_{M} L\_o(z, z\to x) \frac{\cos\theta\_x \cos\theta\_z}{\|z-x\|^2\_2}V(x,z) \, dA(z) \\
&= \int\_M L\_o(z, z\to x) G(x,z) \,dA(z).
\end{align}

Here $\Omega$ is some subset of the hemisphere at $x$ around the normal $N\_x$. The term $L\_i(x, \omega\_i)$ is incident radiance at $x$ from direction $\omega\_i$ (this direction points outwards from $x$). The $dA(\omega\_i)$ is the differential area element on this hemisphere. In vacuum the incident radiance at $x$ along $\omega\_i$ is equal to the outgoing radiance from $y=r(x, \omega\_i)$ along $-\omega\_i$, where $r(x, \omega\_i)$ is the ray-tracing function and returns the first intersection $y$ along the ray from $x$ in direction $\omega\_i$. The $\cos\theta\_x$ is due to Lambert's law. In line four I have done a change of variables $y=r(x, \omega\_i)$ - so now I integrate over the projection of $\Omega$ onto the scene surfaces: $\Omega\_M=\{r(x, \omega\_i) \in M \, : \, \omega\_i \in \Omega\}$. This change of variables is accounted for by the factors $\cos\theta\_y$ and $\|y - x\|^{-2}\_2$. The $\cos\theta\_y$ accounts for how slanted a small area around $y$ is wrt $\omega\_i$, and $\|y-x\|^{-2}\_2$ accounts for the fact that further away objects subtend a smaller solid angle. The step before last is just rewriting the integral over all scene points $M$ instead of just $\Omega\_M$, by introducing a visibility function $V(x,z)$ which is one if $r(x, x\to z) = z$, and zero otherwise. That is what is typically termed the area formulation.

As you can see, the inverse square distance term arises from parametrising integration over points as opposed to directions. But the two integrals are equal, so in theory it doesn't matter which you use (in practice you use the area formulation for light sampling). There's no issue that this isn't part of radiance, since radiance does not fall off quadratically.

There is no issue in a path tracer either as it is estimating integrals that either implicitly (solid angle formulation) or explicitly (area formulation) include the quadratic falloff term.

> **Comments:**
> **username_0**: I know the inverse square law does not apply to radiance, but I'm still confused as to how light falloff is captured. When I trace a ray from the camera to some point $x$, if that point $x$ is exposed to a light emitting radiance $L_o$, then (in vacuum) it doesn't matter how far $x$ is from the light, it will still always receive $L_o$. How do points further away from the light render as if they are darker, if they receive the same radiance?  I brought irradiance into this only because in that context, it makes sense to me why they'd appear darker.  But dealing purely with radiance, I am lost.  
> **username_1**: @username_0 When you trace a ray from the camera to a point $x$, in order to tell how much light is scattered back to the camera you need to compute an integral. If the light source is further away the subtended solid angle is smaller, then the integral is non-zero over a solid angle that scales inversely quadratically with distance. Alternatively you could rewrite it as an integral over the surface of the light source, and then the inverse squared distance term becomes explicit as I noted.  
> **username_0**: I follow the intuition of that, however if I take the radiance (units of $W/(sr \cdot m^2)$), by the solid angle subtended by the light source, I'd end up with a value with units of $W/m^2$, which is irradiance, no?  I think I'm getting tripped up on units and should probably just try to actually work out a simple example by hand to better grasp this  
> **username_1**: @username_0 The rendering equation is: $$L_o = Le + \int_{\Omega} f L_i \cos\theta_i d\omega_i$$ Here $L_o$ is outgoing radiance, $L_e$ is emitted radiance, the integral is taken over solid angle so it would get rid of one $sr^{-1}$, but the brdf has units $sr^{-1}$ and the incident radiance has units $W m^{-2} sr^{-1}$, so you still get the correct units.  

---

