mutracer README

The project's README from github.com/pissang/mutracer. As one markdown file: README.md.

MuTracer

Physically based path tracing in the browser.

WebGPU first with a WebGL 2 fallback · OpenPBR 1.1 materials · MaterialX node graphs · OIDN denoising

npm version MIT license

Open the viewer · Website · Docs · Examples · Changelog

Kroken interior scene path traced in MuTracer

Kroken by Angelo Ferretti, CC BY-ND 2.0 · rendered in MuTracer

Quick start

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.

Highlights

New in 0.4

See the changelog for the full list.

Click a preview to path trace the scene in the browser.

MuTracer Collection

Porsche 992 GT3 R
Porsche 992 GT3 R
Dave · CC BY 4.0
Super Human
Super Human
Davyd Vidiger · CC BY 4.0
Fluted Crystal
Fluted Crystal
Yi Shen · CC0
Blender Cover Remix
Blender Cover Remix
bandinopla · CC BY 4.0

glTF Research Scenes

Reference previews and glTF conversions by ErfanMo77.

Breakfast Room
Breakfast Room
Wig42 · CC BY 3.0
Bathroom 2
Bathroom 2
nacimus · CC BY 3.0
Classroom 2
Classroom 2
Christophe Seux · CC0
Living Room
Living Room
Wig42 · CC BY 3.0
House
House
Benedikt Bitterli · CC0
Glass of Water
Glass of Water
aXel · CC0
Spaceship
Spaceship
thecali · CC0
Veach MIS
Veach MIS
Eric Veach / Benedikt Bitterli · CC0

Performance

LEGO Technic Bugatti Chiron rendered in MuTracer

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.

Packages

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.

Documentation

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.

Contributing

Pull requests are not accepted at the moment; please open an issue instead. See CONTRIBUTING.md for development setup, required checks and GPU validation.

License

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.

mutracer (pissang/mutracer)

graphics-programming
Searching Database…

What is this?MuTracer is a physically based path tracer for the web: it renders scenes with WebGPU (falling back to WebGL 2) using OpenPBR materials, TinyBVH acceleration and built-in denoising.
Is this a standalone renderer or a library I embed?It is a JavaScript/TypeScript library you install and embed in a web page, shipped as an ESM build with TypeScript declarations plus a UMD bundle, rather than a standalone app.
How do I add it to a web project?Build or load a Three.js scene as usual and let THREESync keep MuTracer synced to it while RenderLoop renders progressively each frame, or describe meshes, materials, lights and the camera directly with MuTracer's own scene classes.
Do I need Three.js to use it?No - MuTracer has its own scene model - but Three.js (for GLTFLoader + THREESync) and gl-matrix (for matrix math) are needed if you want to load glTF scenes or reuse Three.js materials and lights.
Is the API stable yet?No, it is still pre-1.0, so APIs can change between minor releases.
Does it require WebGPU, or can it run without it?WebGPU is recommended and required for features like OIDN denoising and HDR output, but it automatically falls back to WebGL 2 (which needs the EXT_color_buffer_float extension) on browsers without WebGPU support.
What is OpenPBR and why does it matter here?OpenPBR 1.1 is the physically based surface model MuTracer implements, covering F82 metals, anisotropic GGX specular and coat, thin-film interference, dispersive transmission with absorption, and subsurface scattering - giving accurate materials out of the box.
Can it handle heavy, high-poly scenes?Yes - a two-level BVH built with binned SAH in parallel Workers (a TinyBVH port or its WebAssembly builder) lets it path trace interactively; a 4.6M-triangle Bugatti Chiron model renders at 1920x1080, 64spp in about 12 seconds on an Apple M4 Max.
Is denoising included?Yes, it offers albedo- and normal-guided denoising using Intel Open Image Denoise on WebGPU, or a joint non-local means filter that works on both WebGPU and WebGL 2.
Can I export the final render?Yes, converge() produces a deterministic, variance-adaptive final frame with tone mapping (AgX, ACES, Cineon, Reinhard, linear), color grading, bloom, depth of field and transparent backgrounds, and these effects also apply during PNG export.
Creator
pissang
Size
45.2 MB
Stars
190
Age
1mo
Commits · 90 Days