From 4dc0ee0fb9036c287b6a0887b87981a259a714df Mon Sep 17 00:00:00 2001 From: kanition <68691995+kanition@users.noreply.github.com> Date: Wed, 13 Mar 2024 02:48:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=9C=E7=8E=87=E4=B8=8E=E6=B3=95=E7=BA=BF?= =?UTF-8?q?=E5=88=86=E5=B8=83=E5=85=B3=E7=B3=BB=20#145=20#156?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- content/chap08ex01.tex | 82 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 81 insertions(+), 1 deletion(-) diff --git a/content/chap08ex01.tex b/content/chap08ex01.tex index 4aa9585..8741a79 100644 --- a/content/chap08ex01.tex +++ b/content/chap08ex01.tex @@ -582,8 +582,88 @@ \subsubsection*{Smith微面} D({\bm\omega}_{\mathrm{h}})\mathrm{d}{\bm\omega}_{\mathrm{h}}}\, . \end{align} 这恰是\citet{10.1145/344779.344814}在法线和遮挡独立性假设下 -得到的掩模函数的精确积分形式。 +得到的掩模函数的精确积分形式。然而其中的积分是在法线分布空间中进行的, +计算起来并不方便。我们可以将其积分域转化到斜率分布空间以简化它,下面给出具体推导。 +对于曲面上某处的法线${\bm\omega}_{\mathrm{h}}$, +设它在直角坐标系下和球面坐标系下具体的分量为 +\begin{align} + {\bm\omega}_{\mathrm{h}}=(x_{\mathrm{h}},y_{\mathrm{h}},z_{\mathrm{h}}) + =(\sin\theta\cos\varphi,\sin\theta\sin\varphi,\cos\theta)\, , +\end{align} +则该处附近的面元可以近似为以下平面 +\begin{align} + x_{\mathrm{h}}x+y_{\mathrm{h}}y+z_{\mathrm{h}}z=C\, . +\end{align} +其中$C$为某个常量,于是有 +\begin{align} + z=\left(-\frac{x_{\mathrm{h}}}{z_{\mathrm{h}}}, + -\frac{y_{\mathrm{h}}}{z_{\mathrm{h}}}\right)\cdot(x,y)+C\, , +\end{align} +我们由此定义 +\begin{align} + {\bm s}({\bm\omega}_{\mathrm{h}})=(x_s,y_s) + =\left(-\frac{x_{\mathrm{h}}}{z_{\mathrm{h}}}, + -\frac{y_{\mathrm{h}}}{z_{\mathrm{h}}}\right) + =-\tan\theta(\cos\varphi,\sin\varphi) +\end{align} +为曲面在该处的斜率 +\sidenote{原文slope,这里作者想表达的是$z$对$x$和$y$的偏导数, + 它和二维直角坐标系下直线斜率的形式很像,所以借用这个称呼。}。 +反之,也可以根据斜率求出相应法线为 +\begin{align} + {\bm\omega}_{\mathrm{h}}=\frac{1}{\sqrt{x_s^2+y_s^2+1}}(-x_s,-y_s,1)\, . +\end{align} + +接下来我们考虑斜率分布$P_{xy}({\bm s})$与法线分布 +(即微面分布函数)$D({\bm\omega}_{\mathrm{h}})$之间的关系。 +显然$P_{xy}({\bm s})$应满足规范化约束, +即它在$x_s\in(-\infty,+\infty),y_s\in(-\infty,+\infty)$范围内非负,且有 +\begin{align} + \int_{-\infty}^{+\infty}\int_{-\infty}^{+\infty} + P_{xy}(x_s,y_s)\mathrm{d}x_s\mathrm{d}y_s=1\, . +\end{align} +将上式和\refeq{08ex01-McrofacetDistributionNormalization}比对,可得 +\begin{align}\label{eq:08-ex01-P2D} + P_{xy}(x_s,y_s)\mathrm{d}x_s\mathrm{d}y_s= + \cos\theta D({\bm\omega}_{\mathrm{h}})\mathrm{d}{\bm\omega}_{\mathrm{h}}\, . +\end{align} +根据三维球面坐标转换公式,有 +\begin{align}\label{eq:08-ex01-D_sphere} + D({\bm\omega}_{\mathrm{h}})\mathrm{d}{\bm\omega}_{\mathrm{h}} + =\sin\theta D({\bm\omega}_{\mathrm{h}})\mathrm{d}\theta\mathrm{d}\varphi\, . +\end{align} +而斜率坐标对法线的球面坐标的雅可比矩阵为 +\begin{align} + J=\displaystyle\frac{\partial(x_s,y_s)}{\partial(\theta,\varphi)} + =\displaystyle\left[\begin{array}{cc} + \displaystyle\frac{\partial x_s}{\partial \theta} & + \displaystyle\frac{\partial x_s}{\partial \varphi} \\ + \displaystyle\frac{\partial y_s}{\partial \theta} & + \displaystyle\frac{\partial y_s}{\partial \varphi} + \end{array}\right] + =\displaystyle\left[\begin{array}{rr} + \displaystyle -\frac{\cos\varphi}{\cos^2\theta} & + \displaystyle \tan\theta\sin\varphi \\ + \displaystyle -\frac{\sin\varphi}{\cos^2\theta} & + \displaystyle -\tan\theta\cos\varphi + \end{array}\right]\, , +\end{align} +于是雅可比行列式为 +\begin{align} + |J|=\frac{\tan\theta}{\cos^2\theta}\, . +\end{align} +结合\refeq{08-ex01-P2D}和\refeq{08-ex01-D_sphere}得 +\begin{align} + P_{xy}(x_s,y_s)\mathrm{d}x_s\mathrm{d}y_s + =|J|P_{xy}(x_s,y_s)\mathrm{d}\theta\mathrm{d}\varphi + =\sin\theta\cos\theta D({\bm\omega}_{\mathrm{h}})\mathrm{d}\theta\mathrm{d}\varphi\, . +\end{align} +所以斜率分布与法线分布的关系为 +\begin{align} + P_{xy}(x_s,y_s)=\frac{\sin\theta\cos\theta}{|J|}D({\bm\omega}_{\mathrm{h}}) + =\cos^4\theta D({\bm\omega}_{\mathrm{h}})\, . +\end{align} \subsection{典型微面分布函数的规范性证明}\label{sub:典型微面分布函数的规范性证明} 本节补充了\refeq{8.10}和\refeq{8.11}所给的