<blockquote>
  <p>Edit: I suddenly understood the issue. The noise in the top right corner of (b) is because it's struggling to find the tiny fraction of angles in which the BSDF is not extremely close to zero. </p>
</blockquote>

<p>Yes your reasoning here is correct. </p>

<p>Taken to the extreme if the top most surface was perfectly mirror (dirac delta BRDF), then it would never* sample the right ray from the light source that was perfectly aligned with the camera's view direction. For such a BRDF <span class="math-container">$\omega_i$</span> must equal <span class="math-container">$\omega_o$</span>. </p>

CC BY-SA 4.0
2018-11-18T21:05:15.733Z
2018-11-18T21:05:15.733Z
Calvin
<p>I wish to understand the specific application of Multiple Importance Sampling (MIS) to weighting BSDF sampling and light sampling together.
Refer to the following diagram from <a href="https://graphics.stanford.edu/courses/cs348b-03/papers/veach-chapter9.pdf" rel="noreferrer">these Stanford course notes</a>:</p>

<p><a href="https://i.sstatic.net/UnvBZ.png" rel="noreferrer"><img src="https://i.sstatic.net/UnvBZ.png" alt="Multiple Importance Sampling"></a></p>

<p>I understand the source of noise in the left diagram <strong>(a)</strong>, but not in the right <strong>(b)</strong>, and I think this stems from understanding what "sampling the BSDF" means, but not understanding what "sampling the light sources" means.</p>

<p>To confirm my understanding I'm going to grossly simplify the general path tracing procedure, and specialize it to a single bounce in this scene, to get the point across:</p>

<h2>BSDF sampling (diagram <strong>(a)</strong>) procedure:</h2>

<ul>
<li>Cast a ray from the camera for a given pixel.</li>
<li>Upon hitting the glossy surface, sample the surface's BSDF, then continue along the newly sampled ray.</li>
<li>Hopefully, you hit the light, in which case you contribute energy to the given pixel.</li>
</ul>

<p>This will obviously yield the noise profile we see in diagram <strong>(a)</strong>; the noise goes down as the surface gets glossier (sharpening the distribution of the BSDF) and as the light gets bigger (making the target easier to hit by chance).</p>

<p>However, I don't understand the nature of the noise in diagram <strong>(b)</strong>, and I therefore clearly don't understand what "sampling the light source" means. My guess would be a procedure like:</p>

<h2>Light source sampling (diagram <strong>(b)</strong>) procedure(???):</h2>

<ul>
<li>Cast a ray from the camera for a given pixel.</li>
<li>Upon hitting the glossy surface, uniformly sample the solid angle that subtends the light source (i.e., a "shadow ray"), then continue along the newly sampled ray.</li>
<li>If you hit the light (i.e., no obstructions) contribute energy to the given pixel, weighted inversely by the BSDF of the glossy surface evaluated at the shadow ray, (and probably also multiplied by some other weight representing the fraction of our total solid angle that the light takes up, as in regular importance sampling).</li>
</ul>

<p>(Again, I have grossly simplified, and have reduced the problem to a single bounce in this particular scene for illustrative purposes.)</p>

<p>However, the procedure I have described above cannot possibly be what is meant by "light source sampling" in the linked paper, because then it wouldn't result in more noise with larger area lights.</p>

<p>What's going on in diagram <strong>(b)</strong>?</p>

<p><strong>Edit:</strong> I suddenly understood the issue. The noise in the top right corner of <strong>(b)</strong> is because it's struggling to find the tiny fraction of angles in which the BSDF is not extremely close to zero. My assertion "... because then it wouldn't result in more noise with larger area lights" is precisely wrong, because larger area lights correspond to sampling over a larger fraction of the solid angle, and thus sampling the inverse BSDF weights with higher variance.</p>

<p>I'm now looking for how to delete my question. Hitting the "flag" button just sends me to the top of the page, and doesn't do anything else...</p>

