Pathtracinginproduction
Total Page:16
File Type:pdf, Size:1020Kb
Path tracing in Production Part 1: Modern Path Tracing Luca F������� (Organizer) Johannes H����� (Organizer) Weta Digital Weta Digital Daniel H��������� Christopher K���� Marc D����� Jorge S����������� Animal Logic Sony Imageworks Weta Digital Weta Digital SIGGRAPH 2019 Course Notes Imagery from recent movie productions, featuring difficult light transport, massive geometric complexity, intricate material detail, as well as volumetric effects. The LEGO Movie 2: The Second Part Image courtesy of Animal Logic, ©2019 Warner Bros. Entertainment Inc. ©The LEGO Group. All rights reserved. Spiderman: Homecoming ©2017 CTMG, Inc. All rights reserved. Alita: Battle Angel ©2018 Twentieth Century Fox Film Corporation. All rights reserved. Permission to make digital or hard copies of part or all of this work for personal or class- room use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for third-party components of this work must be honored. For all other uses, con- tact the Owner/Author. Copyright is held by the owner/author(s). SIGGRAPH ’19 Courses, July 28 - August 01, 2019, Los Angeles, CA, USA ACM 978-1-4503-6307-5/19/07. 10.1145/3305366.3328079 P��� ������� �� P��������� Abstract In the past few years the movie industry has switched over from stochastic rasterisation approaches to using phys- ically based light transport simulation: path tracing in production has become ubiquitous across studios. The new approach came with undisputed advantages such as consistent lighting,progressive previews,and fresh code bases. But also abandoning 30 years of experience meant some hard cuts affecting all stages such as lighting, look devel- opment, geometric modelling, scene description formats, the way we schedule for multi-threading, just to name a few. This means there is a rich set of people involved and as an expert in either one of these aspects it is easy to lose track of the big picture. This is part I of a full-day course,and it focuses on the necessary background knowledge. In this part,we would like to provide context for everybody interested in understanding the challenges behind writing renderers intended for movie production work. In particular we will give an insight into movie production requirements for new students and academic researchers. On the other side we will lay a solid mathematical foundation to develop new ideas to solve problems in this context. To further illustrate, part II of the course will focus on materials (acquisition and production requirements) and showcase practical efforts by prominent professionals in the field,pointing out unexpected challenges encountered in new shows and unsolved problems as well as room for future work wherever appropriate. SIGGRAPH 2019 Course Notes: Path tracing in Production — Part 1 Page 2 / 105 P��� ������� �� P��������� Contents 1 Introduction to path tracing and Monte Carlo sampling 4 1.1 Transport equations ........................................ 4 1.1.1 Assumptions ....................................... 4 1.1.2 Counting photons ..................................... 4 1.1.3 Events that change photon count ............................. 6 1.1.4 The radiative transfer equation .............................. 8 1.2 The path space ........................................... 9 1.3 The Monte Carlo method ...................................... 11 1.4 Colour formation in a renderer ................................... 12 1.4.1 Colour reproduction ................................... 12 1.4.2 Where to get input spectra from .............................. 13 1.4.3 Colour noise ........................................ 14 1.4.4 Importance sampling ................................... 14 1.4.5 Radiometry vs. Photometry ................................ 15 1.5 Path construction techniques .................................... 16 1.5.1 Path tracing ........................................ 16 1.5.2 Next event estimation ................................... 16 1.5.3 Light tracing ........................................ 16 1.5.4 Photon mapping-based approaches ............................ 17 1.5.5 Markov chain-based methods ............................... 17 1.6 Conclusion ............................................. 18 2 Monte Carlo integration 22 2.1 Introduction: a holistic look at integration theory ......................... 22 2.2 Problem statement ......................................... 23 2.2.1 The Riemann integral ................................... 23 2.2.2 Integrable functions .................................... 24 2.2.3 Interlude: the Fundamental Theorem of Calculus ..................... 26 2.2.4 The Lebesgue integral ................................... 26 2.2.5 A topological interlude .................................. 28 2.2.6 Integrals in higher dimensions .............................. 30 2.3 Numerical integration ....................................... 31 2.3.1 Lagrange interpolation .................................. 32 2.3.2 Improving convergence for numerical quadrature .................... 34 2.3.3 Integrals in higher dimensions .............................. 35 2.4 Monte Carlo integration ...................................... 36 2.4.1 Estimation error in Monte Carlo integration ....................... 36 2.4.2 Interlude: random number generation .......................... 37 2.4.3 Variance reduction techniques .............................. 37 2.4.4 Quasi-Random sequences and Monte Carlo ....................... 39 2.4.5 A quality metric on sequences ............................... 40 2.4.6 Error bounds ....................................... 41 2.5 Markov chain Monte Carlo ..................................... 42 2.5.1 Discussion ......................................... 43 Appendices 43 2.A Riemann on Riemann’s integral ................................... 43 SIGGRAPH 2019 Course Notes: Path tracing in Production — Part 1 Page 1 / 105 P��� ������� �� P��������� 3 A modular path sampling framework 47 3.1 Path integral formulation including participating media ...................... 47 3.2 Computing the integral ....................................... 49 3.2.1 The Monte Carlo approach ................................ 49 3.2.2 Multiple Importance Sampling .............................. 50 3.2.3 Practical MIS ....................................... 50 3.3 Path sampling technique zoo .................................... 52 3.3.1 Path extensions ...................................... 52 3.3.2 Splitting .......................................... 53 3.3.3 Shift mappings ....................................... 54 3.3.4 Markov-Chain methods et al. ............................... 54 3.3.5 Multi spectral sampling .................................. 55 3.3.6 Local techniques - path guiding .............................. 55 3.3.7 Discussion ......................................... 55 3.4 Modular light transport via the vertex graph ............................ 56 3.4.1 Path extensions ...................................... 56 3.4.2 Shift techniques ...................................... 57 3.4.3 Volumes and Transparency ................................ 58 3.4.4 Photon mapping / VCM .................................. 58 3.4.5 Memory management ................................... 60 3.4.6 Discussion ......................................... 60 4 Finding good paths 64 4.1 Path reconnection techniques for stereoscopic rendering and distribution effects ......... 64 4.1.1 Multi-view rendering ................................... 65 4.1.2 Primary path reconnection ................................ 65 4.1.3 Higher dimensions .................................... 66 4.1.4 Motion Blur ........................................ 67 4.1.5 Computing path throughput ............................... 67 4.1.6 Adapting to projected velocity ............................... 68 4.1.7 Depth of Field ....................................... 69 4.1.8 Simultaneous effects .................................... 70 4.1.9 Summary ......................................... 70 4.2 Efficient next-event estimation in Manuka ............................. 70 4.2.1 A history of NEE in Manuka ............................... 71 4.2.2 Building a light hierarchy ................................. 72 4.2.3 Sampling the light hierarchy ................................ 74 4.2.4 Occlusion and radiance biasing .............................. 76 4.2.5 Product sampling ..................................... 78 4.2.6 Summary ......................................... 79 5 Volumes 81 5.1 Intersecting Rays with Volumes .................................. 81 5.1.1 Dealing with Overlap ................................... 82 5.1.2 Aggregate Volumes .................................... 83 5.1.3 Boundary Driven Volumes ................................ 83 5.2 Light Transport in Volumes .................................... 84 5.2.1 Sampling homogeneous transmittance .......................... 85 5.2.2 Sampling heterogeneous transmittance .......................... 87 5.2.3 Next Event Estimation in Volumes ............................ 90 5.2.4 Beyond single scattering .................................. 92 5.2.5 Emissive Volumes ..................................... 94 SIGGRAPH 2019 Course Notes: Path tracing in Production — Part 1 Page 2 / 105 P��� ������� �� P��������� 5.3 Production Features ........................................ 95 5.3.1 Large Datasets ....................................... 95 5.3.2