skip to content
Back to writing

Monte Carlo Direct Lighting

An interactive visualization of Monte Carlo integration and sampling strategies for direct lighting — uniform, cosine-weighted, and light sampling.

About

An interactive Monte Carlo path tracer that renders the same scene side-by-side using two sampling strategies: uniform hemisphere sampling and direct light sampling. Watch how explicit light sampling converges dramatically faster than uniform sampling across six different scenes — from a minimal lecture setup to multi-light neon environments. Choose your sample count (1 to 4096 spp) and see variance reduction in action.

Built as a companion visualization for Stanford CS248A: Interactive Computer Graphics.

  1. Live demo: https://visual-compute.github.io/montecarlo/
  2. Course page: https://gfxcourses.stanford.edu/cs248a/winter26