跳转至

7 Materials and Appearances

文本统计:约 1531 个字 • 5 行代码

外观是光照材质共同作用的结果。由于材质不同,光线作用后会得到不同的结果,同样的模型会渲染出不同的结果。

在渲染方程中,由BRDF来决定材质。

7.1 Some Materials

7.1.1 Diffuse / Lambertian Material

Light is equally reflected in each output direction

我们现在假设进来的光的是均匀的,同时反射的光也是均匀的。如果这个点不发光并且不吸收光,那么该点入射的radiance与出射的radiance是相同的。

Note

\[ \begin{aligned} &\int_{H^2}\cos \theta_i \text{ d}\omega_i\\ =&\int_0^{2\pi}\text{d} \varphi \int_0^{\frac{\pi}{2}}\cos\theta \sin\theta \text{ d}\theta\\ =&\pi \end{aligned} \]

albedo \(\rho\): 反射率(0到1之间)可以是单通道的也可以由RGB三个值组成

7.1.2 Glossy Material

看似平整,实际上还是有一点粗糙,并不是标准的镜面

7.1.3 Ideal reflective / refractive material (BSDF)

有一定的折射情况发生,也有反射,比如水或者玻璃这样的材质

7.2 Reflection and Refraction

7.2.1 Perfect Specular Reflection

计算出射方向的两种方法:

  • 法一:直接根据向量法求解

\[ \begin{align*} &\omega_o+\omega_i=2\cos\theta\ \vec{n}= 2(\omega_i\cdot\vec{n})\vec{n}\\ &\omega_o=-\omega_i+2(\omega_i\cdot\vec{n})\vec{n} \end{align*} \]
  • 法二:将方向向量拆成某个投影的方位角加上一个仰角(与法线的夹角),出射光的方向方位角相反,仰角不变

镜面反射当然也可以用BRDF来表达,所有的光线都集中在反射方向上,会引入狄拉克函数

7.2.2 Specular Refraction

光除了被表面反射外,还可以通过表面传播。光线进入新介质时发生折射。

Snell’s Law

拆成方位角与仰角分别计算

折射角的计算:

\[ \begin{align*} \eta_i\sin\theta_i&=\eta_t\sin\theta_t\\ \cos\theta_t&=\sqrt{1-\sin^2\theta_t}\\ &=\sqrt{1-(\frac{\eta_i}{\eta_t})^2\sin^2\theta_i}\\ &=\sqrt{1-(\frac{\eta_i}{\eta_t})^2(1-\cos^2\theta_i )} \end{align*} \]

Total internal reflection (全反射)

如果根号里面算出来的是负数,那么折射就变成了全反射。要想发生全反射那么必须要从光密介质进入光疏介质才行。

Snell’s Window /Circle

7.3 Fresnel Reflection / Term (菲涅尔项)

Reflectance depends on incident angle (and polarization), 意思是反射率与入射的角度有关。举一个生活中的例子,在车子中面对面前的玻璃可以看到外面的风景,而看前面的玻璃,那么看到大多为反射的司机等等。入射角越大,反射率越大!

不同材质(绝缘体与导体)的菲涅尔项并不相同

精确的刻画反射率与入射角度的关系需要考虑极化的影响,\(R_s\)\(s\) 方向偏振光的反射率,\(R_p\)\(p\) 方向偏振光的反射率,考虑非偏振光的时候就两者取平均就可以了。

但是上述内容比较复杂,我们可以作一个估计:Schlick’s approximation

\[ \begin{align*} R(\theta)&=R_0+(1-R_0)(1-cos\theta)^5\\ R_0&=(\frac{n_1-n_2}{n_1+n_2})^2 \end{align*} \]

7.4 Microfacet Material

Rough surface

  • Macroscale: flat & rough
  • Microscale: bumpy & specular

Individual elements of surface act like mirrors

  • Known as Microfacets
  • Each microfacet has its own normal

对于一个粗糙的表面,我们在宏观上可以认为它是平整的,但是在微观上我们可以把它看成很多小镜子的集合,研究一个微表面的BRDF关键就在于研究微表面法线的分布情况 (the distribution of microfacets’ normals)

如果微表面模型法线是比较集中的,那么它的材质可以被认为是 glossy;而微表面模型的法线是分散开来的,那么它的材质就被认为是 diffuse 的

由此我们可以推导相应的BRDF

解释一下:

  • \(\bf F(i,h)\)代表的是菲涅尔项,反射的总能量是多少
  • \(\bf G(i,o,h)\)代表的是微表面的一些遮挡现象,在入射角比较大的情况下,微表面互相遮挡的情况比较明显,该系数为了修正这一情况。
  • \(\bf D(h)\)代表的就是法线的分布

7.5 Isotropic / Anisotropic Materials (BDRFs)

我们将材料分为各向同性材质,各向异性材质

区别:如果BRDF不满足在方位角上旋转得到的还是相同的BRDF,则称为是各向异性材质。

各向同性的 BRDF 只和相对的方位角有关,而各向异性材质不止和相对方位角有关还和绝对方位角有关

各项同性:\(f_r(\theta_i,\theta_r,\phi_r-\phi_i)=f_r(\theta_r,\theta_i,\phi_i-\phi_r)=f_r(\theta_i,\theta_r,|\phi_r-\phi_i|)\)

各向异性:\(f_r(\theta_i,\theta_r,\phi_r-\phi_i)=f_r(\theta_r,\theta_i,\phi_i-\phi_r)\neq f_r(\theta_i,\theta_r,|\phi_r-\phi_i|)\)

Properies of BRDFs

  • Non-negativity (非负性): \(f_r(\omega_i\rightarrow \omega_r)\geq0\)
  • Linearity (线性性): \(L_r(p,\omega_r)=\int_{H^2}f_r(p,\omega_i\rightarrow\omega_r)L_i(p,\omega_i)\cos\theta_i\ \text{d}\omega_i\)

  • Reciprocity principle (可逆性): \(f_r(\omega_r\rightarrow\omega_i)=f_r(\omega_i\rightarrow\omega_r)\)

  • Energy conservation (能量守恒): \(\forall\omega_r\ \int_{H^2}f_r(p,\omega_i\rightarrow\omega_r)L_i(p,\omega_i)\cos\theta_i\ \text{d}\omega_i\leq 1\)

  • Isotropic vs. anostropic

7.5 Measuring BRDFs

7.5.1 Motivation

  • 避免计算 BRDF 模型,只要测量出来就可以用。
  • 计算的不一定准确,但测量能准确的得出真实世界的材质。

7.5.2 Measuring method

测量 BRDF 就是让光影和相机从各个方向去照去拍。

General approach:

for each outgoing direction wo
    move light to illuminate surface with a thin beam from wo
    for each incoming direction wi
        move sensor to be at direction wi from surface
        measure incident radiance

Improving efficiency:

  • 各项同性的情况可以将4维降低到3维
  • 由光路的可逆性可以将测量次数再次少掉一半
  • 有一些更聪明的方法可以做到测量若干的点然后将其他的点模拟猜测出来

7.5.3 Representing Measured BRDF

  • Compact representation 紧凑的表示
  • Accurate representation of measured data 测量数据的准确表示
  • Efficient evaluation for arbitrary pairs of directions 对随意一对方向的高效预测
  • Good distributions available for importance sampling 可用于重要性抽样的良好分布

Tabular Representation

Store regularly-spaced samples in \((\theta_i,\theta_o,|\phi_i-\phi_o|)\)

评论区

对你有帮助的话请给我个赞和 star => GitHub stars
欢迎跟我探讨!!!