# 路径追踪

路径追踪是一种蒙特卡罗渲染算法，它通过从相机出发、穿越场景追踪大量随机光路，来估计到达每个像素的光量，从而生成基于物理的真实感图像。与递归光线追踪在每个表面分叉出一棵光线树不同，路径追踪器在每个样本中只沿一条随机分支前进；梶谷（Kajiya）正是因此为该技术命名。它覆盖了赫克伯特（Heckbert）记号中所有 L(S|D)*E 形式的光传输路径，包括漫反射与镜面互反射、软阴影、景深和运动模糊。<sup>[1](https://dl.acm.org/doi/10.1145/15886.15902)</sup><sup> • </sup><sup>[2](https://courses.compute.dtu.dk/02941/slides/02941_slides_05_path_tracing.pdf)</sup> 它是图形学中第一个通用的无偏蒙特卡罗光传输算法<sup>[3](https://www.pbr-book.org/3ed-2018/Light_Transport_I_Surface_Reflection/Path_Tracing)</sup>，如今已成为电影制作的首选渲染技术。<sup>[4](https://cs.dartmouth.edu/~wjarosz/publications/christensen16path.pdf)</sup>

| 关键事实 | 内容 |
|---|---|
| 提出者 | 詹姆斯·T·梶谷（James T. Kajiya），《渲染方程》，ACM SIGGRAPH Computer Graphics，1986 年，第 143–150 页<sup>[1](https://dl.acm.org/doi/10.1145/15886.15902)</sup> |
| 覆盖的光路 | 所有 L(S|D)*E 路径（相机与光源之间任意表面散射事件序列）<sup>[2](https://courses.compute.dtu.dk/02941/slides/02941_slides_05_path_tracing.pdf)</sup> |
| 收敛性 | 标准差按 \( \Theta(1/\sqrt{N}) \) 下降；误差减半需要 4 倍样本<sup>[5](https://www.cg.tuwien.ac.at/research/publications/2019/celarek_adam-2019-qelta/celarek_adam-2019-qelta-paper_preprint.pdf)</sup><sup> • </sup><sup>[6](https://ocw.mit.edu/courses/6-837-computer-graphics-fall-2012/1b5985f78c68379e15543fe27d41b72c_MIT6_837F12_Lec18.pdf)</sup> |
| 每像素样本数 | 高质量结果需数百至数千<sup>[3](https://www.pbr-book.org/3ed-2018/Light_Transport_I_Surface_Reflection/Path_Tracing)</sup> |
| 偏差 | 无偏；误差表现为噪声，随样本增多而平均掉<sup>[7](https://cseweb.ucsd.edu/~viscomp/classes/cse168/sp24/lectures/168-lecture7.pdf)</sup> |
| 关键方差工具 | 下一事件估计配合多重重要性采样、俄罗斯轮盘赌、路径引导、ReSTIR<sup>[8](https://www.pbr-book.org/4ed/Light_Transport_I_Surface_Reflection/A_Better_Path_Tracer)</sup> |
| 已知弱点 | 焦散与镜面–漫反射–镜面（SDS）路径收敛很差<sup>[9](https://imaging.cs.cmu.edu/15-468/2023_spring/lectures/lecture_13.pdf)</sup> |

## 工作原理

支配方程是梶谷的渲染方程。其表面形式下，某点的出射辐射亮度为

\[ L_{o}(x, \omega) = L_{e}(x, \omega) + \int_{\Omega} f_{r}(x, \omega', \omega) \, L_{i}(x, \omega') \cos\theta \, d\omega', \]

即自发光加上半球上入射辐射亮度经 BRDF \( f_{r} \) 和余弦缩短项加权的积分。<sup>[2](https://courses.compute.dtu.dk/02941/slides/02941_slides_05_path_tracing.pdf)</sup> 梶谷的原始形式 \( I(x,x') = g(x,x')\left[ e(x,x') + \int \rho(x,x',x'') I(x',x'') \, dx'' \right] \) 将表面点之间的传输强度表达为自发光加上来自所有其他表面点的散射。<sup>[1](https://dl.acm.org/doi/10.1145/15886.15902)</sup> 解析解通常不可能，因此积分必须通过离散化或蒙特卡罗积分求解。<sup>[6](https://ocw.mit.edu/courses/6-837-computer-graphics-fall-2012/1b5985f78c68379e15543fe27d41b72c_MIT6_837F12_Lec18.pdf)</sup>

路径追踪通过对随机样本取平均来估计积分：每个采样方向 \( \omega' \) 贡献 \( f_{r} \cdot L_{i} \cdot \cos\theta / \mathrm{pdf}(\omega') \)，对 \( N \) 个方向取平均即收敛到真值。<sup>[2](https://courses.compute.dtu.dk/02941/slides/02941_slides_05_path_tracing.pdf)</sup> 对于每像素方差有限的无偏算法，中心极限定理将标准差的渐近收敛速率固定为 \( \Theta(1/\sqrt{N}) \)，其中 \( N \) 是计算预算。<sup>[5](https://www.cg.tuwien.ac.at/research/publications/2019/celarek_adam-2019-qelta/celarek_adam-2019-qelta-paper_preprint.pdf)</sup> 估计量是无偏的，因此其唯一误差是随样本增多而缩小的噪声，但平方根收敛很慢：方差正比于 \( 1/N \)，所以误差减半需要 4 倍样本。<sup>[7](https://cseweb.ucsd.edu/~viscomp/classes/cse168/sp24/lectures/168-lecture7.pdf)</sup><sup> • </sup><sup>[6](https://ocw.mit.edu/courses/6-837-computer-graphics-fall-2012/1b5985f78c68379e15543fe27d41b72c_MIT6_837F12_Lec18.pdf)</sup>

## 实现方法

每像素每样本，单向路径追踪器执行以下循环：<sup>[10](https://www.cs.cornell.edu/courses/cs5630/2026sp/slides/12pathtr2.pdf)</sup>

1. **相机光线。** 从相机穿过像素投射一条光线。
2. **增量式路径构建。** 在每个交点处，从 BSDF 采样新方向并延伸路径，累积路径吞吐量权重 \( \beta \)，即至今每个顶点处 BSDF 值与余弦项之积除以采样 PDF。<sup>[3](https://www.pbr-book.org/3ed-2018/Light_Transport_I_Surface_Reflection/Path_Tracing)</sup>
3. **下一事件估计。** 在每个顶点处，随机选择一个光源，投射阴影射线判断可见性，计算朝向该光源的 BRDF，除以采样 PDF，再乘以吞吐量。<sup>[11](https://developer.download.nvidia.com//ray-tracing-gems/rtg2-chapter14-preprint.pdf)</sup> 同时采样 BSDF 和光源，并用多重重要性采样将两者结合——每项贡献除以两个 PDF 之和——相比仅采样光源可大幅降低方差。<sup>[8](https://www.pbr-book.org/4ed/Light_Transport_I_Surface_Reflection/A_Better_Path_Tracer)</sup><sup> • </sup><sup>[10](https://www.cs.cornell.edu/courses/cs5630/2026sp/slides/12pathtr2.pdf)</sup>
4. **俄罗斯轮盘赌。** 经过若干次弹射后，根据吞吐量亮度以一定概率终止路径，概率上限为 0.95，路径存活时将吞吐量除以 \( 1 - q \)；存活路径被重新加权，因此估计保持无偏。<sup>[3](https://www.pbr-book.org/3ed-2018/Light_Transport_I_Surface_Reflection/Path_Tracing)</sup><sup> • </sup><sup>[11](https://developer.download.nvidia.com//ray-tracing-gems/rtg2-chapter14-preprint.pdf)</sup>
5. **累积。** 实现通常是迭代而非递归的：循环弹射、保留吞吐量、累积辐射亮度。<sup>[10](https://www.cs.cornell.edu/courses/cs5630/2026sp/slides/12pathtr2.pdf)</sup> 渐进式渲染器按 \( L_{j+1} = (L_{\text{new}} + j \cdot L_{j})/(j+1) \) 更新每个像素，因此渲染可随时停止查看。<sup>[2](https://courses.compute.dtu.dk/02941/slides/02941_slides_05_path_tracing.pdf)</sup>

点光源和理想镜面等德尔塔分量没有概率密度；渲染器改为以有限概率在德尔塔部分和平滑部分之间选择。<sup>[10](https://www.cs.cornell.edu/courses/cs5630/2026sp/slides/12pathtr2.pdf)</sup>

## 起源

梶谷于 1986 年 8 月在 ACM SIGGRAPH Computer Graphics 第 20 卷第 4 期第 143–150 页发表了《渲染方程》。<sup>[1](https://dl.acm.org/doi/10.1145/15886.15902)</sup> 文中他引入了路径追踪，用可追溯到冯·诺依曼和乌拉姆的蒙特卡罗方法求解该方程，并提出了一种称为分层采样的新方差缩减形式；他的实现每像素固定发射 40 条路径。<sup>[1](https://dl.acm.org/doi/10.1145/15886.15902)</sup> 他肯定了库克（Cook）、波特（Porter）和卡彭特（Carpenter）于 1984 年提出的分布式光线追踪所采用的类蒙特卡罗技术，但该工作未解决环境项。<sup>[1](https://dl.acm.org/doi/10.1145/15886.15902)</sup> 前驱工作有详细记载：1980 年特纳·惠特德（Turner Whitted）的递归光线追踪，<sup>[12](https://doi.org/10.1145/358876.358882)</sup> 1984 年库克及其同事的分布式光线追踪，<sup>[13](https://doi.org/10.1145/964965.808590)</sup> 1984 年戈拉尔（Goral）、托兰斯（Torrance）、格林伯格（Greenberg）和巴塔耶（Battaile）针对漫反射表面的辐射度方法，<sup>[14](https://doi.org/10.1145/964965.808601)</sup> 以及 1990 年赫克伯特的 L/S/D/E 路径分类。<sup>[15](https://doi.org/10.1145/97880.97895)</sup> 蒙特卡罗根源可追溯到 1940 年代的中子输运模拟，其与图形学中粒子输运的联系后来由阿尔沃（Arvo）和柯克（Kirk）巩固。<sup>[4](https://cs.dartmouth.edu/~wjarosz/publications/christensen16path.pdf)</sup> 埃里克·维奇（Eric Veach）1997 年的博士论文《光传输模拟的稳健蒙特卡罗方法》（与[莱昂尼达斯·吉巴斯](https://www.edgepedia.org/zh/leonidas-guibas)（Leonidas Guibas）合作）后来形式化了路径空间视角和多重重要性采样。<sup>[4](https://cs.dartmouth.edu/~wjarosz/publications/christensen16path.pdf)</sup>

## 变体

**双向路径追踪（BDPT）。** 从光源生成一条子路径、从眼睛生成一条子路径并将它们连接；改变两侧顶点数可得到适用于各种长度路径的采样技术族，再用多重重要性采样结合。<sup>[16](https://graphics.stanford.edu/courses/cs348b-03/papers/veach-chapter10.pdf)</sup> 拉福琼（Lafortune）和威廉姆斯（Willems）于 1993 年独立描述了该算法；维奇框架中的主要区别在于可证明良好的 MIS 组合策略。<sup>[16](https://graphics.stanford.edu/courses/cs348b-03/papers/veach-chapter10.pdf)</sup>

**梅特罗波利斯光传输（MLT）。** 由埃里克·维奇和莱昂尼达斯·J·吉巴斯在 SIGGRAPH 97 上提出，MLT 是一种无偏方法，通过随机变异单条当前光路来渲染，以精心选择的概率接受或拒绝变异；在明亮间接光、小孔和焦散等困难问题上，它可比先前的无偏方法高效数个数量级。<sup>[17](https://graphics.stanford.edu/papers/metro/)</sup>

**路径引导。** 实用路径引导用自适应 SD 树——对三维空间做二叉划分、对方向做四叉树——学习近似的空间–方向辐射亮度场，并以无偏、迭代的方式采样入射辐射亮度；其唯一可调参数是最大内存占用。<sup>[18](https://la.disneyresearch.com/wp-content/uploads/Practical-Path-Guiding-for-Efficient-Light-Transport-Simulation-Paper.pdf)</sup> 引导方向与 BSDF 样本及下一事件估计通过多重重要性采样结合，因此方差不会比纯 BSDF 采样差太多。<sup>[18](https://la.disneyresearch.com/wp-content/uploads/Practical-Path-Guiding-for-Efficient-Light-Transport-Simulation-Paper.pdf)</sup>

**ReSTIR。** 基于蓄水池的时空重要性重采样在像素和帧之间复用优质样本，建立在重采样重要性采样之上；一个像素的好路径往往对邻居也有用，从而以大约一个样本的代价获得相当于每像素数百个独立样本的图像质量。<sup>[19](https://intro-to-restir.cwyman.org/presentations/2023ReSTIR_Course_Notes.pdf)</sup>

## 应用

直到 2016 年之前约十年，暴力路径追踪对电影制作而言噪声过大、速度过慢；更好的采样、渲染和降噪使其成为首选的电影渲染技术。<sup>[4](https://cs.dartmouth.edu/~wjarosz/publications/christensen16path.pdf)</sup>

2023 年以来，焦点转向 GPU 上的实时路径追踪。ReSTIR PT 让某像素采样的路径与其他像素及先前帧的路径重新连接，大幅提高每像素有效样本数，但输出仍需送入专用降噪器，并辅以表面位置、法线和材质缓冲，因为仅靠累积对实时而言太慢。<sup>[20](https://github.com/NVIDIA-RTX/RTXDI/blob/main/Doc/RestirPT.md)</sup> 英伟达（NVIDIA）的 RTX 路径追踪 SDK 是纯路径追踪器，不含光栅化，利用光源采样缓存在单次光线追踪通道中评估所有光传输，集成了 ReSTIR DI 和 ReSTIR GI、用于下一事件估计的引导重要性采样、降噪器和萤火虫滤波器。<sup>[21](https://github.com/NVIDIAGameWorks/Path-Tracing-SDK)</sup>

## 局限与替代方案

**焦散与 SDS 路径。** 在赫克伯特的分类中，路径追踪对焦散路径（LS+DE）处理很差或根本无法处理。<sup>[9](https://imaging.cs.cmu.edu/15-468/2023_spring/lectures/lecture_13.pdf)</sup> 双向路径追踪对镜面–漫反射–镜面（SDS）路径同样低效，例如透过反射或折射看到的焦散，因为顶点连接无法连接镜面顶点，而单向采样必须随机命中光源。<sup>[22](https://cgg.mff.cuni.cz/~jaroslav/papers/2014-ltstutorial/04%20-%20ltstutorial%20-%20ppm+bpt%20-%20georgiev%20-%20notes.pdf)</sup> 制作级渲染器通过路径空间正则化来缓解，即自适应地增加表面粗糙度，将确定性评估转为随机评估，该方法由卡普拉尼扬（Kaplanyan）和达克斯巴赫（Dachsbacher）提出。<sup>[23](https://blogs.autodesk.com/media-and-entertainment/wp-content/uploads/sites/162/Arnold_TOG2018.pdf)</sup><sup> • </sup><sup>[24](https://doi.org/10.1111/cgf.12026)</sup>

**光子映射。** 光子映射是两遍方法：先从光源追踪光子，然后渲染时对存储的光子图做密度估计。<sup>[25](https://cgvr.cs.uni-bremen.de/teaching/cg_literatur/APracticalGuideToRayTracingAndPhotonMapping.pdf)</sup> 它是有偏但一致的估计量；偏差表现为斑块状或模糊的伪影，只有在核半径趋于零且光子数无限时才消失，但它处理 SDS 等困难路径比无偏方法更稳健。<sup>[26](https://imaging.cs.cmu.edu/15-468/2023_spring/lectures/lecture_14.pdf)</sup> 渐进式光子映射（蜂须贺（Hachisuka）、大垣（Ogaki）和延森（Jensen），2008）逐步收缩核，减少内存并支持渐进式渲染。<sup>[27](https://doi.org/10.1145/1409060.1409083)</sup> 顶点连接与合并（格奥尔基耶夫（Georgiev）、克日瓦内克（Křivánek）、达维多维奇（Davidovič）和斯卢萨莱克（Slusallek），2012）结合了 BDPT 和光子映射，同时保留 BDPT 更高的收敛阶；然而顶点合并在本质上并不比单向采样对 SDS 路径更稳健，其优势在于高效复用光源子路径。<sup>[28](https://doi.org/10.1145/2366145.2366211)</sup><sup> • </sup><sup>[22](https://cgg.mff.cuni.cz/~jaroslav/papers/2014-ltstutorial/04%20-%20ltstutorial%20-%20ppm+bpt%20-%20georgiev%20-%20notes.pdf)</sup>

**有偏但一致的替代方案。** 噪声滤波、自适应采样和辐照度缓存是无偏蒙特卡罗家族的有偏但一致的扩展。<sup>[7](https://cseweb.ucsd.edu/~viscomp/classes/cse168/sp24/lectures/168-lecture7.pdf)</sup> 实践中，降噪已成为标准配套：即使有了 ReSTIR PT，实时系统仍依赖专用降噪器而非原始累积。<sup>[20](https://github.com/NVIDIA-RTX/RTXDI/blob/main/Doc/RestirPT.md)</sup>

## References

1. [The rendering equation (Kajiya, SIGGRAPH 1986)](https://dl.acm.org/doi/10.1145/15886.15902)
2. [Physically Based Rendering, Path Tracing slides (Frisvad, DTU, 2021)](https://courses.compute.dtu.dk/02941/slides/02941_slides_05_path_tracing.pdf)
3. [Physically Based Rendering (3rd ed.), Path Tracing chapter](https://www.pbr-book.org/3ed-2018/Light_Transport_I_Surface_Reflection/Path_Tracing)
4. [The Path to Path-Traced Movies (Christensen & Jarosz, SIGGRAPH 2016 course)](https://cs.dartmouth.edu/~wjarosz/publications/christensen16path.pdf)
5. [Quantifying the Error of Light Transport Algorithms (Celarek et al., 2019)](https://www.cg.tuwien.ac.at/research/publications/2019/celarek_adam-2019-qelta/celarek_adam-2019-qelta-paper_preprint.pdf)
6. [Global Illumination and Monte Carlo (MIT 6.837 lecture)](https://ocw.mit.edu/courses/6-837-computer-graphics-fall-2012/1b5985f78c68379e15543fe27d41b72c_MIT6_837F12_Lec18.pdf)
7. [CSE 168 Lecture 7: Monte Carlo Path Tracing (Ramamoorthi, UCSD, Spring 2024)](https://cseweb.ucsd.edu/~viscomp/classes/cse168/sp24/lectures/168-lecture7.pdf)
8. [Physically Based Rendering, 4th ed., A Better Path Tracer](https://www.pbr-book.org/4ed/Light_Transport_I_Surface_Reflection/A_Better_Path_Tracer)
9. [Rendering Algorithms: Bidirectional Path Tracing (CMU 15-468, Spring 2023, Lecture 13)](https://imaging.cs.cmu.edu/15-468/2023_spring/lectures/lecture_13.pdf)
10. [CS5630 Physically Based Rendering, Path Tracing 2 (Marschner, Cornell, Spring 2026)](https://www.cs.cornell.edu/courses/cs5630/2026sp/slides/12pathtr2.pdf)
11. [Ray Tracing Gems II, Chapter 14: The Reference Path Tracer](https://developer.download.nvidia.com//ray-tracing-gems/rtg2-chapter14-preprint.pdf)
12. [Turner Whitted (1980). An improved illumination model for shaded display. Communications of the ACM.](https://doi.org/10.1145/358876.358882)
13. [Robert L. Cook, Thomas Porter, Loren Carpenter (1984). Distributed ray tracing. ACM SIGGRAPH Computer Graphics.](https://doi.org/10.1145/964965.808590)
14. [Cindy M. Goral and colleagues (1984). Modeling the interaction of light between diffuse surfaces. ACM SIGGRAPH Computer Graphics.](https://doi.org/10.1145/964965.808601)
15. [Paul S. Heckbert (1990). Adaptive radiosity textures for bidirectional ray tracing. ACM SIGGRAPH Computer Graphics.](https://doi.org/10.1145/97880.97895)
16. [Bidirectional Path Tracing (Veach, PhD dissertation Chapter 10)](https://graphics.stanford.edu/courses/cs348b-03/papers/veach-chapter10.pdf)
17. [Metropolis Light Transport (Veach & Guibas, SIGGRAPH 97)](https://graphics.stanford.edu/papers/metro/)
18. [Practical Path Guiding for Efficient Light-Transport Simulation (Müller, Gross, Novák)](https://la.disneyresearch.com/wp-content/uploads/Practical-Path-Guiding-for-Efficient-Light-Transport-Simulation-Paper.pdf)
19. [A Gentle Introduction to ReSTIR (SIGGRAPH 2023 course notes)](https://intro-to-restir.cwyman.org/presentations/2023ReSTIR_Course_Notes.pdf)
20. [ReSTIR PT documentation (NVIDIA RTXDI)](https://github.com/NVIDIA-RTX/RTXDI/blob/main/Doc/RestirPT.md)
21. [NVIDIA RTX Path Tracing SDK (RTXPT)](https://github.com/NVIDIAGameWorks/Path-Tracing-SDK)
22. [Efficient Sampling for Progressive Global Illumination (Georgiev, SIGGRAPH course notes)](https://cgg.mff.cuni.cz/~jaroslav/papers/2014-ltstutorial/04%20-%20ltstutorial%20-%20ppm+bpt%20-%20georgiev%20-%20notes.pdf)
23. [Arnold: A Brute-Force Production Path Tracer (Fajardo et al., ACM TOG 2018)](https://blogs.autodesk.com/media-and-entertainment/wp-content/uploads/sites/162/Arnold_TOG2018.pdf)
24. [Anton S. Kaplanyan, Carsten Dachsbacher (2013). Path Space Regularization for Holistic and Robust Light Transport. Computer Graphics Forum.](https://doi.org/10.1111/cgf.12026)
25. [A Practical Guide to Global Illumination using Ray Tracing and Photon Mapping (Jensen)](https://cgvr.cs.uni-bremen.de/teaching/cg_literatur/APracticalGuideToRayTracingAndPhotonMapping.pdf)
26. [CMU 15-468 Lecture 14: Photon Mapping](https://imaging.cs.cmu.edu/15-468/2023_spring/lectures/lecture_14.pdf)
27. [Toshiya Hachisuka, Shinji Ogaki, Henrik Wann Jensen (2008). Progressive photon mapping. ACM Transactions on Graphics.](https://doi.org/10.1145/1409060.1409083)
28. [Iliyan Georgiev and colleagues (2012). Light transport simulation with vertex connection and merging. ACM Transactions on Graphics.](https://doi.org/10.1145/2366145.2366211)

---
*Initially written Sep 29, 2026 · Edited: Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 人工智能与数据 › Algorithms and computational methods › Numerical, string, and geometric algorithms › Numerical methods and approximation

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/path-tracing

English original: https://www.edgepedia.org/path-tracing
