home/ modules/ real-time-ray-budget-and-importance-sampling

Real-time ray budgets, denoising, and importance sampling

  • learner can reduce path-tracer variance with importance sampling proportional to the integrand
  • learner can operate within a real-time 1-ray-per-pixel budget reconstructed by denoising

Extend a path tracer to a real-time 1-sample-per-pixel budget: add importance sampling to cut variance and a denoising pass that reconstructs a clean frame from the noisy result.

This module is about making path tracing survive a live rig. Offline, your tracer from the prerequisite module can burn thousands of samples per pixel overnight; on stage, driving projector visuals synced to a set, you get one sample per pixel per frame at 60 fps — and the audience sees every frame. The whole task is turning a correct-but-slow renderer into one that produces a watchable image inside that budget, which is exactly the trade every real-time engine and every live-coded ray-marching visual makes.

The arc starts supported: first, in your existing offline tracer, replace uniform scattering with a weighted PDF and watch variance fall at a fixed sample count — the atom on importance sampling proportional to the integrand is your how-to here, with the Monte Carlo principle atom explaining why the f/p ratio going flat is what kills noise. A useful intermediate exercise is a mixture PDF over lights and the BRDF, comparing convergence curves. Then you cut the budget: drop to one sample per pixel, accept the binary shadow noise, and bolt on a spatial denoising pass — the ray-budget-and-denoising atom frames what reconstruction can and cannot recover. The unsupported capstone combines both moves in one build.

The required atoms gate the capstone directly: without the two importance-sampling atoms you cannot cut variance without bias, and without the ray-budget principle you will not know what a denoiser must reconstruct or why 1 spp is the target. The supporting atom on the rasterization + ray tracing + denoising hybrid enriches the picture, situating your tracer within how shipping engines actually deploy these pieces.

Atoms in this module

Required — these gate the capstone

Importance sampling reduces path-tracer variance by sampling directions proportional to the integrand
Concept L4 Performance G
Importance sampling reduces Monte Carlo variance by drawing samples proportional to the integrand's magnitude
Principle L4 Performance G
Real-time ray tracing is limited to ~1 ray per pixel; denoising reconstructs a clean image from noisy 1-sample results
Principle L3 Craft G

Supporting — enrichment, not gating

Modern real-time rendering uses rasterization + ray tracing + denoising together, not pure ray tracing
Principle L3 Craft G