Index / 001 EN
Physically Based Rendering: From Theory to Implementation cover

Computer Science

Computer Science

Physically Based Rendering: From Theory to Implementation

Matt Pharr; Wenzel Jakob; Greg Humphreys

A book that teaches photorealistic rendering by presenting the complete source code of a working renderer, pbrt, interleaved with the mathematics and physics behind it in a literate-programming style. The fourth edition updates the system for spectral rendering and GPU ray tracing, and the full text is also published free online by the authors.

Prerequisites: An introductory computer graphics course, linear algebra, multivariable calculus, basic probability and good C++ programming skills.

Difficulty Level
Advanced
Academic Level
Graduate
computer graphicsrenderingray tracingmonte carlo methodslight transportTextbook

01 / Reading Guide

Reading Guide

Citation

Pharr, M., Jakob, W., & Humphreys, G. (2023). Physically Based Rendering: From Theory to Implementation (4th ed.). The MIT Press. Free official edition: https://pbr-book.org/4ed/contents

Chapter Summary

Chapter 1: Introduction

The opening chapter explains the book's method: it presents pbrt, a complete physically based renderer, through literate programming, in which prose and C++ source code are interleaved in named fragments. It reviews the elements of ray tracing (cameras and film, ray–object intersection, light distribution, visibility, surface scattering, indirect light transport and ray propagation), gives an overview of pbrt's phases of execution, its main() function and integrator interface, and implements a first, simple random-walk integrator. It also explains how to proceed through the book, the code conventions used (including dynamic dispatch, allocators and parallelism), the three difficulty levels of the exercises, and a brief history of physically based rendering.

Chapter 2: Monte Carlo Integration

New in its early position in this edition, this chapter introduces Monte Carlo integration as the tool for the high-dimensional, discontinuous integrals of rendering. It covers the basic estimator, ways to improve efficiency (stratified sampling, importance sampling, multiple importance sampling, Russian roulette and splitting), sampling by the inversion method and transforming between distributions.

Chapter 3: Geometry and Transformations

This chapter builds pbrt's geometric foundation: coordinate systems, n-tuple base classes, vectors, points, normals, rays, bounding boxes, spherical geometry (solid angles and direction representations), transformations, applying transformations to each kind of object, and the interaction records that describe ray–surface hits.

Chapter 4: Radiometry, Spectra, and Color

The physical basis of rendering is introduced: radiometric quantities (flux, intensity, irradiance and radiance), working with radiometric integrals, surface reflection and the BRDF, light emission, the representation of spectral distributions used for pbrt's fully spectral rendering, and color and its relation to human perception.

Chapter 5: Cameras and Film

Going beyond the pinhole model, the chapter defines the camera interface, projective camera models (orthographic and perspective, with depth of field), a spherical camera, and film and imaging, which turns spectral radiance arriving at the sensor into image values.

Chapter 6: Shapes

Shapes provide geometry and ray intersection. The chapter presents the shape interface and implements spheres, cylinders, disks, triangle meshes, the new bilinear patches and curves, concluding with a careful treatment of managing floating-point rounding error so that intersections are robust.

Chapter 7: Primitives and Intersection Acceleration

The primitive interface binds materials and other properties to shapes on the CPU path. The chapter then introduces aggregates and bounding volume hierarchies, including their construction and traversal, to make ray intersection efficient for complex scenes.

Chapter 8: Sampling and Reconstruction

Starting from sampling theory and Fourier analysis, the chapter relates sampling to integration, defines the sampler interface, and implements independent, stratified, Halton and Sobol' samplers, before discussing image reconstruction with filters.

Chapter 9: Reflection Models

Surface scattering is described by BSDFs. The chapter defines their representation, then implements diffuse reflection, specular reflection and transmission, conductor and dielectric BSDFs, microfacet-based roughness, rough dielectrics, measured BSDFs and a model for scattering from hair.

Chapter 10: Textures and Materials

