<p>The first is a definition of radiance in terms of the flux - it's a the derivative of flux with respect to both area and direction. It's simply a relation between <span class="math-container">$\Phi$</span> and <span class="math-container">$L$</span>. It simply says that if you integrate radiance over the area of some surface, and for each point you integrate over all possible directions, then you will get the flux arriving/leaving that surface.
The second part comes from the restriction of the rendering equation to a single point light source.
Remember that:
<span class="math-container">$$L(x,\omega_o) = L_e(x,\omega_o) + \int_{\Omega}{f(\omega_o,x,\omega_i)L_i(x,\omega_i)\cos\theta_i \,d\omega_i}$$</span>
Where <span class="math-container">$x$</span> is a point on some surface, and <span class="math-container">$L(x,\omega_o)$</span> gives you the radiance incoming from <span class="math-container">$x$</span> in the direction <span class="math-container">$\omega_o$</span>. This radiance is the sum of emitted radiance from <span class="math-container">$x$</span> in direction <span class="math-container">$\omega_o$</span>: <span class="math-container">$L_e(x,\omega_o)$</span>, and the scattered radiance by <span class="math-container">$x$</span> in direction <span class="math-container">$\omega_o$</span>. The integral is necessary, since light may arrive from any direction at <span class="math-container">$x$</span>, so you need to integrate over all directions. <span class="math-container">$f$</span> is the brdf, which really tells you how much of the light arriving from direction <span class="math-container">$\omega_i$</span> is reflected towards <span class="math-container">$\omega_o$</span> at <span class="math-container">$x$</span>. <span class="math-container">$L_i(x,\omega_i)$</span> is the incoming radiance from direction <span class="math-container">$\omega_i$</span> at <span class="math-container">$x$</span>, and the cosine is there to account for Lambert's law. What happens when you evaluate only direct lighting from a point light is that the integral is over a domain that is a single point, so you get only the integrand part, which you have in your code. Note that this is just an intuitive explanation, there are various issues with radiance not being defined for point lights.</p>

CC BY-SA 4.0
2019-04-09T15:12:57.577Z
2019-04-09T15:12:57.577Z
lightxbulb
<p>Background: I'm reading <a href="https://learnopengl.com/PBR" rel="nofollow noreferrer">https://learnopengl.com/PBR</a> to learn about PBR. In the theory slide (<a href="https://learnopengl.com/PBR/Theory" rel="nofollow noreferrer">https://learnopengl.com/PBR/Theory</a>), the author has the reflectant equation as</p>

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

<p>The theta (the angle between normal vector and the incoming light) is in the denominator. However, on the lighting slide (<a href="https://learnopengl.com/PBR/Lighting" rel="nofollow noreferrer">https://learnopengl.com/PBR/Lighting</a>) he has the familiar code for the radiance of a light source, which makes the <span class="math-container">$\cos(\theta)$</span> on the numerator.</p>

<pre><code>vec3  lightColor  = vec3(23.47, 21.31, 20.79);
vec3  wi          = normalize(lightPos - fragPos);
float cosTheta    = max(dot(N, Wi), 0.0);
float attenuation = calculateAttenuation(fragPos, lightPos);
float radiance    = lightColor * attenuation * cosTheta;
</code></pre>

<p>Can someone explain this fine point to me?</p>

<opengl><lighting><pbr>
Why is cos() in the denominator in the reflectance equation and in the numerator in the shading equation?
Harry Kane
# Why is cos() in the denominator in the reflectance equation and in the numerator in the shading equation?

(Asked by: username_0 on 2019-04-09)

Background: I'm reading <https://learnopengl.com/PBR> to learn about PBR. In the theory slide (<https://learnopengl.com/PBR/Theory>), the author has the reflectant equation as

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

The theta (the angle between normal vector and the incoming light) is in the denominator. However, on the lighting slide (<https://learnopengl.com/PBR/Lighting>) he has the familiar code for the radiance of a light source, which makes the $\cos(\theta)$ on the numerator.

```
vec3  lightColor  = vec3(23.47, 21.31, 20.79);
vec3  wi          = normalize(lightPos - fragPos);
float cosTheta    = max(dot(N, Wi), 0.0);
float attenuation = calculateAttenuation(fragPos, lightPos);
float radiance    = lightColor * attenuation * cosTheta;

```

Can someone explain this fine point to me?

**Tags:** opengl, lighting, pbr


---

## 1 answers

### Answer by username_1 on 2019-04-09. Score: 1

The first is a definition of radiance in terms of the flux - it's a the derivative of flux with respect to both area and direction. It's simply a relation between $\Phi$ and $L$. It simply says that if you integrate radiance over the area of some surface, and for each point you integrate over all possible directions, then you will get the flux arriving/leaving that surface.
The second part comes from the restriction of the rendering equation to a single point light source.
Remember that:
$$L(x,\omega\_o) = L\_e(x,\omega\_o) + \int\_{\Omega}{f(\omega\_o,x,\omega\_i)L\_i(x,\omega\_i)\cos\theta\_i \,d\omega\_i}$$
Where $x$ is a point on some surface, and $L(x,\omega\_o)$ gives you the radiance incoming from $x$ in the direction $\omega\_o$. This radiance is the sum of emitted radiance from $x$ in direction $\omega\_o$: $L\_e(x,\omega\_o)$, and the scattered radiance by $x$ in direction $\omega\_o$. The integral is necessary, since light may arrive from any direction at $x$, so you need to integrate over all directions. $f$ is the brdf, which really tells you how much of the light arriving from direction $\omega\_i$ is reflected towards $\omega\_o$ at $x$. $L\_i(x,\omega\_i)$ is the incoming radiance from direction $\omega\_i$ at $x$, and the cosine is there to account for Lambert's law. What happens when you evaluate only direct lighting from a point light is that the integral is over a domain that is a single point, so you get only the integrand part, which you have in your code. Note that this is just an intuitive explanation, there are various issues with radiance not being defined for point lights.


---

