Skip to content
SpecializedSource checked

Path Tracing

Simulates light transport by sampling random paths through a scene.

Quick Facts

Compact metadata for implementation and discovery.

Category
Rendering
Difficulty
Advanced
Family
Monte Carlo Rendering
Tier
Specialized
Status
Verified
Review
Source Checked
Sources
1
Formulas
1
Relationships
13
Code example
Not ready
Visualization
Ready
Aliases
Monte Carlo Path Tracing

Overview

Path Tracing estimates realistic lighting by tracing many random paths that bounce between surfaces.

Core Concepts

Monte Carlo samplinglight transportpath throughputsample accumulationrendered imagerandom samplingmonte carlo renderingscene representation

Quick facts

Complexity

Runtime and memory behavior at a glance.

Best

O(p s log n)

Average

O(p s b log n)

Worst

O(p s b n)

Space

O(n)

When to Use

  • Use Path Tracing when you need to sample light paths.
  • Use it for physically based rendering with inputs like scene geometry.
  • Use it when the scene representation and quality target match the rendering tradeoff.
  • Use it when the Monte Carlo Rendering tradeoff is acceptable for the problem size.

When Not to Use

  • Avoid it when repeatability is required but seeds and random sources are not controlled.
  • Avoid it when the cost per pixel or sample is too high for the desired frame rate.
  • Do not treat the O(p s b log n) average case as a guarantee; check the O(p s b n) worst case.
  • Avoid it when the required output is not rendered image with sampled lighting.

What It Does

  • Samples light paths
  • Estimates direct and indirect lighting

Use Cases

  • Physically based rendering
  • Global illumination
  • Offline film-quality images

Inputs

  • Scene geometry
  • Materials
  • Camera
  • Light sources

Outputs

  • Rendered image with sampled lighting

Key Formulas (1)

Sample estimate

pixel = average(pathcontribution 1 … pathcontribution n)
pixel = average(path_contribution_1 ... path_contribution_n)

Accumulates many random light-path samples into a pixel estimate.

Pseudocode

  1. 1.For each pixel, generate many sample rays
  2. 2.Trace each ray to a surface
  3. 3.Randomly choose a bounce direction from the material
  4. 4.Accumulate emitted and reflected light
  5. 5.Average samples to estimate the pixel color

Canonical Example

Input
scene = one triangle, one camera, one light
Output
image pixels showing the visible triangle
Explanation
Path Tracing: The algorithm converts scene data into visible pixel results.

Implementation Notes

  • Keep the input contract explicit: Scene geometry; Materials; Camera; Light sources.
  • Use this step as the implementation spine: For each pixel, generate many sample rays.
  • Then preserve the next state change: Trace each ray to a surface.
  • Thread a seedable random source through the implementation for repeatable tests.
  • Build tiny scenes with known geometry before testing complex materials or lighting.

Common Pitfalls

  • Path Tracing reduces noise by increasing sample count or improving sampling.
  • Ignoring coordinate spaces, depth precision, or sampling noise while debugging image artifacts.
  • Returning rendered image with sampled lighting without handling empty, invalid, or boundary inputs.

Interactive Mechanism Walkthrough

Spatial Primitive & Sweep-Line Canvas

Show random paths bouncing through a scene and converging into an image.

Path Tracing mechanism walkthrough step 1 of 5
Step 1 of 5: For each pixel, generate many sample rays
light-paths

Notes

Path Tracing operates in O(p s b log n) time and O(n) space within the Monte Carlo Rendering family. Key governing relation: pixel = average(path_contribution_1 ... path_contribution_n). Often compared with Ray Tracing and Monte Carlo Simulation.

Sources (1)

What each reference supports for this entry.

Physically Based Rendering

Book

Online book reference for ray tracing, path tracing, sampling, BRDFs, and rendering implementation.

Open source

Explore Next

Good next jumps from the relationship graph, ranked for useful discovery.

Often paired withImportance Sampling BRDF

BRDF importance sampling reduces path tracing variance.

Path tracers often sample direct lighting with next-event estimation.

SpecializesRay Tracing

Path tracing specializes ray tracing for stochastic light transport integration.

Path tracers often use Russian roulette to terminate low-contribution paths.

Tags

GraphicsGlobal IlluminationStochasticAdvanced