<p>Specular surfaces which use MIS are not perfectly specular like a mirror. They have a small amount of blur, otherwise there is indeed no point in sampling the light as all the samples will evaluate the BRDF as 0. In fact, you would only need to trace a single reflection ray.</p>

<p>A small amount of blur means that a given camera ray will see a small area of the lightsource (assuming it hits where the specular highlight is visible). Thus, a small fraction of the light samples will get a BRDF which is not 0 so it will eventually converge. The less blur, the more samples it will take.</p>

<p>You are correct that such a case will converge faster if you sample only the BRDF. Likewise, a very diffuse BRDF will usually converge faster if you sample only the light. But this is not true if your light is very large and your surface very close to it<sup>1</sup>. Where MIS shines is that it handles those cases as well as the BRDFs which are neither very diffuse nor very specular.</p>

<p>If you choose to ignore it, what you have to do is a simple integral. There are a few ways to go about it but if you start from MIS equations, just use 0 as the PDF of the BRDF since you're not generating those samples. And be prepared for some cases which won't converge well.</p>

<hr>

<ol>
<li>The assumption is that the light samples all have a similar contribution to the final result. Even with very good sampling of the light, this must assume that the BRDF will be similar for all light samples. At least I don't know of any direct light sampling formula which takes the cosine term of the diffuse surface into account. Pushing this to the extreme, you can build an example where most of the light is behind the surface, so most of the light samples will contribute nothing at all to the final result. BRDF samples are obviously sent only on the front side of the surface so they might converge faster, even if only a small % of them hit the light.</li>
</ol>

