Physically Based Rendering, fourth edition: From Theory to Implementation

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

Author(s): Matt Pharr, Wenzel Jakob, Greg Humphreys
Edition: 4
Publisher: The MIT Press
Year: 2023

Language: English

Copyright
PREFACE
CHAPTER 01. INTRODUCTION
1.1 Literate Programming
1.1.1 Indexing and Cross-Referencing
1.2 Photorealistic Rendering and the Ray-Tracing Algorithm
1.2.1 Cameras and Film
1.2.2 Ray–Object Intersections
1.2.3 Light Distribution
1.2.4 Visibility
1.2.5 Light Scattering at Surfaces
1.2.6 Indirect Light Transport
1.2.7 Ray Propagation
1.3 pbrt: System Overview
1.3.1 Phases of Execution
1.3.2 pbrt’s main() Function
1.3.3 Integrator Interface
1.3.4 ImageTileIntegrator and the Main Rendering Loop
1.3.5 RayIntegrator Implementation
1.3.6 Random Walk Integrator
1.4 How to Proceed through This Book
1.4.1 The Exercises
1.4.2 Viewing the Images
1.4.3 The Online Edition
1.5 Using and Understanding the Code
1.5.1 Source Code Organization
1.5.2 Naming Conventions
1.5.3 Pointer or Reference?
1.5.4 Abstraction versus Efficiency
1.5.5 pstd
1.5.6 Allocators
1.5.7 Dynamic Dispatch
1.5.8 Code Optimization
1.5.9 Debugging and Logging
1.5.10 Parallelism and Thread Safety
1.5.11 Extending the System
1.5.12 Bugs
1.6 A Brief History of Physically Based Rendering
1.6.1 Research
1.6.2 Production
Further Reading
Exercise
CHAPTER 02. MONTE CARLO INTEGRATION
2.1 Monte Carlo: Basics
2.1.1 Background and Probability Review
2.1.2 Expected Values
2.1.3 The Monte Carlo Estimator
2.1.4 Error in Monte Carlo Estimators
2.2 Improving Efficiency
2.2.1 Stratified Sampling
2.2.2 Importance Sampling
2.2.3 Multiple Importance Sampling
2.2.4 Russian Roulette
2.2.5 Splitting
2.3 Sampling Using the Inversion Method
2.3.1 Discrete Case
2.3.2 Continuous Case
2.4 Transforming between Distributions
2.4.1 Transformation in Multiple Dimensions
2.4.2 Sampling with Multidimensional Transformations
Further Reading
Exercises
CHAPTER 03. GEOMETRY AND TRANSFORMATIONS
3.1 Coordinate Systems
3.1.1 Coordinate System Handedness
3.2 n-Tuple Base Classes
3.3 Vectors
3.3.1 Normalization and Vector Length
3.3.2 Dot and Cross Product
3.3.3 Coordinate System from a Vector
3.4 Points
3.5 Normals
3.6 Rays
3.6.1 Ray Differentials
3.7 Bounding Boxes
3.8 Spherical Geometry
3.8.1 Solid Angles
3.8.2 Spherical Polygons
3.8.3 Spherical Parameterizations
3.8.4 Bounding Directions
3.9 Transformations
3.9.1 Homogeneous Coordinates
3.9.2 Transform Class Definition
3.9.3 Basic Operations
3.9.4 Translations
3.9.5 Scaling
3.9.6 x, y, and z Axis Rotations
3.9.7 Rotation around an Arbitrary Axis
3.9.8 Rotating One Vector to Another
3.9.9 The Look-at Transformation
3.10 Applying Transformations
3.10.1 Points
3.10.2 Vectors
3.10.3 Normals
3.10.4 Rays
3.10.5 Bounding Boxes
3.10.6 Composition of Transformations
3.10.7 Transformations and Coordinate System Handedness
3.10.8 Vector Frames
3.10.9 Animating Transformations
3.11 Interactions
3.11.1 Surface Interaction
3.11.2 Medium Interaction
Further Reading
Exercises
CHAPTER 04. RADIOMETRY, SPECTRA, AND COLOR
4.1 Radiometry
4.1.1 Basic Quantities
4.1.2 Incident and Exitant Radiance Functions
4.1.3 Radiometric Spectral Distributions
4.1.4 Luminance and Photometry
4.2 Working with Radiometric Integrals
4.2.1 Integrals over Projected Solid Angle
4.2.2 Integrals over Spherical Coordinates
4.2.3 Integrals over Area
4.3 Surface Reflection
4.3.1 The BRDF and the BTDF
4.3.2 The BSSRDF
4.4 Light Emission
4.4.1 Blackbody Emitters
4.4.2 Standard Illuminants
4.5 Representing Spectral Distributions
4.5.1 Spectrum Interface
4.5.2 General Spectral Distributions
4.5.3 Embedded Spectral Data
4.5.4 Sampled Spectral Distributions
4.6 Color
4.6.1 XYZ Color
4.6.2 RGB Color
4.6.3 RGB Color Spaces
4.6.4 Why Spectral Rendering?
4.6.5 Choosing the Number of Wavelength Samples
4.6.6 From RGB to Spectra
Further Reading
Exercises
CHAPTER 05. CAMERAS AND FILM
5.1 Camera Interface
5.1.1 Camera Coordinate Spaces
5.1.2 The CameraBase Class
5.2 Projective Camera Models
5.2.1 Orthographic Camera
5.2.2 Perspective Camera
5.2.3 The Thin Lens Model and Depth of Field
5.3 Spherical Camera
5.4 Film and Imaging
5.4.1 The Camera Measurement Equation
5.4.2 Modeling Sensor Response
5.4.3 Filtering Image Samples
5.4.4 The Film Interface
5.4.5 Common Film Functionality
5.4.6 RGBFilm
5.4.7 GBufferFilm
Further Reading
Exercises
CHAPTER 06. SHAPES
6.1 Basic Shape Interface
6.1.1 Bounding
6.1.2 Ray–Bounds Intersections
6.1.3 Intersection Tests
6.1.4 Intersection Coordinate Spaces
6.1.5 Sidedness
6.1.6 Area
6.1.7 Sampling
6.2 Spheres
6.2.1 Bounding
6.2.2 Intersection Tests
6.2.3 Surface Area
6.2.4 Sampling
6.3 Cylinders
6.3.1 Area and Bounding
6.3.2 Intersection Tests
6.3.3 Sampling
6.4 Disks
6.4.1 Area and Bounding
6.4.2 Intersection Tests
6.4.3 Sampling
6.5 Triangle Meshes
6.5.1 Mesh Representation and Storage
6.5.2 Triangle Class
6.5.3 Ray–Triangle Intersection
6.5.4 Sampling
6.6 Bilinear Patches
6.6.1 Intersection Tests
6.6.2 Sampling
6.7 Curves
6.7.1 Bounding Curves
6.7.2 Intersection Tests
6.8 Managing Rounding Error
6.8.1 Floating-Point Arithmetic
6.8.2 Conservative Ray–Bounds Intersections
6.8.3 Accurate Quadratic Discriminants
6.8.4 Robust Triangle Intersections
6.8.5 Bounding Intersection Point Error
6.8.6 Robust Spawned Ray Origins
6.8.7 Avoiding Intersections behind Ray Origins
6.8.8 Discussion
Further Reading
Exercises
CHAPTER 07. PRIMITIVES AND INTERSECTION ACCELERATION
7.1 Primitive Interface and Geometric Primitives
7.1.1 Geometric Primitives
7.1.2 Object Instancing and Primitives in Motion
7.2 Aggregates
7.3 Bounding Volume Hierarchies
7.3.1 BVH Construction
7.3.2 The Surface Area Heuristic
7.3.3 Linear Bounding Volume Hierarchies
7.3.4 Compact BVH for Traversal
7.3.5 Bounding and Intersection Tests
Further Reading
Exercises
CHAPTER 08. SAMPLING AND RECONSTRUCTION
8.1 Sampling Theory
8.1.1 The Frequency Domain and the Fourier Transform
8.1.2 Ideal Sampling and Reconstruction
8.1.3 Aliasing
8.1.4 Understanding Pixels
8.1.5 Sampling and Aliasing in Rendering
8.1.6 Spectral Analysis of Sampling Patterns
8.2 Sampling and Integration
8.2.1 Fourier Analysis of Variance
8.2.2 Low Discrepancy and Quasi Monte Carlo
8.3 Sampling Interface
8.4 Independent Sampler
8.5 Stratified Sampler
8.6 Halton Sampler
8.6.1 Hammersley and Halton Points
8.6.2 Randomization via Scrambling
8.6.3 Halton Sampler Implementation
8.6.4 Evaluation
8.7 Sobol Samplers
8.7.1 Stratification over Elementary Intervals
8.7.2 Randomization and Scrambling
8.7.3 Sobol Sample Generation
8.7.4 Global Sobol Sampler
8.7.5 Padded Sobol Sampler
8.7.6 Blue Noise Sobol Sampler
8.7.7 Evaluation
8.8 Image Reconstruction
8.8.1 Filter Interface
8.8.2 FilterSampler
8.8.3 Box Filter
8.8.4 Triangle Filter
8.8.5 Gaussian Filter
8.8.6 Mitchell Filter
8.8.7 Windowed Sinc Filter
Further Reading
Exercises
CHAPTER 09. REFLECTION MODELS
9.1 BSDF Representation
9.1.1 Geometric Setting and Conventions
9.1.2 BxDF Interface
9.1.3 Hemispherical Reflectance
9.1.4 Delta Distributions in BSDFs
9.1.5 BSDFs
9.2 Diffuse Reflection
9.3 Specular Reflection and Transmission
9.3.1 Physical Principles
9.3.2 The Index of Refraction
9.3.3 The Law of Specular Reflection
9.3.4 Snell’s Law
9.3.5 The Fresnel Equations
9.3.6 The Fresnel Equations for Conductors
9.4 Conductor BRDF
9.5 Dielectric BSDF
9.5.1 Thin Dielectric BSDF
9.5.2 Non-Symmetric Scattering and Refraction
9.6 Roughness Using Microfacet Theory
9.6.1 The Microfacet Distribution
9.6.2 The Masking Function
9.6.3 The Masking-Shadowing Function
9.6.4 Sampling the Distribution of Visible Normals
9.6.5 The Torrance–Sparrow Model
9.7 Rough Dielectric BSDF
9.8 Measured BSDFs
9.8.1 Basic Data Structures
9.8.2 Evaluation
9.9 Scattering from Hair
9.9.1 Geometry
9.9.2 Scattering from Hair
9.9.3 Longitudinal Scattering
9.9.4 Absorption in Fibers
9.9.5 Azimuthal Scattering
9.9.6 Scattering Model Evaluation
9.9.7 Sampling
9.9.8 Hair Absorption Coefficients
Further Reading
Exercises
CHAPTER 10. TEXTURES AND MATERIALS
10.1 Texture Sampling and Antialiasing
10.1.1 Finding the Texture Sampling Rate
10.1.2 Ray Differentials at Medium Transitions
10.1.3 Ray Differentials for Specular Reflection and Transmission
10.1.4 Filtering Texture Functions
10.2 Texture Coordinate Generation
10.2.1 (u, v) Mapping
10.2.2 Spherical Mapping
10.2.3 Cylindrical Mapping
10.2.4 Planar Mapping
10.2.5 3D Mapping
10.3 Texture Interface and Basic Textures
10.3.1 Constant Texture
10.3.2 Scale Texture
10.3.3 Mix Textures
10.4 Image Texture
10.4.1 Texture Memory Management
10.4.2 Image Texture Evaluation
10.4.3 MIP Maps
10.4.4 Image Map Filtering
10.5 Material Interface and Implementations
10.5.1 Material Implementations
10.5.2 Finding the BSDF at a Surface
10.5.3 Normal Mapping
10.5.4 Bump Mapping
Further Reading
Exercises
CHAPTER 11. VOLUME SCATTERING
11.1 Volume Scattering Processes
11.1.1 Absorption
11.1.2 Emission
11.1.3 Out Scattering and Attenuation
11.1.4 In Scattering
11.2 Transmittance
11.2.1 Null Scattering
11.3 Phase Functions
11.3.1 The Henyey–Greenstein Phase Function
11.4 Media
11.4.1 Medium Interface
11.4.2 Homogeneous Medium
11.4.3 DDA Majorant Iterator
11.4.4 Uniform Grid Medium
11.4.5 RGB Grid Medium
Further Reading
Exercises
CHAPTER 12. LIGHT SOURCES
12.1 Light Interface
12.1.1 Photometric Light Specification
12.1.2 The LightBase Class
12.2 Point Lights
12.2.1 Spotlights
12.2.2 Texture Projection Lights
12.2.3 Goniophotometric Diagram Lights
12.3 Distant Lights
12.4 Area Lights
12.5 Infinite Area Lights
12.5.1 Uniform Infinite Lights
12.5.2 Image Infinite Lights
12.5.3 Portal Image Infinite Lights
12.6 Light Sampling
12.6.1 Uniform Light Sampling
12.6.2 Power Light Sampler
12.6.3 BVH Light Sampling
Further Reading
Exercises
CHAPTER 13. LIGHT TRANSPORT I: SURFACE REFLECTION
13.1 The Light Transport Equation
13.1.1 Basic Derivation
13.1.2 Analytic Solutions to the LTE
13.1.3 The Surface Form of the LTE
13.1.4 Integral over Paths
13.1.5 Delta Distributions in the Integrand
13.1.6 Partitioning the Integrand
13.2 Path Tracing
13.2.1 Overview
13.2.2 Path Sampling
13.2.3 Incremental Path Construction
13.3 A Simple Path Tracer
13.4 A Better Path Tracer
13.4.1 Path Regularization
Further Reading
Exercises
CHAPTER 14. LIGHT TRANSPORT II: VOLUME RENDERING
14.1 The Equation of Transfer
14.1.1 Null-Scattering Extension
14.1.2 Evaluating the Equation of Transfer
14.1.3 Sampling the Majorant Transmittance
14.1.4 Generalized Path Space
14.1.5 Evaluating the Volumetric Path Integral
14.2 Volume Scattering Integrators
14.2.1 A Simple Volumetric Integrator
14.2.2 Improving the Sampling Techniques
14.2.3 Improved Volumetric Integrator
14.3 Scattering from Layered Materials
14.3.1 The One-Dimensional Equation of Transfer
14.3.2 Layered BxDF
14.3.3 Coated Diffuse and Coated Conductor Materials
Further Reading
Exercises
* CHAPTER 15. WAVEFRONT RENDERING ON GPUS
15.1 Mapping Path Tracing to the GPU
15.1.1 Basic GPU Architecture
15.1.2 Structuring Rendering Computation
15.1.3 System Overview
15.2 Implementation Foundations
15.2.1 Execution and Memory Space Specification
15.2.2 Launching Kernels on the GPU
15.2.3 Structure-of-Arrays Layout
15.2.4 Work Queues
15.3 Path Tracer Implementation
15.3.1 Work Launch
15.3.2 The Render() Method
15.3.3 Generating Camera Rays
15.3.4 Loop over Ray Depths
15.3.5 Sample Generation
15.3.6 Intersection Testing
15.3.7 Participating Media
15.3.8 Ray-Found Emission
15.3.9 Surface Scattering
15.3.10 Shadow Rays
15.3.11 Updating the Film
Further Reading
Exercises
CHAPTER 16. RETROSPECTIVE AND THE FUTURE
16.1 pbrt over the Years
16.2 Design Alternatives
16.2.1 Out-of-Core Rendering
16.2.2 Preshaded Micropolygon Grids
16.2.3 Packet Tracing
16.2.4 Interactive and Animation Rendering
16.2.5 Specialized Compilation
16.3 Emerging Topics
16.3.1 Inverse and Differentiable Rendering
16.3.2 Machine Learning and Rendering
16.4 The Future
16.5 Conclusion
A SAMPLING ALGORITHMS
B UTILITIES
C PROCESSING THE SCENE DESCRIPTION
REFERENCES
INDEX OF FRAGMENTS
INDEX OF CLASSES AND THEIR MEMBERS
INDEX OF MISCELLANEOUS IDENTIFIERS
SUBJECT INDEX
COLOPHON