Textures describe spatial variation and materials turn texture values into BSDF parameters. The chapter covers texture sampling and antialiasing, texture coordinate generation, basic and image textures, and the material interface with its implementations.

Chapter 11: Volume Scattering

This chapter introduces participating media: absorption, emission and scattering processes, transmittance (including null-scattering formulations), phase functions and the representation of homogeneous and grid-based heterogeneous media.

Chapter 12: Light Sources

The light interface is presented with point, distant, area and infinite area lights, followed by light sampling strategies, including many-light sampling for scenes with very large numbers of emitters.

Chapter 13: Light Transport I: Surface Reflection

The chapter derives the light transport equation, presents path tracing as a Monte Carlo solution to it, and implements a simple path tracer useful for understanding and debugging, followed by a more complete path tracer that is much more effective than Chapter 1's random-walk integrator.

Chapter 14: Light Transport II: Volume Rendering

The equation of transfer generalizes light transport to participating media. The chapter develops volume scattering integrators, including unbiased sampling of heterogeneous media, and models scattering from layered materials.

Chapter 15: Wavefront Rendering on GPUs

New in this edition, this chapter explains how path tracing is mapped to GPUs using a wavefront architecture, the implementation foundations that let nearly all of pbrt's code run on both CPUs and GPUs, and the GPU path tracer itself. An opening example reports a GPU render many times faster than on multi-core CPUs.

Chapter 16: Retrospective and the Future

The final chapter reviews how pbrt and hardware have changed over the editions, discusses design alternatives (out-of-core rendering, micropolygon grids, packet tracing, interactive and animation rendering, specialized compilation), emerging topics such as inverse and differentiable rendering and machine learning, and the future of rendering systems.

Appendices A–C: Sampling Algorithms; Utilities; Processing the Scene Description

Appendix A covers the alias method, reservoir sampling, rejection sampling and further inversion-based sampling of one- and multidimensional functions. Appendix B describes system utilities: startup, mathematical infrastructure, error reporting, memory management and parallelism. Appendix C explains how scene description files are tokenized, parsed and turned into objects.

Key Concepts

Chapter 1: Introduction

  • Literate programming: presenting a program as prose interleaved with named code fragments, so the text and the implementation are one document.
  • Integrator: the component of pbrt that computes the radiance arriving along camera rays, the place where light transport algorithms live.

Chapters 2–4: Foundations

  • Monte Carlo estimator: approximating an integral by averaging function values at random samples divided by their probability density.
  • Importance sampling: drawing samples from a distribution similar in shape to the integrand to reduce variance.
  • Radiance: the radiometric quantity carried along rays, measured per unit area and solid angle.
  • Spectral rendering: computing light transport with samples of wavelength-dependent distributions rather than RGB triples.

Chapters 5–8: Image Formation and Geometry

  • Thin-lens camera: a camera model that adds depth of field by sampling points on a lens.
  • Bounding volume hierarchy: a tree of bounding boxes that lets ray intersection skip large parts of a scene.
  • Rounding-error management: bounding floating-point error in intersection computations so that rays do not incorrectly re-intersect surfaces.
  • Low-discrepancy sampling: sample sequences such as Halton and Sobol' that cover the domain more evenly than random points.

Chapters 9–12: Light and Matter

  • BSDF: the function describing how light arriving from one direction is scattered into another at a surface.
  • Microfacet model: representing rough surfaces as collections of tiny mirror-like facets with a statistical distribution of orientations.
  • Participating media and phase functions: volumes that absorb, emit and scatter light, with phase functions giving the angular distribution of scattering.

Chapters 13–16: Light Transport and Systems

  • Light transport equation: the integral equation relating outgoing radiance at a point to emitted and incoming radiance.
  • Path tracing: solving that equation by sampling random light paths from the camera, with direct lighting and multiple importance sampling.
  • Wavefront architecture: organizing GPU rendering into stages that process large batches of rays together.

Critical Analysis

