Advanced Pathtracer with MIS

本文介绍了一个基于Kajiya渲染方程的高级路径追踪器,通过直接/间接分离(Next Event Estimation)、俄罗斯轮盘赌采样、重要性采样和多重重要性采样等技术提升渲染质量。分离直接和间接光能更有效地计算全局光照。俄罗斯轮盘赌用于决定路径何时终止,选择适当的继续概率以保留高能量路径。文中详细探讨了各种BRDF的采样方法,如常数PDF、余弦PDF、改良Phong BRDF和GGX微面BRDF,并介绍了如何将GGX微面BRDF转换为PDF。最后,文章介绍了多重重要性采样,通过结合不同采样方法并使用权重函数优化采样效率。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >


Introduction

The entire pathtracer is based on the following rendering equation that is originally from the paper Kajiya, James T. “The rendering equation.” ACM SIGGRAPH computer graphics. Vol. 20. No. 4. ACM, 1986. and implemented based on book Physically based rendering: From theory to implementation. Multiple techniques are added to enhance the rendering quality.
L r ( x , ω o ) = L e ( x , ω o ) + ∫ Ω f ( x , ω i , ω o ) L d i r ( x , ω i ) ( n ⋅ ω i ) d ω i + ∫ Ω f ( x , ω i , ω o ) L i n d ( x , ω i ) ( n ⋅ ω i ) d ω i L_r(\bm x, \bm \omega_o) = L_e(\bm x, \bm \omega_o) + \int\limits_\Omega f(\bm x, \bm \omega_i, \bm \omega_o) L_{dir}(\bm x, \bm \omega_i) (\bm n \cdot \bm \omega_i)d\bm \omega_i + \int\limits_\Omega f(\bm x, \bm \omega_i, \bm \omega_o) L_{ind}(\bm x, \bm \omega_i)(\bm n \cdot \bm \omega_i)d\bm \omega_i Lr(x,ωo)=Le(x,ωo)+Ωf(x,ωi,ωo)Ldir(x,ωi)(nωi)dωi+Ωf(x,ωi,ωo)Lind(x,ωi)(nωi)dωi


Direct/Indirect Separation (Next Event Estimation)

The direct light part can be estimated as following:
L d ( x , ω o ) = ∫ Ω f ( x , ω i , ω o ) L d i r ( x , ω i ) ( n ⋅ ω i ) d ω i ≈ L e A N ∑ k = 1 N f ( x , ω i ( k ) , ω o ) G ( x , x k ′ ) V ( x , x k ′ ) L_d(\bm x, \bm \omega_o) = \int\limits_\Omega f(\bm x, \bm \omega_i, \bm \omega_o) L_{dir}(\bm x, \bm \omega_i) (\bm n \cdot \bm \omega_i) d\bm \omega_i\approx L_e \frac{A}{N} \sum_{k=1}^{N} f(\bm x, \bm \omega_i(k), \bm \omega_o) G(\bm x, \bm x'_k) V(\bm x, \bm x'_k) Ld(x,ωo)=Ωf(x,ωi,ωo)Ldir(x,ωi)(nωi)dωiLeNAk=1Nf(x,ωi(k),ωo)G(x,xk)V(x,xk)
The indirect light part can be estimated as following:
L I = ∫ Ω f ( x , ω i , ω o ) L i n d ( x , ω i ) ( n ⋅ ω i ) d ω i ≈ 2 π N ∑ k = 1 N f ( x , ω i ( k ) , ω o ) L o ( t ( x , ω i ( k ) ) , − ω i ( k ) ) ( n ⋅ ω i ( k ) ) , L_I = \int\limits_\Omega f(\bm x, \bm \omega_i, \bm \omega_o) L_{ind}(\bm x, \bm \omega_i) (\bm n \cdot \bm \omega_i) d\bm \omega_i\approx \frac{2\pi}{N} \sum_{k=1}^{N} f(\bm x, \bm \omega_i(k), \bm \omega_o) L_o(t(\bm x, \bm \omega_i(k)), -\bm \omega_i(k)) (\bm n \cdot \bm \omega_i(k)), LI=Ωf(x,ωi,ωo)Lind(x,ωi)(nωi)dωiN2πk=1Nf(x,ωi(k),ωo)Lo(t(x,ωi(k)),ωi(k))(nωi(k)),
By separating direct light and indirect light, we can estimate the next event corresponding to the light source for direct, and focus the energies on the hard part in path tracing, which is computing the indirect light or the global illumination.
NEE Simulation

Russian Roulette

Russian Roulette is a technique the pathtracer used to determine which light path will be terminated before it reaches the light source. This technique is simplified from the paper Arvo, James, and David Kirk. “Particle transport and image synthesis.” ACM SIGGRAPH Computer Graphics 24.4 (1990): 63-66.

Theory

We can select a termination probability 𝑞 to use for each intersection, then account for the lost energy of terminated paths by boosting the energy of the surviving paths. We can do this by increasing the throughputs 𝑇 of each surviving path by a factor of 1 1 − q \frac{1}{1-q} 1q1. The result is that the expected energy for a large number of paths stays constant regardless of our choice of 𝑞 .
Example of Russian Roulette

Implementation

We can choose an arbitrary constant termination probability, but a better idea would be to select a continuation probability ( 1−𝑞 ) at each Russian roulette event which is proportional to the path’s current throughput. This way, we terminate most low-throughput paths and retain most high-throughput paths. Thus, the termination probability is calculated as following:
q = 1 − m i n ( m a x ( T r , T g , T b ) , 1 ) q = 1 - min(max(T_r, T_g, T_b), 1) q=1min(max(Tr,Tg,Tb),1)

Importance Sampling

A Monte Carlo estimator can be used to approximate the integral of some function f ( x ) f(x) f(x) using many samples x k x_k xk . The samples are drawn from some probability density function p d f pdf pdf, which is incorporated into the estimator as shown below. We are free to choose any p d f pdf

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值