重要性抽樣和多重重要性抽樣之間有什麼區別?


11

我聽不懂數學方程式。我是平面設計師。

  • 什麼是"重要性抽樣"?

  • 什麼是"多重重要性抽樣"?

您可以使用插圖而不使用數學方程式輕鬆地進行解釋嗎?"重要性抽樣"和"多重重要性抽樣"有什麼區別?

12

When shading a point on an opaque surface, you need to gather incoming light and weight it with the bidirectional reflectance distribution function (BRDF) of the material.

The naive approach is to distribute samples equally over the hemisphere and probe all directions equally for incoming light. This is called uniform sampling (Fig. 1). While this works in most cases, it can take a long time to converge towards the correct result.

Uniform sampling on the hemisphere
Figure 1: Uniform sampling on the hemisphere

To speed things up, let's consider the properties of the surface in question. A diffuse surface needs to take light from all directions on the hemisphere into account, where light coming from flat angles has less influence. A perfect mirror only needs a single direction according to the law of reflection. Importance sampling takes this into account and distributes samples where light is expected to have a greater influence, judging from the BRDF. For the diffuse surface, a cosine sampling would be used (Fig. 2), resulting in fewer samples at flat angles that presumably have a lower influence. For the perfect mirror, only a single ray is shot because all other directions have zero influence anyway.

Cosine sampling on the hemisphere
Figure 2: Cosine sampling on the hemisphere

Now, the BRDF is not the only thing that can be taken into account. When you have known light sources with strong intensity, it is often desirable to direct more rays towards these light sources, as these directions presumably have a greater impact on the result (i.e. there is more light coming from these directions). The idea to combine various different importance sampling strategies into one is called multiple importance sampling. This technique is not limited to the given example of BRDF + known lights, but can be used with any kind of sensible heuristic you can come up with.

Images were generated using Holger Dammertz' Hammersley Points on the Hemisphere.