Understanding the Masking-Shadowing Function in Microfacet-Based BRDFs

Understanding the Masking-Shadowing Function in Microfacet-Based BRDFs
http://jcgt.org/published/0003/02/03/

abstract
we provide a new presentation of the masking-shadowing functions (or geometric attenuation factors) in microfacet-based BRDFs and answer some common questions about their applications. our main motivation is to define a correct (geometrically indicated), physically based masking function for application in microfacet models, as well as the properties that function should exhibit. indeed, several different masking functions are often presented in the literature and making the right choice is not always obvious. we start by showing that physically based masking functions are constrained by the projected area of the visible microsurface onto the outgoing direction. we use this property to derive the distribution of visible normals from the microsurface, whose normalization factor is the masking function. we then show how the common form of microfacet-based BRDFs emerges from this distribution. as a consequence, the masking function is related to the correct normalization of microfacet-based BRDFs. however, while the correct masking function satisfies these normalization constrains, its explicit form is can only be determined for a given microsurface profile.

  1. introduction
    microfacet theory was originally developed in the field of optical physics to study scattering on statistical surfaces[Beckmann and Spizzichino 1963]. in the graphics community, we use it to derive physically based bidirectional reflectance distribution functions (BRDFs)[cook and torrance 1982; oren and nayar 1994; walter et al. 2007], which are used widely in both real-time and production rendering. today, microfacet theory is a fundamental background topic in computer graphics. for instance, for the past two years, the SIGGRAPH course on physically based rendering began with an introduction to microfacet theory [McAuley et al. 2012; McAuley et al.2013], with the goal of providing the main intuitions derived from the underlying phyics. other considerations, such as flexibility for artistic direction and computational efficiency, are also discussed throughout that course. microfacets are an area of continuing development because the combination of different components in microfacet-based BRDFs offer a wide range of possibilities. so, the right choices for each of those components are frequently not obvious and in our experience, are a common source of confusion in the field.

Understanding the Masking-Shadowing Function in Microfacet-Based BRDFs_第1张图片
Understanding the Masking-Shadowing Function in Microfacet-Based BRDFs_第2张图片

  1. derivation of the masking function
    in this section, we show how the projected area of the microsurface can be used to introduce a constraint on physically based masking functions, following Ashikhmin et al.[2000]. we start by defining the concept of projected area (2.1) and show why it is essential to the measure of radiance. then, we define the statistical framework of microfacet theory (2.2).

2.1 measuring radiance on a surface

Understanding the Masking-Shadowing Function in Microfacet-Based BRDFs_第3张图片
M——代表的是micro-surface
Wo——o,代表out

Figure 1. The outgoing radiance of surface M is the average of the radiances from each point of the surface, weighted by their projected-area fractions towards the outgoing direction.

radiance is the energy density traveling through an area from a solid angle. it is measured in watts per steradian per square meter (W/sr/m^2). The outgoing radiance L(ωo,M) of a given surface M in direction ωo, is the integral of the radiances L(ωo, pm) from each patch with center point pm on the surface, measured from outgoing direction ωo, and weighted by its projected area observed from that outgoing direction (as shown in Figure 1):
在这里插入图片描述
The area of each surface point projected in the outgoing direction is a view-dependent weighting factor and the integral ∫M projected area(pm)d pm, is the normalization coefficient of the projected-area fractions. 投射面积的单位化系数。
Note that this normalization coefficient gives the entire expression radiance units; without it, the result would be missing the area units in the denominator 分母.
in the following sections we will see that, in accordance with microfacet theory, the microfacets are also weighted by their projected areas, and that the masking function (or geometric attenuation factor) is the normalization term required for energy preservation.

2.2 microfacet statistics
we consider a planar region of a surface, which we call the “geometric surface” G, whose area is 1m^2 by convention: 在这里插入图片描述
the microfacet model assumes that the true surface is offset from this in the form of a collection of microfacets, which we call the “microsurface” M. 我之前的猜测是对的,就是microsurface的首字母缩写, to be precise: if wg is the normal of the geometry G, then M is the set of microfacet points that project onto G along wg. each point pm of the microsurface M has a normal vector wm(pm), i.e. wm:M->Ω is a function from a point on the microsurface to the surface normal vector at that point. we express the three coordinates of this vector as (xm, ym, zm).

Understanding the Masking-Shadowing Function in Microfacet-Based BRDFs_第4张图片
figure 2. the geometric surface and the microsurface.

