<p><strong>Yes, throughput doesn't have to be in range [0, 1].</strong> That's a reason why you have to use exposure settings, because for differente accumulation time, brightness of an image might differ. Nathan Reed described it in details here - <a href="https://computergraphics.stackexchange.com/a/10244/10129">https://computergraphics.stackexchange.com/a/10244/10129</a></p>
<p>Your final results and number of fireflies and bright surfaces, depends on PDF that you'll be using. By using Normal Distribution Function PDF, you'll get good results, because NDF is the most determining factor of BRDF shape. Relate to this blog post for details - <a href="https://schuttejoe.github.io/post/ggximportancesamplingpart1/" rel="nofollow noreferrer">https://schuttejoe.github.io/post/ggximportancesamplingpart1/</a></p>
<hr />
<p>Back to throughput range. Assuming that you're sampling based on NDF, you'll get fireflies in case of having values in specific range, when light source is shining from very low angle and you're looking directly at the object. Therefore, your denominator might be much greater than nominator and result in small PDF causing fireflies:</p>
<p><span class="math-container">$$
p_i(w_m, w_o) = \frac{D(w_m)(w_g \cdot w_i)}{4|w_g \cdot w_m|}
$$</span></p>
<p><a href="https://i.sstatic.net/gg4J4.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/gg4J4.png" alt="enter image description here" /></a></p>
<p>Since 2014, Heitz was working on BSDFs, presenting good results in same year by sampling visible normals [2]. In 2017, he published much simpler, faster and better paper, improving his method [3]. There are also 2015 and 2016 papers in related field, but I haven't read them, but it might be beneficial if you're interested in BSDF. I would recommend checking his first 2014's work (1) where he explains physical assumption on which BRDF is based. It's worth knowing, what NDF and Geometry Shadowing exactly means in BRDF.</p>
<p>Also, there is a lot of good reading in pbrt book, especially:</p>
<ul>
<li><a href="http://www.pbr-book.org/3ed-2018/Light_Transport_I_Surface_Reflection/Sampling_Reflection_Functions.html#MicrofacetBxDFs" rel="nofollow noreferrer">http://www.pbr-book.org/3ed-2018/Light_Transport_I_Surface_Reflection/Sampling_Reflection_Functions.html#MicrofacetBxDFs</a></li>
<li><a href="http://www.pbr-book.org/3ed-2018/Light_Transport_I_Surface_Reflection/Path_Tracing.html" rel="nofollow noreferrer">http://www.pbr-book.org/3ed-2018/Light_Transport_I_Surface_Reflection/Path_Tracing.html</a></li>
<li><a href="http://www.pbr-book.org/3ed-2018/Monte_Carlo_Integration/Importance_Sampling.html" rel="nofollow noreferrer">http://www.pbr-book.org/3ed-2018/Monte_Carlo_Integration/Importance_Sampling.html</a></li>
<li>For more advanced method, I think it'd be worth reading about Russian Roulette and more efficient Path Tracing algorithms like Bidirectional Path Tracing, Metropolis Light Tracing and Photon Mapping methods</li>
</ul>
<hr />
<p>(1) Eric Heitz - Understanding the Masking-Shadowing Functionin Microfacet-Based BRDFs <a href="http://jcgt.org/published/0003/02/03/paper.pdf" rel="nofollow noreferrer">http://jcgt.org/published/0003/02/03/paper.pdf</a></p>
<p>(2) Eric Heitz, Eugene d’Eon - Importance Sampling Microfacet-Based BSDFs using the Distribution of Visible Normals <a href="https://hal.inria.fr/hal-00996995v1/document" rel="nofollow noreferrer">https://hal.inria.fr/hal-00996995v1/document</a></p>
<p>(3) Eric Heitz - A Simpler and Exact Sampling Routine for the GGXDistribution of Visible Normals <a href="https://hal.archives-ouvertes.fr/hal-01509746/document" rel="nofollow noreferrer">https://hal.archives-ouvertes.fr/hal-01509746/document</a></p>

CC BY-SA 4.0
2020-10-08T08:26:56.167Z
2020-10-08T08:38:55.080Z
2020-10-08T08:38:55.080Z
DirectX_Programmer
<p>I have a similar question currently posted, so take the following with a grain of salt.</p>

<p>Throughput does not need to be smaller than 1. BRDF only needs to be non negative and to integrate to less than 1 (conservation of energy / albedo) over the hemisphere. It can be arbitrarily large - e.g. in the case of a mirror. </p>