CC BY-SA 4.0
2018-10-17T02:06:49.887Z
If you have a found an answer to your question, the standard thing to do is to add an answer explaining what was going on. You normally wouldn't delete a question, specially since you would need help from an admin to do that anyways.
Sebastián Mestre
<importance-sampling>
BSDF sampling versus light sampling
SomeHumanBeing
# BSDF sampling versus light sampling

(Asked by: username_0 on 2018-10-16)

I wish to understand the specific application of Multiple Importance Sampling (MIS) to weighting BSDF sampling and light sampling together.
Refer to the following diagram from [these Stanford course notes](https://graphics.stanford.edu/courses/cs348b-03/papers/veach-chapter9.pdf):

[![Multiple Importance Sampling](https://i.sstatic.net/UnvBZ.png)](https://i.sstatic.net/UnvBZ.png)

I understand the source of noise in the left diagram **(a)**, but not in the right **(b)**, and I think this stems from understanding what "sampling the BSDF" means, but not understanding what "sampling the light sources" means.

To confirm my understanding I'm going to grossly simplify the general path tracing procedure, and specialize it to a single bounce in this scene, to get the point across:

## BSDF sampling (diagram **(a)**) procedure:

* Cast a ray from the camera for a given pixel.
* Upon hitting the glossy surface, sample the surface's BSDF, then continue along the newly sampled ray.
* Hopefully, you hit the light, in which case you contribute energy to the given pixel.

This will obviously yield the noise profile we see in diagram **(a)**; the noise goes down as the surface gets glossier (sharpening the distribution of the BSDF) and as the light gets bigger (making the target easier to hit by chance).

However, I don't understand the nature of the noise in diagram **(b)**, and I therefore clearly don't understand what "sampling the light source" means. My guess would be a procedure like:

## Light source sampling (diagram **(b)**) procedure(???):

* Cast a ray from the camera for a given pixel.
* Upon hitting the glossy surface, uniformly sample the solid angle that subtends the light source (i.e., a "shadow ray"), then continue along the newly sampled ray.
* If you hit the light (i.e., no obstructions) contribute energy to the given pixel, weighted inversely by the BSDF of the glossy surface evaluated at the shadow ray, (and probably also multiplied by some other weight representing the fraction of our total solid angle that the light takes up, as in regular importance sampling).

(Again, I have grossly simplified, and have reduced the problem to a single bounce in this particular scene for illustrative purposes.)

However, the procedure I have described above cannot possibly be what is meant by "light source sampling" in the linked paper, because then it wouldn't result in more noise with larger area lights.

What's going on in diagram **(b)**?

**Edit:** I suddenly understood the issue. The noise in the top right corner of **(b)** is because it's struggling to find the tiny fraction of angles in which the BSDF is not extremely close to zero. My assertion "... because then it wouldn't result in more noise with larger area lights" is precisely wrong, because larger area lights correspond to sampling over a larger fraction of the solid angle, and thus sampling the inverse BSDF weights with higher variance.

I'm now looking for how to delete my question. Hitting the "flag" button just sends me to the top of the page, and doesn't do anything else...

**Tags:** importance-sampling

> **Comments:**
> **username_1**: If you have a found an answer to your question, the standard thing to do is to add an answer explaining what was going on. You normally wouldn't delete a question, specially since you would need help from an admin to do that anyways.  

---

## 1 answers

### Answer by username_2 on 2018-11-18. Score: 1

> Edit: I suddenly understood the issue. The noise in the top right corner of (b) is because it's struggling to find the tiny fraction of angles in which the BSDF is not extremely close to zero.

Yes your reasoning here is correct.

Taken to the extreme if the top most surface was perfectly mirror (dirac delta BRDF), then it would never\* sample the right ray from the light source that was perfectly aligned with the camera's view direction. For such a BRDF $\omega\_i$ must equal $\omega\_o$.


---