microfacet theory is a statistical model of the scattering properties of the microsurface. thus, writing statistical rather than spatial equations is more convenient for this study. in microfacet theory, the statistics are defined in the space of the normals, which is the spherical domain Ω.
微表面理论是一个统计模型,什么统计模型呢?是关于微表面的散射属性的统计模型。因此,书写统计而不是空间的等式要简单的点。

the distribution of normals to relate integrals over the microsurface to integrals over the sphere——i.e., to convert from spatial to statistical integrals——we need a tool that measures the change-of-area as we switch domains. the distribution of normals provides this. it is expressed in square meters per steradian (m^2/sr) and defined as
注意这里给出了法线分布函数D的定义:
在这里插入图片描述
where the units of the Dirac delta distribution are 1/sr, the inverse of those of its argument. consider some region Ω’⊂Ω of the unit sphere. now consider the subset M’⊂M of the microsurface that contains all of the points pm∈M where the normal wm(pm) is an element of Ω’, such that
在这里插入图片描述

we use this somewhat awkward phrase because “normal distribution” is widely used to mean the distribution function for a gaussian random variable. also, note that D is actually the distribution of normals per square meter of the geometric surface and this is why it is measured in m^2/sr and not in 1/sr, contrary to what is staged in [Walter et al. 2007].

the distribution of normals has the property that its integral, over any region Ω’⊂Ω of the unit sphere, gives the area of the set of all points M’⊂M whose normals lie in Ω’:
在这里插入图片描述

as a consequence, the integral of the distribution of normals is the area of the microsurface:
在这里插入图片描述
Spatial and Statistical Equations As a consequence of the definition of D, if f(wm) is any function of the microsurface normals, then the spatial integration of f can be replaced by a statistical integration:
在这里插入图片描述
where the left-hand side is the spatial integral and the right-hand side is the statistical integral. this property is used in figure 3(a), where f is the dot product.

Statistical functions if g(pm) is a spatial function defined on the microsurface, we can define the related statistical function g(wm) as
在这里插入图片描述
the statistical functions can be used in statistical integrals in the following way:
在这里插入图片描述
this property is used in figure 3©, where g is the masking function G1, which we introduce in section 2.3.

2.3. microfacet projections 微表面投影
(a) projected area of the microsurface onto the geometric normal wg the area of the microsurface projected onto the geometric normal is the area of the geometric surface (figure 3(a)), whose area is 1m^2 by convention. hence, the projection of the distribution of normals onto the geometry is normalized:
在这里插入图片描述
(b) projected area of the geometric surface onto the outgoing direction wo the geometric surface area is 1m^2 and its provided area onto the outgoing direction (figure 3(b)) is the area multiplied by the cosine of the angle of incidence 入射角 θo:

在这里插入图片描述
© projected area of the visible microsurface onto the outgoing direction wo we now show that the projected area of the geometric surface onto the outgoing direction is also the projected area of the visible microsurface (figure 3©). it is the sum of the projected area of each visible microfacet. The projected area of a microfacet with normal wm is the geometric projection factor (wo;wm). Note that here we use the clamped dot product <-;-> because backfacing microfacets are not visible. Also, microfacets occluded by the microsurface do not contribute to the projected area and must be removed from the sum. This is achieved by multiplying by a spatial masking function G1(wo; pm) that has binary values: it evaluates to 0 if point pm is masked and to 1 if it is visible. this gives
在这里插入图片描述
The statistical masking function G1(wo;wm) 统计形式的遮蔽函数范围在[0;1]之间。has the range [0;1] and gives the fraction of microfacets with normal wm that are visible along the outgoing direction wo:
在这里插入图片描述
The statistical equation is given by
在这里插入图片描述
Understanding the Masking-Shadowing Function in Microfacet-Based BRDFs_第5张图片
Understanding the Masking-Shadowing Function in Microfacet-Based BRDFs_第6张图片
Understanding the Masking-Shadowing Function in Microfacet-Based BRDFs_第7张图片

2.4. a constraint on the masking function
firgure 3 emphasizes a fundamental property of microfacet theory: the projected area of the visible microsurface from equation (13) is exactly the projected area of the geometric surface given in Equation (10). This equivalence imposes a constraint on the statistical masking function, which is formalized by the following equation:
在这里插入图片描述