<p>The pdf should approximate the BRDF to reduce variance. However, unless it is always larger than the BRDF, the throughput will be larger than 1 and should be able to reach infinity.</p>

<p><em>BRDF in your case corresponds to material->Eval(wi, wo, normal) / dot(normal, wi)</em></p>

CC BY-SA 4.0
2020-05-07T09:37:18.160Z
`BRDF in your case corresponds to material->Eval(wi, wo, normal) / dot(normal, wi)` why?
lightxbulb
CC BY-SA 4.0
2020-05-08T10:59:33.873Z
@lightxbulb,  that is more or less the definition of Brdf. E.g. a Diffuse brdf is a constant, non negative,  (obviously)reciprocal function. Using the functions of the OPs referenced question, that's what it would look like. People have a tendency to fold terms together to avoid repeated computation, which is confusing to beginners trying to understand path tracing from the underlying physics.
arctiq
CC BY-SA 4.0
2020-05-08T11:33:31.070Z
Where did the dot pop out from?
lightxbulb
CC BY-SA 4.0
2020-05-08T12:59:50.140Z
@lightxbulb, in the definition of BRDF, there is a "normalizing" (normal direction) term $1 / \cos \theta_i$, which is the angle between the normal and the incomming $w_i$. When $n$ and $w_i$ have unit length, the $\cos \theta_i = \ w_i \cdot normal$, because $a \cdot b \equiv |a| \times |b| \times \cos \theta$, where $\theta$ is the angle between $a$ and $b$. Makes sence?
arctiq
CC BY-SA 4.0
2020-05-08T14:13:25.977Z
Can you link the definition of BRDF that you are citing?
lightxbulb
CC BY-SA 4.0
2020-05-08T15:54:27.037Z
@lightxbulb, hmm, depends on what you need. There is nothing wrong with the definition on [wikipedia](https://en.wikipedia.org/wiki/Bidirectional_reflectance_distribution_function), but if you want context too, maybe try [Ray Tracing in One Weekend](https://raytracing.github.io/) (specifically the 3rd book, I think, goes into some detail), or the popular [Physically Based Rendering:
From Theory To Implementation](http://www.pbr-book.org/), both of which are online, free, and contain source code too.
arctiq
CC BY-SA 4.0
2020-05-08T16:14:40.220Z
Seems you are confusing what your function is defined as formally, and what you have in practice. You do not have the analytical form of the $dL_r$ or $L_i$ in practice, so the `eval/dot` makes no sense. Instead you define some function (which describes your material) that fulfills the 3 required properties. There is no cosine division requirement. In fact the simplest BRDF - Lambertian, is just a constant function that is in $[0,\frac{1}{\pi}]$. I would suggest just deleting your answer, as it is  mostly wrong: e.g. the BRDF thing, the BRDF reaching inifnity for mirrors.
lightxbulb
CC BY-SA 4.0
2020-05-08T16:41:27.797Z
I have told you what the function is, and why the division is there (because it is folded into eval in OPs referenced question). I have also told you that a lambertian diffuse is a constant function. The fact that BRDF is infinite for perfectly specular reflections has been answered [here](https://computergraphics.stackexchange.com/questions/4767/why-the-brdf-of-specular-reflection-is-infinite-in-the-reflection-direction).
arctiq
CC BY-SA 4.0
2020-05-08T17:53:13.433Z
And I am telling you that you are wrong - for the cosine division entirely, for the infinity thing: depending on how informal you want to get. The BRDF for mirrors is not "infinite" - it is a Dirac delta. You're not plugging infinity into your tracer upon implementation due to that reason - instead you're getting rid of the integral due to the main property of the Dirac delta. While it may  be easier to explain it to readers without mathematical background as being "infinite" (which is why I assume the authors of AGI did it), that doesn't change the fact that it is a wrong explanation.
lightxbulb
CC BY-SA 4.0
2020-05-08T17:57:49.937Z
In your "example" `material->Eval(wi, wo, normal) / dot(normal, wi)` material->Eval(wi,wo,normal) should by all means be the BRDF, and there is no cosine factor required in the numerator. In no BRDF is such a factor required - only if you want to model a material that has a behaviour $\propto \frac{1}{\cos\theta}$ will you introduce such a factor in the BRDF. I suggest reading up on measure theory if you want to understand in depth where your misunderstanding came from.
lightxbulb
CC BY-SA 4.0
2020-05-08T21:30:04.927Z
@lightxbulb, there is no cosine division. Focus on the lambertian diffuse, a constant function, $f_r = \rho / \pi$, where do you see a cosine division?
arctiq
CC BY-SA 4.0
2020-05-08T21:47:15.467Z
That's exactly what I have been trying to explain to you - see what you wrote: `material->Eval(wi, wo, normal) / dot(normal, wi)`, `in the definition of BRDF, there is a "normalizing" (normal direction) term $1/\cos\theta_i$`.
The above simply do not hold in the general case.
lightxbulb
CC BY-SA 4.0
2020-05-08T23:25:50.673Z
@lightxbulb, oh I see, that's my mistake, that is very confusing. The reason for $/ \cos$ in my answer, is to cancel out $* cos$ in `eval`, because only the constant part of `eval` is the Lambertian BRDF (despite eval being called brdf by the author). The reason why it is usualy folded together is to avoid repeated computation. The place it came from is the rendering equation, and the reason why it's _there_ is to cancel out the normalizing $\cos$ from the definition of BRDF.
arctiq
CC BY-SA 4.0
2020-05-09T04:30:22.713Z
You're not supposed to cancel out the cosine in the rendering equation. The only reason I can think of why you would have the division is from the probability density function.
lightxbulb
CC BY-SA 4.0
2020-05-09T13:48:53.823Z
@lightxbulb, no. The cos is the attenuation due to angle... This is ridiculous. It is not helping anyone. Lambertian diffuse being equal to `material->Eval(wi, wo, n) / dot(n, wi)` or $f_r = \rho / \pi$ (a constant function) is a fact. BRDF not being upper-bounded is a fact.
PLEASE...
arctiq
CC BY-SA 4.0
2020-05-09T15:02:25.700Z
The attenuation due to angle (Lambert's cosine law) doesn't show up in the denominator of arbitrary BRDFs, it shows up in the rendering equation as a factor not part of the BRDF. I already explained that Lambertian diffuse is constant - no cosine division required. Neither did I argue that the BRDF needs to be bounded from above - however, that does not mean that the mirror BRDF is infinity - it is a Dirac delta.
lightxbulb
CC BY-SA 4.0
2020-05-09T16:09:51.447Z
I finally got why you are saying this - I apologize. Seems like in that code they stuck in the cosine into eval for some reason, which confused me. I thought you were dividing the brdf itself by cosine for some reason (but you clarified it was not in the answer before your last). Please do remove the infinity thing about the mirror though - a Dirac delta has very specific properties - it's not just an "infinity". I can give you a brdf that is infinity over sets of measure zero though, and it will not matter.
lightxbulb
CC BY-SA 4.0
2019-12-08T20:18:25.643Z
2020-05-09T20:00:46.437Z
2020-05-09T20:00:46.437Z
arctiq
<p>In the accepted answer for the question <a href="https://computergraphics.stackexchange.com/questions/4979/what-is-importance-sampling">What is Importance Sampling?</a>, in the example code there is this line:</p>

<pre><code>// Accumulate the brdf attenuation
throughput = throughput * material-&gt;Eval(wi, wo, normal) / pdf;
</code></pre>

<p>If the PDF is between 0.0 and 1.0, the division will potentially increase the throughput. I do not think it makes sense. What am I missing?</p>

CC BY-SA 4.0
2019-12-09T09:06:39.410Z
Why do you think it should  always decrease?
gallickgunner
CC BY-SA 4.0
2019-12-09T09:08:35.177Z
I don't know, it was just intuition. I don't think I really understand what it is suppose to represent
dblouis
<pathtracing><brdf>
Should ray throughput always decrease when bouncing?
dblouis
# Should ray throughput always decrease when bouncing?

(Asked by: username_0 on 2019-12-08)

In the accepted answer for the question [What is Importance Sampling?](https://computergraphics.stackexchange.com/questions/4979/what-is-importance-sampling), in the example code there is this line:

```
// Accumulate the brdf attenuation
throughput = throughput * material->Eval(wi, wo, normal) / pdf;

```

If the PDF is between 0.0 and 1.0, the division will potentially increase the throughput. I do not think it makes sense. What am I missing?

**Tags:** pathtracing, brdf

> **Comments:**
> **username_1**: Why do you think it should  always decrease?  
> **username_0**: I don't know, it was just intuition. I don't think I really understand what it is suppose to represent  

---

## 2 answers

### Answer by username_2 on 2020-10-08. Score: 2

**Yes, throughput doesn't have to be in range [0, 1].** That's a reason why you have to use exposure settings, because for differente accumulation time, brightness of an image might differ. Nathan Reed described it in details here - <https://computergraphics.stackexchange.com/a/10244/10129>

Your final results and number of fireflies and bright surfaces, depends on PDF that you'll be using. By using Normal Distribution Function PDF, you'll get good results, because NDF is the most determining factor of BRDF shape. Relate to this blog post for details - <https://schuttejoe.github.io/post/ggximportancesamplingpart1/>

---

Back to throughput range. Assuming that you're sampling based on NDF, you'll get fireflies in case of having values in specific range, when light source is shining from very low angle and you're looking directly at the object. Therefore, your denominator might be much greater than nominator and result in small PDF causing fireflies:

$$
p\_i(w\_m, w\_o) = \frac{D(w\_m)(w\_g \cdot w\_i)}{4|w\_g \cdot w\_m|}
$$

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

Since 2014, Heitz was working on BSDFs, presenting good results in same year by sampling visible normals [2]. In 2017, he published much simpler, faster and better paper, improving his method [3]. There are also 2015 and 2016 papers in related field, but I haven't read them, but it might be beneficial if you're interested in BSDF. I would recommend checking his first 2014's work (1) where he explains physical assumption on which BRDF is based. It's worth knowing, what NDF and Geometry Shadowing exactly means in BRDF.

Also, there is a lot of good reading in pbrt book, especially:

* <http://www.pbr-book.org/3ed-2018/Light_Transport_I_Surface_Reflection/Sampling_Reflection_Functions.html#MicrofacetBxDFs>
* <http://www.pbr-book.org/3ed-2018/Light_Transport_I_Surface_Reflection/Path_Tracing.html>
* <http://www.pbr-book.org/3ed-2018/Monte_Carlo_Integration/Importance_Sampling.html>
* For more advanced method, I think it'd be worth reading about Russian Roulette and more efficient Path Tracing algorithms like Bidirectional Path Tracing, Metropolis Light Tracing and Photon Mapping methods

---

(1) Eric Heitz - Understanding the Masking-Shadowing Functionin Microfacet-Based BRDFs <http://jcgt.org/published/0003/02/03/paper.pdf>

(2) Eric Heitz, Eugene d’Eon - Importance Sampling Microfacet-Based BSDFs using the Distribution of Visible Normals <https://hal.inria.fr/hal-00996995v1/document>

(3) Eric Heitz - A Simpler and Exact Sampling Routine for the GGXDistribution of Visible Normals <https://hal.archives-ouvertes.fr/hal-01509746/document>


---

### Answer by username_3 on 2019-12-08. Score: 0

I have a similar question currently posted, so take the following with a grain of salt.

Throughput does not need to be smaller than 1. BRDF only needs to be non negative and to integrate to less than 1 (conservation of energy / albedo) over the hemisphere. It can be arbitrarily large - e.g. in the case of a mirror.

The pdf should approximate the BRDF to reduce variance. However, unless it is always larger than the BRDF, the throughput will be larger than 1 and should be able to reach infinity.

*BRDF in your case corresponds to material->Eval(wi, wo, normal) / dot(normal, wi)*

> **Comments:**
> **username_4**: `BRDF in your case corresponds to material->Eval(wi, wo, normal) / dot(normal, wi)` why?  
> **username_3**: @username_4,  that is more or less the definition of Brdf. E.g. a Diffuse brdf is a constant, non negative,  (obviously)reciprocal function. Using the functions of the OPs referenced question, that's what it would look like. People have a tendency to fold terms together to avoid repeated computation, which is confusing to beginners trying to understand path tracing from the underlying physics.  
> **username_4**: Where did the dot pop out from?  
> **username_3**: @username_4, in the definition of BRDF, there is a "normalizing" (normal direction) term $1 / \cos \theta_i$, which is the angle between the normal and the incomming $w_i$. When $n$ and $w_i$ have unit length, the $\cos \theta_i = \ w_i \cdot normal$, because $a \cdot b \equiv |a| \times |b| \times \cos \theta$, where $\theta$ is the angle between $a$ and $b$. Makes sence?  
> **username_4**: Can you link the definition of BRDF that you are citing?  
> **username_3**: @username_4, hmm, depends on what you need. There is nothing wrong with the definition on [wikipedia](https://en.wikipedia.org/wiki/Bidirectional_reflectance_distribution_function), but if you want context too, maybe try [Ray Tracing in One Weekend](https://raytracing.github.io/) (specifically the 3rd book, I think, goes into some detail), or the popular [Physically Based Rendering: From Theory To Implementation](http://www.pbr-book.org/), both of which are online, free, and contain source code too.  
> **username_4**: Seems you are confusing what your function is defined as formally, and what you have in practice. You do not have the analytical form of the $dL_r$ or $L_i$ in practice, so the `eval/dot` makes no sense. Instead you define some function (which describes your material) that fulfills the 3 required properties. There is no cosine division requirement. In fact the simplest BRDF - Lambertian, is just a constant function that is in $[0,\frac{1}{\pi}]$. I would suggest just deleting your answer, as it is  mostly wrong: e.g. the BRDF thing, the BRDF reaching inifnity for mirrors.  
> **username_3**: I have told you what the function is, and why the division is there (because it is folded into eval in OPs referenced question). I have also told you that a lambertian diffuse is a constant function. The fact that BRDF is infinite for perfectly specular reflections has been answered [here](https://computergraphics.stackexchange.com/questions/4767/why-the-brdf-of-specular-reflection-is-infinite-in-the-reflection-direction).  
> **username_4**: And I am telling you that you are wrong - for the cosine division entirely, for the infinity thing: depending on how informal you want to get. The BRDF for mirrors is not "infinite" - it is a Dirac delta. You're not plugging infinity into your tracer upon implementation due to that reason - instead you're getting rid of the integral due to the main property of the Dirac delta. While it may  be easier to explain it to readers without mathematical background as being "infinite" (which is why I assume the authors of AGI did it), that doesn't change the fact that it is a wrong explanation.  
> **username_4**: In your "example" `material->Eval(wi, wo, normal) / dot(normal, wi)` material->Eval(wi,wo,normal) should by all means be the BRDF, and there is no cosine factor required in the numerator. In no BRDF is such a factor required - only if you want to model a material that has a behaviour $\propto \frac{1}{\cos\theta}$ will you introduce such a factor in the BRDF. I suggest reading up on measure theory if you want to understand in depth where your misunderstanding came from.  
> **username_3**: @username_4, there is no cosine division. Focus on the lambertian diffuse, a constant function, $f_r = \rho / \pi$, where do you see a cosine division?  
> **username_4**: That's exactly what I have been trying to explain to you - see what you wrote: `material->Eval(wi, wo, normal) / dot(normal, wi)`, `in the definition of BRDF, there is a "normalizing" (normal direction) term $1/\cos\theta_i$`. The above simply do not hold in the general case.  
> **username_3**: @username_4, oh I see, that's my mistake, that is very confusing. The reason for $/ \cos$ in my answer, is to cancel out $* cos$ in `eval`, because only the constant part of `eval` is the Lambertian BRDF (despite eval being called brdf by the author). The reason why it is usualy folded together is to avoid repeated computation. The place it came from is the rendering equation, and the reason why it's _there_ is to cancel out the normalizing $\cos$ from the definition of BRDF.  
> **username_4**: You're not supposed to cancel out the cosine in the rendering equation. The only reason I can think of why you would have the division is from the probability density function.  
> **username_3**: @username_4, no. The cos is the attenuation due to angle... This is ridiculous. It is not helping anyone. Lambertian diffuse being equal to `material->Eval(wi, wo, n) / dot(n, wi)` or $f_r = \rho / \pi$ (a constant function) is a fact. BRDF not being upper-bounded is a fact. PLEASE...  
> **username_4**: The attenuation due to angle (Lambert's cosine law) doesn't show up in the denominator of arbitrary BRDFs, it shows up in the rendering equation as a factor not part of the BRDF. I already explained that Lambertian diffuse is constant - no cosine division required. Neither did I argue that the BRDF needs to be bounded from above - however, that does not mean that the mirror BRDF is infinity - it is a Dirac delta.  
> **username_4**: I finally got why you are saying this - I apologize. Seems like in that code they stuck in the cosine into eval for some reason, which confused me. I thought you were dividing the brdf itself by cosine for some reason (but you clarified it was not in the answer before your last). Please do remove the infinity thing about the mirror though - a Dirac delta has very specific properties - it's not just an "infinity". I can give you a brdf that is infinity over sets of measure zero though, and it will not matter.  

---