CC BY-SA 3.0
2018-01-17T04:53:52.907Z
So convergence rests on the BRDF being zero/nonzero. How does that work? I've been assuming that the BRDF is just a generator function for ray directions...
Paul Ferris
CC BY-SA 3.0
2018-01-17T04:55:27.003Z
Also, why shouldn't light sampling accelerate convergence for large, close light sources? If every ray that isn't obstructed is guaranteed to reach the light (which they *should* be for area lights), then shouldn't light sampling always give a better result for diffuse surfaces?
Paul Ferris
CC BY-SA 3.0
2018-01-17T16:54:24.780Z
@PaulFerris the BRDF is a function which says how much light is reflected in any given direction. The ray generator function can be any distribution which throws rays everywhere the BRDF is non-zero (eg. a uniform generator over the entire sphere). You get ideal sampling when the generator exactly matches the BRDF but that is not a requirement of MIS. Some BRDFs are very hard to generate rays for perfectly so a different function is often used. I'll edit the answer for your other comment.
Olivier
CC BY-SA 3.0
2018-01-22T05:39:48.833Z
That makes sense, thank you. So my misunderstanding was treating the BRDF and the ray generator as the same thing when the BRDF really just gives reflectance along the output rays provided by the generator? W.r.t light sampling, would this (https://imgur.com/a/BC8HV) be an example of the sort of situation you're referring to?
Paul Ferris
CC BY-SA 3.0
2018-01-22T14:45:21.340Z
@PaulFerris Yes. Although be aware that some older BRDF papers will present only a generator function and a sample weighting function to compensate for the difference between the generator and the BRDF. And yes, the tip of that "cube" nearest the sphere is the kind of thing I had in mind. It would likely have more noise when sampling only the light (sphere) vs MIS.
Olivier
CC BY-SA 3.0
2018-01-16T16:24:40.533Z
2018-01-17T17:17:50.317Z
2018-01-17T17:17:50.317Z
Olivier
<p>Multiple Importance Sampling (MIS) is a technique used by Veach's VCM technique to balance responses of different surfaces to different types of importance sampling for direct illumination. My understanding is that specular surfaces are best lit without sampling the light at all; instead, you pull a direction from the BRDF and hope that it hits the light source. Diffuse surfaces "spread" light more broadly over their domain, so firing rays towards random points on the area covered by the light produces good results without the wastage produced by sampling over the BRDF.</p>

<p>I'm still unsure about a few things, though:</p>

<ul>
<li>Veach's demonstration images show flat specular surfaces eventually converging with light sampling; how is this possible? All rays fired towards random points on the light will reach the light (assuming no obstructions), so shouldn't the specular surfaces wash out under all the assumed illumination?</li>
<li>"<strong>Multiple</strong> Importance Sampling" implies that tracing gather rays towards the light is an importance-sampled technique (which makes sense, it's very difficult to have invalid rays if all rays approximate the direction of light relative to the surface); does this mean I need to be dividing my direct gathers by a PDF? Given that the "direction" of the light could be anywhere on the unit sphere surrounding the lit point, should the PDF be $4\pi$?</li>
</ul>

<specular><monte-carlo><importance-sampling>
Direct illumination, specular surfaces, and MIS
Paul Ferris
# Direct illumination, specular surfaces, and MIS

(Asked by: username_0 on 2018-01-15)

Multiple Importance Sampling (MIS) is a technique used by Veach's VCM technique to balance responses of different surfaces to different types of importance sampling for direct illumination. My understanding is that specular surfaces are best lit without sampling the light at all; instead, you pull a direction from the BRDF and hope that it hits the light source. Diffuse surfaces "spread" light more broadly over their domain, so firing rays towards random points on the area covered by the light produces good results without the wastage produced by sampling over the BRDF.

I'm still unsure about a few things, though:

* Veach's demonstration images show flat specular surfaces eventually converging with light sampling; how is this possible? All rays fired towards random points on the light will reach the light (assuming no obstructions), so shouldn't the specular surfaces wash out under all the assumed illumination?
* "**Multiple** Importance Sampling" implies that tracing gather rays towards the light is an importance-sampled technique (which makes sense, it's very difficult to have invalid rays if all rays approximate the direction of light relative to the surface); does this mean I need to be dividing my direct gathers by a PDF? Given that the "direction" of the light could be anywhere on the unit sphere surrounding the lit point, should the PDF be $4\pi$?

**Tags:** specular, monte-carlo, importance-sampling


---

## 1 answers

### Answer by username_1 on 2018-01-16. Score: 2 | Accepted answer

Specular surfaces which use MIS are not perfectly specular like a mirror. They have a small amount of blur, otherwise there is indeed no point in sampling the light as all the samples will evaluate the BRDF as 0. In fact, you would only need to trace a single reflection ray.

A small amount of blur means that a given camera ray will see a small area of the lightsource (assuming it hits where the specular highlight is visible). Thus, a small fraction of the light samples will get a BRDF which is not 0 so it will eventually converge. The less blur, the more samples it will take.

You are correct that such a case will converge faster if you sample only the BRDF. Likewise, a very diffuse BRDF will usually converge faster if you sample only the light. But this is not true if your light is very large and your surface very close to it1. Where MIS shines is that it handles those cases as well as the BRDFs which are neither very diffuse nor very specular.

If you choose to ignore it, what you have to do is a simple integral. There are a few ways to go about it but if you start from MIS equations, just use 0 as the PDF of the BRDF since you're not generating those samples. And be prepared for some cases which won't converge well.

---

1. The assumption is that the light samples all have a similar contribution to the final result. Even with very good sampling of the light, this must assume that the BRDF will be similar for all light samples. At least I don't know of any direct light sampling formula which takes the cosine term of the diffuse surface into account. Pushing this to the extreme, you can build an example where most of the light is behind the surface, so most of the light samples will contribute nothing at all to the final result. BRDF samples are obviously sent only on the front side of the surface so they might converge faster, even if only a small % of them hit the light.

> **Comments:**
> **username_0**: So convergence rests on the BRDF being zero/nonzero. How does that work? I've been assuming that the BRDF is just a generator function for ray directions...  
> **username_0**: Also, why shouldn't light sampling accelerate convergence for large, close light sources? If every ray that isn't obstructed is guaranteed to reach the light (which they *should* be for area lights), then shouldn't light sampling always give a better result for diffuse surfaces?  
> **username_1**: @username_0 the BRDF is a function which says how much light is reflected in any given direction. The ray generator function can be any distribution which throws rays everywhere the BRDF is non-zero (eg. a uniform generator over the entire sphere). You get ideal sampling when the generator exactly matches the BRDF but that is not a requirement of MIS. Some BRDFs are very hard to generate rays for perfectly so a different function is often used. I'll edit the answer for your other comment.  
> **username_0**: That makes sense, thank you. So my misunderstanding was treating the BRDF and the ray generator as the same thing when the BRDF really just gives reflectance along the output rays provided by the generator? W.r.t light sampling, would this (https://imgur.com/a/BC8HV) be an example of the sort of situation you're referring to?  
> **username_1**: @username_0 Yes. Although be aware that some older BRDF papers will present only a generator function and a sample weighting function to compensate for the difference between the generator and the BRDF. And yes, the tip of that "cube" nearest the sphere is the kind of thing I had in mind. It would likely have more noise when sampling only the light (sphere) vs MIS.  

---

