Repository navigation
Video: the whole Moana island, fullscreen at 1920x1080 on an RTX 3060 (YouTube).
Highlights
- The whole Moana island on a 12 GB GPU. All 20 elements (39.3 M instances of 309 templates) render on an RTX 3060 with the RT cores. In the interactive viewer it runs at about 7 fps at 1280x720 (one sample per frame, not denoised) and the 1920x1080 window also fits (about 4.6 fps).
- Own acceleration structures for the RT cores, built in Mojo. The RT path no longer goes through Vulkan or OptiX (the Vulkan backends remain).
- A set of memory reductions that bring the RT structures to 6.8 GB and the whole scene to about 10.5 GB on the card.
What it took
Memory:
- Instance records are shared between the top-level structure and the shading code (-756 MiB on the medium test set).
- Bottom-level blocks hold up to 8 triangles (-28% BLAS), and top-level leaves are packed full (-7%).
- The primitive-id table is stored as a base word plus byte deltas per group of 8 (707 MB to about 340 MB).
- Mesh arrays can stay in pinned host memory (chosen automatically when the scene would not fit; about +11% frame time).
- The environment map is kept at half resolution on the GPU when the scene would not fit, with the sampling table rebuilt from it.
- A wavefront batch of one sample (
-D WAVEFRONT_BATCH=1) and no ReSTIR buffers in the interactive viewer: per-pixel buffers drop from 2.8 GB to 0.5 GB at 720p. - Ptex paging with a small budget (
GONZALES_PTEX_BUDGET_MB). - Binary caches for the parsed scene and for the RT structures, so a restart loads in seconds. A cache made for another scene is now kept instead of being overwritten.
Speed:
- Whole-island trace time went from 31.7 s to 49 ms for two samples at 720p after fixing a builder bug that paired triangles of non-quad meshes into quads (the ocean was the worst case).
- Curve kernels use 32-thread blocks (+12%).
Limits
- Surface textures are capped at 4 texels per face side with the default budget, and the sky is half resolution when memory is short.
- Displacement is rendered as bump, as pbrt-v4 does.
- The island's shading has not been compared numerically against pbrt-v4 (single elements match within about 0.5%).
- The RT-core path with
GONZALES_RT_PRUNE=1is for the GPU path tracer only.
Running the whole island
Bake the caches once (CPU only), then run:
GONZALES_RT_PRUNE=1 GONZALES_SCENE_CACHE=/path/all.gsc gonzales --bake --rt-hardware --gpu island_all.pbrt
GONZALES_ENV_DOWN=1 GONZALES_PTEX_BUDGET_MB=512 GONZALES_RT_PRUNE=1 GONZALES_SCENE_CACHE=/path/all.gsc \
gonzales --interactive --gpu --rt-hardware --resolution 1280x720 island_all.pbrtBuild with -D WAVEFRONT_BATCH=1. island_all.pbrt is the island file with all Import lines active. The cache is tied to the scene file's path and size, so keep that file unchanged.
GONZALES_GPU_LOG=1 prints the free GPU memory after each upload stage.
Full Changelog: v0.3...v0.4