Physically based masking functions G1 should always satisfy this constraint. However, this constraint does not entirely determine G1, since for a fixed outgoing direction wo, the masking function is two-dimensional—G1(wo;wm) is defined for each normal—and there are an infinite 无限 number of functions for G1 that satisfy the equation.
In order to reduce the number of solutions to one, we introduce a second constraint:
we choose a microsurface profile.
An intuitive way to think about this is that the distribution of normals is like a histogram, describing only the proportion of each normal on the microsurface. It does not provide information on how they are organized, however—for this, we need a microsurface profile. Furthermore, as Figure 4 illustrates, the choice of profile can have a strong impact on the shape of the resulting BRDF. Once the microsurface profile has been chosen, the masking function is completely determined, and its exact form can be derived. This is covered Section 4, which reviews the exact form of G1 obtained with the Smith and V-cavity microsurface profiles.

2.5. Summary
A frequently asked question concerning the masking function is: “Among the different masking functions (or geometric attenuation factors), which one should I use? Are they all physically based?”
In this section, we have shown that:
 The projected area of the visible microsurface is equal to the projected area of the geometric surface onto any projection direction.
 The masking function is constrained by this equality. More formally, physically based masking functions always satisfy Equation (14).
 The masking function is not entirely determined by this contraint, however.
 The masking function is entirely determined once the microsurface profile has been chosen.
 The microsurface profile impacts the shape of the BRDF.

Understanding the Masking-Shadowing Function in Microfacet-Based BRDFs_第8张图片

  1. Microfacet-Based BRDFs
    In this section, we define the distribution of visible normals (3.1) and we show how microfacet models are constructed from this distribution in the general case (3.2), and in the specific cases of specular (3.3) and diffuse (3.4) microfacets. We show that the masking function 遮蔽函数 is the normalization coefficient of the distribution of visible normals, and we discuss the link with energy conservation for BRDFs constructed from this distribution (3.5).

Understanding the Masking-Shadowing Function in Microfacet-Based BRDFs_第9张图片
Wm的m是microsurface/microfacet的首字母。

3.1 distribution of visible normals
in this section, we will show that equation (1) can be formulated in a microfacet paradigm 范式 as
在这里插入图片描述
是clamp操作,保证点乘的结果大于0。
where L(wo;M) is the outgoing radiance from the microsurface, L(wo,wm) is the outgoing radiance from the microfacets with normal wm, and the factor 1/cosθo is here to normalize the integral by the projected area of geometric surface.
cosθo 是透视的面积。

We can see that the outgoing radiance from the microsurface is the sum of the outgoing radiance from each microfacet weighted by what we call the distribution of visible normals, as illustrated in figure 5. it is the distribution of normals weighted by the projected area of each normal (the clamped cosine, ) and by the masking function:
在这里插入图片描述
It is important that the distribution of visible normals Dwo(wm) is normalized, because we use it as a weighting function to average radiances:
Dwo(wm) 是除以了cosθo,进行单位化的之后的分布函数。我们用这个作为缩放量,缩放的是辐射率。对辐射率取平均值,如下:
在这里插入图片描述
and, as explained in Section 2.1 and Figure 1, averaging radiances is only valid if the weighting function is normalized. This last equation is well defined because the integral in the denominator of Equation (1), which ensured correct normalization, is now represented in the masking function G1. Indeed, by using the result of Equation (14), we can replace cosθo in Equation (16) and verify that the distribution of normals is normalized:
Understanding the Masking-Shadowing Function in Microfacet-Based BRDFs_第10张图片
and the average outgoing radiance from Equations (15) and (17) can thus be expressed in the same form as Equation (1), emphasizing the correct normalization:
在这里插入图片描述
3.2. construction of the BRDF
we now construct the BRDF upon the distribution of visible normals. the radiance L(wo,wm) of each microfacet can be expressed in terms of the micro-BRDF ρM(wo;wi;wm) associated with each microfacet and integrated with the incident radiance L(wi) over the domain of the incident directions Ωi (we reserve Ω for the space of the normals):
在这里插入图片描述
Understanding the Masking-Shadowing Function in Microfacet-Based BRDFs_第11张图片
next, we differentiate equation (17) with respect to the incoming irradiance and substitute dl(wo,wm) via equation (21):
Understanding the Masking-Shadowing Function in Microfacet-Based BRDFs_第12张图片

你可能感兴趣的:(PBR)