Monte Carlo global illumination · Cornell box · Progressive accumulation
Scene change resets accumulation
Max target: 512 spp
Each frame traces one random ray per pixel. Samples accumulate via a ping-pong framebuffer — the more samples, the less noise. Colour from red/green walls “bleeds” onto nearby surfaces.
Physically accurate rendering via Monte Carlo integration. Each pixel fires many rays that bounce randomly until they reach a light source — averaging the results gives a noise-free image over time.
The rendering equation (Kajiya 1986) computes outgoing light L at a surface as the integral of incoming light × BRDF over the hemisphere. Monte Carlo solves this by sampling random directions according to the BRDF distribution. Each sample is unbiased — the image converges to exact global illumination given infinite samples. Soft shadows, colour bleeding, and caustics emerge automatically from the physics, without special-case code.
Drag to orbit the camera. The image progressively refines — each frame adds more samples per pixel. Switch between scene presets to see Cornell box, sphere clusters and reflective surfaces. Increase the max bounce depth to capture multiple-bounce indirect light. The sample counter shows how many rays per pixel have accumulated. Click Reset Accumulation to restart from scratch after changing the scene.
Pixar's RenderMan uses path tracing to render every film frame — a single production frame may accumulate 10 000+ samples and take hours on a render farm. The convergence rate of Monte Carlo path tracing is 1/√N: doubling quality requires quadrupling the sample count. GPU hardware ray tracing (NVIDIA RTX) launched in 2018, enabling real-time path tracing in games for the first time by hardware-accelerating the BVH intersection queries that dominate path-trace computation.
This is a progressive Monte Carlo path tracer rendering a Cornell box entirely on the GPU in WebGL2. Each frame fires one randomly scattered ray per pixel and approximates the rendering equation, integrating incoming light times the surface BRDF over the hemisphere. Samples accumulate in a floating-point ping-pong framebuffer, so noise falls and soft shadows, colour bleeding and reflections sharpen over hundreds of samples per pixel. It is an honest, physics-based view of how light truly transports.
A unidirectional path tracer of the rendering equation. Diffuse walls scatter with cosine-weighted hemisphere sampling; metal, mirror and glossy spheres use reflected directions with a roughness cone. A rectangular ceiling emitter lights the box, paths terminate on emission, and Russian roulette culls dim paths after the fourth bounce. Frames blend by 1/(n+1) and an ACES tone map plus gamma finishes the output.
Use Pause/Resume to halt or continue accumulation and Reset to clear the buffer. The "Max bounces" slider (1-8) sets path depth, capturing more indirect light at higher values. "Exposure" (0.2-3.0) scales brightness before tone mapping. The Scene buttons switch between Cornell, Spheres and Mirror presets; any change resets accumulation. Live stats show samples per pixel, FPS and resolution, with a bar tracking progress toward 512 spp.
Monte Carlo path tracing converges at a rate of 1/√N, so halving the visible noise requires quadrupling the number of samples. That is why early frames look grainy and clean images take hundreds of samples to resolve.
Path tracing is a rendering technique that simulates how light travels by tracing rays as they bounce around a scene until they reach a light source. It numerically solves the rendering equation using Monte Carlo integration, which means many random samples are averaged per pixel. The result is physically based global illumination, including soft shadows, reflections and indirect colour bleeding.
Each frame contributes only one randomly chosen light path per pixel, so a single sample is a rough, grainy estimate. The simulation accumulates these estimates frame after frame and averages them with a 1/(n+1) blend. As the samples per pixel rise toward the 512 target, the random error shrinks and the picture converges to a smooth, noise-free image.
Max bounces sets how many times a ray may scatter before its path is terminated, from 1 to 8. Higher values capture more indirect, multi-bounce lighting such as colour bleeding between walls, at the cost of slower convergence. Exposure scales the accumulated brightness from 0.2 to 3.0 before the ACES tone map, letting you brighten or darken the final view without changing the underlying render.
It is an unbiased estimator of the rendering equation, so given infinite samples it converges to the exact global-illumination solution, which makes it physically grounded. That said, it is simplified for the browser: the geometry is a small set of planes and spheres, the specular model is an approximate roughness cone rather than full GGX, and there is no spectral or refractive glass transport. The light transport itself, however, follows real physics.
The Cornell box is a classic test scene devised at Cornell University: a cube-shaped room with a red left wall, a green right wall, neutral floor, ceiling and back, and an area light overhead. Its coloured walls make diffuse colour bleeding and soft area shadows easy to see, so it became a standard benchmark for validating global-illumination renderers against real-world measurements.