The project's README from github.com/pissang/mutracer. As one markdown file: README.md.
Physically based path tracing in the browser.
WebGPU first with a WebGL 2 fallback · OpenPBR 1.1 materials · MaterialX node graphs · OIDN denoising
Open the viewer · Website · Docs · Examples · Changelog
Kroken by Angelo Ferretti, CC BY-ND 2.0 · rendered in MuTracer
npm install @meimu/mutracer three
Keep building your scene with Three.js; THREESync converts it once and follows
transform, material and light edits on every frame.
import { Engine, RenderLoop } from '@meimu/mutracer';
import { THREESync } from '@meimu/mutracer/three';
const engine = new Engine({ canvas });
const sync = new THREESync(engine, { scene, camera, controls });
const loop = new RenderLoop(engine, { sync });
loop.start();
loop.final.setDenoiser({ type: 'oidn' }); // denoise the converged frame (WebGPU)
The getting started guide covers the scene model, render loop, lights and export; the Three.js guide covers loading glTF.
converge(), AgX, ACES and other tone mappers, bloom, thin-lens depth of field, shadow catchers, transparent backgrounds, AOVs, HDR output and PNG export.GPUDevice, OffscreenCanvas workers and display post-processing passes. Without WebGPU, the same code renders on WebGL 2.MaterialGraph
of MaterialX nodes. WebGPU compiles procedural graphs; both backends render image graphs.parseMaterialX from @meimu/mutracer/materialx.
The viewer ships 55 procedural samples and browses the GPUOpen MaterialX Library.shaderPrefetch: 'editing'.UdimTexture, DiskLight and CylinderLight,
pixel-center AOVs, mesh.visible
and incremental geometry uploads.@meimu/mutracer/three.See the changelog for the full list.
Click a preview to path trace the scene in the browser.
|
Porsche 992 GT3 R Dave · CC BY 4.0 |
Super Human Davyd Vidiger · CC BY 4.0 |
Fluted Crystal Yi Shen · CC0 |
Blender Cover Remix bandinopla · CC BY 4.0 |
Reference previews and glTF conversions by ErfanMo77.
|
Breakfast Room Wig42 · CC BY 3.0 |
Bathroom 2 nacimus · CC BY 3.0 |
Classroom 2 Christophe Seux · CC0 |
Living Room Wig42 · CC BY 3.0 |
|
House Benedikt Bitterli · CC0 |
Glass of Water aXel · CC0 |
Spaceship thecali · CC0 |
Veach MIS Eric Veach / Benedikt Bitterli · CC0 |
The LEGO Technic Bugatti Chiron (VTX, CC-BY-NC-SA 4.0) is a heavy scene that path traces interactively in the viewer:
| Bugatti Chiron | |
|---|---|
| Rendered triangles | 4.6 M (2.5 M unique, 341 geometries in 560 meshes) |
| Materials | 35 |
| Download | 12.8 MB .glb |
| BVH build, 1 thread | 1.7 s (built-in builder) / 1.0 s (TinyBVH WebAssembly) |
| BVH build, 4 workers (default) | 0.50 s (built-in builder) / 0.28 s (TinyBVH WebAssembly) |
| 1920 × 1080, 64 spp | 12.1 s path tracing, 12.4 s with OIDN denoising |
Measured on an Apple M4 Max: rendering in Chrome with WebGPU at the viewer's default settings (6 bounces), BVH builds on CPU threads excluding worker startup.
| Import | Contents |
|---|---|
@meimu/mutracer |
Engine, renders, display, scene classes, material graphs |
@meimu/mutracer/three |
THREESync and Three.js scene conversion; needs three (and @types/three for TypeScript) |
@meimu/mutracer/materialx |
parseMaterialX |
@meimu/mutracer/oidn |
OIDN weight helpers |
The package is ESM with TypeScript declarations. A UMD build with a MuTracer
global is at dist/mutracer.umd.js; deploy its dist/assets/ alongside it. See
loading and deployment.
Browsers: WebGPU (current Chrome, Edge and Safari) is recommended and required
for OIDN, caustics, HDR output and options marked WebGPU in the
API reference. The WebGL 2 fallback needs EXT_color_buffer_float.
The first frame compiles large shaders, which can take several seconds.
| Guide | Contents |
|---|---|
| Getting started | Scene model, render loop, lights, export, workers, your own GPUDevice |
| Scene updates | Editing a rendering scene, animation, visibility, update costs |
| API reference | Engine, Display and Render options, methods and scene types |
| Materials | OpenPBR inputs, textures, UDIM, alpha, bevel, displacement |
| Material graphs | Procedural and image node graphs on OpenPBR |
| MaterialX | Parsing .mtlx documents |
| Three.js | THREESync, supported materials and lights, userData keys |
| Progressive rendering | Independent renders, sample batching, fallbacks |
| Caustics | Light tracing and photon mapping (WebGPU) |
| Denoising | JNLM and OIDN denoisers, OIDN weights hosting |
| Post-processing | Display passes, GPU output textures, upscaling |
| Sampling | Patterns, dimensions and progressive budgets |
| BVH | BVH builders, TinyBVH layouts, worker preparation |
| Performance | Tuning checklist |
| Viewer | Using the online viewer, MaterialX import, shareable links |
llms.txt |
Compact usage guide for coding agents |
Run the examples locally with npm install and npm run dev.
Pull requests are not accepted at the moment; please open an issue instead. See CONTRIBUTING.md for development setup, required checks and GPU validation.
MuTracer is released under the MIT License. It includes third-party code and data under MIT, Apache-2.0 and CC0 licenses; see THIRD_PARTY_NOTICES.md. Gallery models keep their own licenses, linked under each image.