Enterprise PBR WebGL Path Tracer
June 7, 2026 ยท View on GitHub
Minimal Demo [ Code ]
Features
- Browser-based WebGL2 GPU path tracing
- MIS with IBL importance sampling
- glTF/glb loading via glTF-Transform, including GitHub/raw URL normalization and local asset caching
- TinyBVH WASM acceleration structure builds with indexed geometry upload
- Enterprise PBR Shading Model (DSPBR) via slang-pbr
- Public
PathtracingViewportAPI for simple embedding - Implements most of the glTF PBR material extensions.
Development
Package layout:
packages/lib: renderer, loaders, shaders, public viewport APIpackages/app: viewer UI, camera/controller helpers, and minimal integration example
# yarn is mandatory as this project uses yarn workspaces
yarn install
# Regenerate the slang-pbr material GLSL artifact; set SLANG_PBR_ROOT for a local checkout
yarn build:slang-materials
# Builds all packages
yarn build
# Validate assembled WebGL shader variants with glslangValidator
yarn validate:shaders
# Launch the demo viewer with HMR enabled -> auto update on code change during development
yarn run dev
# Launch the same dev server and open the minimal integration example
yarn run dev:example
Third-party
This project stands on a lot of excellent open source work. Thanks to the authors and maintainers of:
- TinyBVH, by Jacco Bikker, for the compact high-performance BVH builder and traversal code that backs the WASM acceleration structure path.
- tinybvh-wasm, for the reusable TinyBVH WebAssembly bridge and browser-facing BVH builder ABI.
- glTF Transform, by Don McCurdy and contributors, for the glTF parsing, extension handling, and asset processing foundation.
- meshoptimizer, by Arseny Kapoulkine, for mesh compression decoding support used by glTF assets.
- Slang, from the shader-slang project and its research contributors, for the shader language/toolchain used to generate the material model code.
- slang-pbr, for the reusable Enterprise PBR Slang material source used by the generated WebGL material model.
- Tweakpane, by Hiroki Tani and contributors, for the compact viewer control UI.
- simple-dropzone, for the browser drag-and-drop file loading used by the viewer.
- Vite and tsup for the development server and package build workflow.
- The Khronos glTF Sample Assets and related sample model repositories, for the scenes that make testing and demos practical.
License
- Source code license info in LICENSE
- Third-party notices in THIRD_PARTY_NOTICES.md