<p>While browsing to properly write my question, I actually <a href="https://seblagarde.wordpress.com/2011/08/17/hello-world/#comment-2405">found the answer</a>, which happens to be very simple.</p>

<p>Another Fresnel term is also going to weight in as the photons make their way out of the material (so being refracted into the air) and become the diffuse term. Thus the correct factor for the diffuse term would be:</p>

<p>$$(1 - F_{in}) * (1 - F_{out})$$</p>

CC BY-SA 3.0
2017-03-03T23:02:17.397Z
The [Disney BRDF paper](https://disney-animation.s3.amazonaws.com/library/s2012_pbs_disney_brdf_notes_v2.pdf) section 5.3 refers to the equation in your answer and then goes on to specify a different model. I don't claim to understand any of it as I've just started my glossy BRDF implementation!
PeteUK
CC BY-SA 4.0
2018-08-30T21:39:45.700Z
I reckon this would continue from here, where the light that is reflected back internally would then hit the surface again from the inside, on the opposite side, and then again, and again, each time diminishing, onto infinity :P (or into sub surface scattering hehe)
Alan Wolfe
CC BY-SA 4.0
2019-09-26T09:26:54.180Z
How do you calculate the another Fresnel term?
plasmacel
CC BY-SA 3.0
2016-04-08T05:19:06.857Z
2016-04-08T05:19:06.857Z
Julien Guertault
<p>Using two Fresnel terms is correct in the sense that any given diffuse path will pass through the surface twice. If you're solving diffusion by tracing a path through the medium until it bounces out again then that you will get two (or more) Fresnel terms for that path as it interacts with the surface.</p>

<p>However, that's not what you're doing with a diffuse BRDF. A diffuse BRDF is intended to represent the average of all those possible diffusion paths. In the case of an Lambertian that average is modeled as uniform reflection and a single albedo value measuring the internal energy loss during diffusion, but more complicated models are possible. Crucially: a diffuse BRDF will already include the aggregate effect of some paths being reflected back into the medium to diffuse further and some passing out immediately. $1 - F_{out}$ is already "baked in" to the BRDF¹ and you do not need factor it in again.</p>

<p>What the Lambertian term does not include is the portion of energy that is lost by being reflected before light enters the medium of diffusion. This is view-dependent, but depends on the precise glossy lobe above it. There is no energy loss at a (non-metallic) surface interface so everything that isn't reflected will be refracted, meaning that what you actually want is to integrate the total energy loss at the surface over all outgoing directions, i.e. $1 - \int \texttt{glossy_bsdf}(\texttt{in}, \texttt{out}) \: \mathrm{d} \texttt{out}$.</p>

<p>It's possible to pre-compute approximations to that integral for specific BRDFs. The end result will in general depend on view direction, material roughness and IOR at least. As a first approximation you can assume that the glossy lobe is a perfectly specular reflector. That gives a weighting of $1 - \int \texttt{glossy} \: \mathrm{d}\texttt{out} = 1 - F_{in}$, which is exactly what you first suggested.</p>

<p>Additionally, note that the Lambertian BRDF is the albedo divided by $\pi$ and that the cosine term is a measure of how attenuated the incoming light is on the surface; it applies to both glossy and diffuse reflectance.</p>

<p>So, roughly:</p>

<pre><code>// Assuming for example:
//   diffuse = albedo / PI;
//   specular = my_favorite_glossy_brdf(in_dir, out_dir, roughness);
//   fresnel = f0 + (1.0 - f0) * pow(1.0 - dot(E, H), 5.0);
//   total_surface_reflection = fresnel
color = lightIntensity * dot(L, N) * Lerp(diffuse, specular, total_surface_reflection);
</code></pre>

<p>¹ <em>Really the integral of $F$ over all possible incident internal diffusion exit paths that result in your out direction, but I digress.</em></p>

CC BY-SA 3.0
2016-04-08T11:41:51.023Z
2016-04-11T20:25:29.450Z
2016-04-11T20:25:29.450Z
Karl Schmidt
<p>As far as I understand, in a BRDF the Fresnel term is telling us the probability for a photon to be reflected or refracted when it hits a surface.</p>

<p>The reflected photons will contribute to the specular term, while the refracted ones will contribute to the diffuse term. Therefore when determining, in a physically based manner, the contribution of a light to the color of material, I feel tempted to just write:</p>

<pre><code>// Assuming for example:
//   diffuse = dot(L, N);
//   specular = pow(dot(H, N), alpha) * (alpha + 2.0) / 8.0;
//   fresnel = f0 + (1.0 - f0) * pow(1.0 - dot(E, H), 5.0);
color = lightIntensity * Lerp(diffuse * albedo, specular, fresnel);
</code></pre>

<p>Yet, I don't think I've ever seen it written this way. I have seen the specular term being weighted according to the Fresnel term, but not the diffuse one. In his largely referenced <a href="https://seblagarde.wordpress.com/2011/08/17/hello-world/">article on PBR</a>, Sébastien Lagarde even states that using $(1 - F)$ to weight the diffuse term is incorrect.</p>

<p>What am I missing?<br/>
I would much welcome an explanation that highlights in an obvious manner why this would be incorrect.</p>

<brdf><specular><pbr><diffuse><fresnel>
How to properly combine the diffuse and specular terms?
Julien Guertault
# How to properly combine the diffuse and specular terms?

(Asked by: username_0 on 2016-04-08)

As far as I understand, in a BRDF the Fresnel term is telling us the probability for a photon to be reflected or refracted when it hits a surface.

The reflected photons will contribute to the specular term, while the refracted ones will contribute to the diffuse term. Therefore when determining, in a physically based manner, the contribution of a light to the color of material, I feel tempted to just write:

```
// Assuming for example:
//   diffuse = dot(L, N);
//   specular = pow(dot(H, N), alpha) * (alpha + 2.0) / 8.0;
//   fresnel = f0 + (1.0 - f0) * pow(1.0 - dot(E, H), 5.0);
color = lightIntensity * Lerp(diffuse * albedo, specular, fresnel);

```

Yet, I don't think I've ever seen it written this way. I have seen the specular term being weighted according to the Fresnel term, but not the diffuse one. In his largely referenced [article on PBR](https://seblagarde.wordpress.com/2011/08/17/hello-world/), Sébastien Lagarde even states that using $(1 - F)$ to weight the diffuse term is incorrect.

What am I missing?  
I would much welcome an explanation that highlights in an obvious manner why this would be incorrect.

**Tags:** brdf, specular, pbr, diffuse, fresnel


---

## 2 answers

### Answer by username_4 on 2016-04-08. Score: 14 | Accepted answer

Using two Fresnel terms is correct in the sense that any given diffuse path will pass through the surface twice. If you're solving diffusion by tracing a path through the medium until it bounces out again then that you will get two (or more) Fresnel terms for that path as it interacts with the surface.

However, that's not what you're doing with a diffuse BRDF. A diffuse BRDF is intended to represent the average of all those possible diffusion paths. In the case of an Lambertian that average is modeled as uniform reflection and a single albedo value measuring the internal energy loss during diffusion, but more complicated models are possible. Crucially: a diffuse BRDF will already include the aggregate effect of some paths being reflected back into the medium to diffuse further and some passing out immediately. $1 - F\_{out}$ is already "baked in" to the BRDF¹ and you do not need factor it in again.

What the Lambertian term does not include is the portion of energy that is lost by being reflected before light enters the medium of diffusion. This is view-dependent, but depends on the precise glossy lobe above it. There is no energy loss at a (non-metallic) surface interface so everything that isn't reflected will be refracted, meaning that what you actually want is to integrate the total energy loss at the surface over all outgoing directions, i.e. $1 - \int \texttt{glossy\_bsdf}(\texttt{in}, \texttt{out}) \: \mathrm{d} \texttt{out}$.

It's possible to pre-compute approximations to that integral for specific BRDFs. The end result will in general depend on view direction, material roughness and IOR at least. As a first approximation you can assume that the glossy lobe is a perfectly specular reflector. That gives a weighting of $1 - \int \texttt{glossy} \: \mathrm{d}\texttt{out} = 1 - F\_{in}$, which is exactly what you first suggested.

Additionally, note that the Lambertian BRDF is the albedo divided by $\pi$ and that the cosine term is a measure of how attenuated the incoming light is on the surface; it applies to both glossy and diffuse reflectance.

So, roughly:

```
// Assuming for example:
//   diffuse = albedo / PI;
//   specular = my_favorite_glossy_brdf(in_dir, out_dir, roughness);
//   fresnel = f0 + (1.0 - f0) * pow(1.0 - dot(E, H), 5.0);
//   total_surface_reflection = fresnel
color = lightIntensity * dot(L, N) * Lerp(diffuse, specular, total_surface_reflection);

```

¹ *Really the integral of $F$ over all possible incident internal diffusion exit paths that result in your out direction, but I digress.*


---

### Answer by username_0 on 2016-04-08. Score: 8

While browsing to properly write my question, I actually [found the answer](https://seblagarde.wordpress.com/2011/08/17/hello-world/#comment-2405), which happens to be very simple.

Another Fresnel term is also going to weight in as the photons make their way out of the material (so being refracted into the air) and become the diffuse term. Thus the correct factor for the diffuse term would be:

$$(1 - F\_{in}) \* (1 - F\_{out})$$

> **Comments:**
> **username_1**: The [Disney BRDF paper](https://disney-animation.s3.amazonaws.com/library/s2012_pbs_disney_brdf_notes_v2.pdf) section 5.3 refers to the equation in your answer and then goes on to specify a different model. I don't claim to understand any of it as I've just started my glossy BRDF implementation!  
> **username_2**: I reckon this would continue from here, where the light that is reflected back internally would then hit the surface again from the inside, on the opposite side, and then again, and again, each time diminishing, onto infinity :P (or into sub surface scattering hehe)  
> **username_3**: How do you calculate the another Fresnel term?  

---