Strengths

  • Theory and complete code together. The preface states the goal of a system that is complete, illustrative and physically based, and every algorithm appears as working code in context. As the preface notes, subtleties hidden in descriptions become visible in implementation, and readers can render the example scenes as they go.
  • Physically grounded throughout. Correct units, radiometry and spectral rendering give a concrete standard of correctness: for simple scenes a physically based renderer should match analytic results, and different algorithms should agree. This edition removes RGB from lighting computations entirely.
  • Up-to-date and broad. The fourth edition reorganizes the book to put Monte Carlo integration and path tracing early, and adds GPU rendering, many-light sampling, layered materials, hair scattering, bilinear patches and state-of-the-art volumetric methods.
  • Structured exercises and design discussion. Exercises are graded into three levels, from an hour or two to final-project scale, and Chapters 1 and 16 discuss design trade-offs in medium-sized rendering systems, which few graphics books address.

Limitations

  • Heavy prerequisites. The book assumes an introductory graphics course, comfort with multivariable calculus and probability, and the ability to read a large modern C++ codebase; the interleaved code can make it slow reading for beginners.
  • Offline rendering only. The focus is exclusively photorealistic, physically based rendering; real-time rasterization, GPU graphics APIs for games and non-photorealistic techniques are outside its scope.
  • Length and density. With 16 chapters and three appendices covering a full renderer, the book is far longer than a single course can cover, and some sections (marked with an asterisk) are advanced material intended to be skipped on first reading.
  • Code tied to pbrt's design. Some explanations depend on pbrt-specific infrastructure (dispatch mechanisms, allocators, the GPU path), which readers building their own renderer must translate.

Where It Fits in the Course

Within this graphics list, Physically Based Rendering is one of two specialist books, alongside Real-Time Rendering by Akenine-Möller and colleagues. The two complement each other: Real-Time Rendering is generally described as covering interactive rasterization-based techniques for GPUs, while pbrt is devoted to offline, physically accurate ray tracing. Students should first take a course using Marschner and Shirley's Fundamentals of Computer Graphics or Angel and Shreiner's Interactive Computer Graphics, which supply the introductory graphics background the preface assumes.

Gambetta's Computer Graphics from Scratch is a gentle introduction to both raytracing and rasterization; its afterword points to physically based rendering as a next step, so reading Gambetta, then a general graphics textbook, then pbrt forms a natural progression. Rogers, Sharp and Preece's Interaction Design covers the HCI side of the course and does not overlap.

How to Use This Book

The preface names three audiences: graduate and upper-level undergraduate students who have taken an introductory graphics course, researchers in rendering, and industry developers. Readers should know vector geometry and transformations (reviewed in Chapter 3), calculus and basic probability, and C++.

The book is written to be read roughly front to back. For a one-semester advanced rendering course, a practical core is Chapter 1, Chapter 2, Chapter 4, selected parts of Chapters 3 and 5–7, Chapter 8 (at least the sampling theory and one or two samplers), Chapter 9, Chapter 12 and Chapter 13; Chapters 11 and 14 add volumes, and Chapter 15 suits students interested in GPUs. Skip starred sections on first reading, as the authors suggest; because pbrt is built around interfaces, the authors also note that readers can skip the implementation of a component once they understand its interface.

Download the pbrt source and scenes from pbrt.org, render the scenes as you read, and choose exercises by level: the one-to-two-hour exercises for practice, the 10–20 hour ones as assignments and the 40-hour ones as final projects. The rendered figures are available online at pbr-book.org for comparison.

Edition and Sources

This guide is based on the fourth edition (MIT Press, 2023), read in the free official online edition at https://pbr-book.org/4ed/contents, which the authors made freely available from November 2023. It draws on the preface in full (audience, goals and changes between editions), the full table of contents, Sections 1.2–1.5 (including how to proceed through the book and the exercise levels), the introductory text of all 16 chapters and three appendices, the section headings of Chapter 16, and the exercise pages of every chapter that has them (all except Chapter 16).