Examples

Every example, one page each, with its source.

The examples run in your browser: open the gallery. Each page has its source on GitHub, linked from its top bar.

Run them locally with live library sources:

pnpm install
pnpm examples    # http://localhost:5310

Showcases

Bigger scenes built to be looked at: what the libraries do together.

ExampleWhat it showsStatus
ClassroomAn interior lit by the sun through the windows, with a neural radiance cache, SVGF and temporal upscaling.Research

Getting started

The smallest complete programs: a first image, a glTF model.

ExampleWhat it showsStatus
Hello, path tracerA Cornell box built in code and path traced progressively.
glTF modelsLoad a glTF 2.0 model with its OpenPBR materials, under a sky and a sun.

Ray tracer

@pmndrs/raytracer on its own: rays in, hits out, in your own shaders.

ExampleWhat it showsStatus
Hit inspectorrtClosest and rtSurface in your own compute shader: normals, uvs, materials and distances of the first hit.
Ambient occlusionrtVisible, the cheapest query: cosine rays over the hemisphere ask only whether anything is within a radius.
One-bounce shadingrtShade at the first hit: emission and one light sample with its shadow ray, the lighting a reflection or GI effect needs.
Batch tracingRtBatchTracer: camera rays and shadow rays from GPU buffers, hits and visibility back into GPU buffers, five passes and no readback.

Path tracer

@pmndrs/pathtracer features one at a time.

ExampleWhat it showsStatus
Megakernel or wavefrontThe same estimator scheduled two ways: one kernel per sample, or kernels connected by GPU queues. Same image, different time.
Alpha cutoutsLeaf cards with alpha-masked textures: exact cutout shadows, and the faster settings that trade bias or noise for speed.
Many lights64 coloured lamps, a sun and a sky: light selection strategies for next-event estimation, and ReSTIR DI.
Fog and cloudsParticipating media: homogeneous fog filling the Cornell box, or a cloud read from a 3D density grid.Experimental
Spectral rendering and dispersionPaths that carry wavelengths: glass whose index of refraction depends on the wavelength splits white bars into colour fringes.Experimental
MaterialXMaterialX documents as path tracer materials: graphs compiled to WGSL per hit, or baked into textures.Experimental

Experimental: Works and is checked, but the API or its defaults can still change. Research: A study from one of our research tracks, not a supported feature. It may move or go away.