首页 > 其他分享 >Unbiased Warped-Area Sampling for Differentiable Rendering

Unbiased Warped-Area Sampling for Differentiable Rendering

时间:2022-09-26 20:56:20浏览次数:57  
标签:field partial Area integral Differentiable Unbiased theorem theta boundary

渲染方程\(I(\theta) = \int_D f(w,\theta)dw\)。其中\(D\)是某个积分域(比如半球空间),\(\theta\)是场景参数,比如(顶点位置,材质参数等等)。对于可微分渲染,我们实际上感兴趣的是计算导数\(\partial_{\theta}I\)。
由于\(f(w,\theta)\)关于参数\(\theta\)是不连续的,所以直接将求导算子移到积分内部的结果是错误的。
实际上,可以把积分域\(D\)划为为多个不相交的子区域\(D_0(\theta),D_1(\theta),D_2(\theta)...\)使得被积函数\(f(x;\theta)\)在每个子区域的内部都是连续的,这样,所有的不连续都发生在边界上。
image
这个时候,我们的\(\partial_{\theta}I\)就可以等于
image
这样,在每个积分域\(D_i(\theta)\)上,被积函数\(f(w,\theta)\)关于\(\theta\)都是连续的,但是这个时候,积分域就和\(\theta\)有了联系。在一维情况下,就是莱布尼兹(Leibniz’s integral rule)公式
image
更高维的空间就是雷诺传输定理(Reynolds transport theorem)
image
于是,我们就进一步得到
image
把第一项叫做内部项interior derivative integral,第二项叫做边界项boundary derivative integral

这里是\(f(w;\theta)\),但是好像看其他地方又是写着\(\Delta f(w;\theta)\),代码里面也是用的\(\Delta f\),如下

SpectrumC delta_L = Li(scene, scene.m_samplers[1], edge_samples.ray_n, valid) - 
                    Li(scene, scene.m_samplers[1], edge_samples.ray_p, valid);
SpectrumD value = edge_samples.x_dot_n*SpectrumD(delta_L/edge_samples.pdf);

image
image

Divergence theorem

本文的工作就是将boundary integral改写成interior integral,根据Divergence theorem,他们的关系可以表示为
image

又开始蒙圈了,以前学高数的时候只记得公式怎么求了,物理意义不了解。字母具体代表啥也搞不太懂了

这个时候,直接运用Divergence theorem得到
image
论文里面的图4是这个,也没看懂233333
image

其中warp field\(\hat{V}_{\theta}(x)\)是boundary velocity\(\partial_{\theta}S\)的smooth interpolation。
也就是说,warp field\(\hat{V}_{\theta}(x)\)只需要满足两个条件,上述等式就可以成立。连续以及在boundary上面等于boundary velocity\(\partial_{\theta}S\)
image

考虑场景是二维情况下的,积分域\(D\)就是一维的,
image
通过自动微分,我们可以得到有\(y, \partial_{\theta}(y),\partial_{w}(y)\)。然后我们可以定义warp field\(\hat{V}_{\theta}(w) = \frac{\partial_{\theta}(y)}{\partial_{w}(y)}\),这样可以保证满足条件1在boundary处是等于boundary velocity \(\partial_{\theta}(w_b)\)
image
但是这并不是连续的,warp field的定义依赖于相交点y点。也就是其他没相交的点的field为0。

于是第二个优化的想法是加个高斯filter
image

这个时候warp field虽然连续了,但是又不满足第一个条件了
image

最后一步优化就是把高斯filter函数改为一个与w挂钩的filter,
image
确保\(w\prime = w\)时,这个filter类似一个delta函数,就可以满足条件1了
image

后记

论文中不太理解的公式在于雷诺传输定理和divergent theorem。

标签:field,partial,Area,integral,Differentiable,Unbiased,theorem,theta,boundary
From: https://www.cnblogs.com/wakuwaku/p/diff_Warped-Area_Sampling.html

相关文章