Skip to content
Starting the WAMR3D renderer…

Unlock your imagination without limits. Native WebAssembly 3D.

A Rust 3D engine in WebAssembly with the three.js API. Change the import, call init(), keep your code.

18.0× Renders up to 18.0× faster than three.js 50,000 separate meshes at 1280×720 on WebGPU: 37.8 fps against 2.1 fps for three.js. Measured, see the benchmarks →
  • 22× faster Spawn + destroy 10K objects
  • 22× faster Draw submission
  • 4.9× faster First frame
  • 4.3× faster Scene update

WebAssembly Accelerated Modular Rendering 3D

$ npm install wamr3d
  • MIT license
  • No runtime dependencies
  • 777 KiB Wasm
  • Checked against three.js

Migration path

Start from three.js.
Change the import.

Scene, meshes, lights, shadows, materials and math keep their three.js names, properties and chaining. A parity script runs the same code on both libraries and compares every number.

  1. 01

    Change the import

    Point three at wamr3d/compat and call init() once.

  2. 02

    Swap the renderer

    Use WebGPURenderer and await renderer.init(). It draws with WebGPU, or WebGL 2 where WebGPU is missing; WebGLRenderer works too.

  3. 03

    Keep your scene code

    scene.add, position.set, rotation.y +=, lookAt and raycasting work as written for supported classes.

app.js
- import * as THREE from 'three';+ import * as THREE from 'wamr3d/compat';+ await THREE.init();
  const scene = new THREE.Scene();
  const mesh = new THREE.Mesh( geometry, material );
  scene.add( mesh );

- const renderer = new THREE.WebGLRenderer( { antialias: true } );+ const renderer = new THREE.WebGPURenderer( { antialias: true } );+ await renderer.init();

What it is

A native core.
A familiar surface.

Scene graph, transforms, cameras, geometry processing, culling and draw ordering run inside a WebAssembly module. You drive it from JavaScript through three.js-style classes or batched calls.

Rust → WebAssembly

Batch the scene work.

The engine handles scene graphs, transforms, cameras, geometry processing, culling and draw ordering. The familiar object API batches updates once per frame; the low-level API offers generational handles and typed-array views over engine memory.

  • scene graph
  • world matrices
  • frustum culling
  • draw ordering
  • raycasting
  • batched updates

WebGPU + WebGL 2

Two native renderers.

WAMR3D prepares frames in Rust and draws them through its own WebGPU or WebGL 2 renderer. The renderer supports meshes, lines, points, sprites and instancing, with a growing set of materials, maps, lights and shadows.

Object API

A familiar way to build scenes.

Use three.js-style classes and chaining for supported scene, object, camera, geometry, material and math APIs. Object transforms stay in JavaScript and synchronize with the engine in batches.

Batched API

Fewer calls for large scenes.

Use generational handles and batched operations when many objects change each frame. Geometry and world-matrix data can be read through typed-array views over engine memory.

Parity

Behavior checked against three.js.

The repository includes thousands of generated value checks and stored visual comparisons. See the implementation status and migration guide for current support and known differences.

Current scope

Release 0.9.5

WAMR3D 0.9.5 covers three.js's scene graph, built-in materials, lights, shadows, animation, loaders and the common add-ons, but it is not a complete replacement: TSL node materials are not ported, and GLSL shader materials draw only on WebGL 2. Check the migration guide for current limits.

CPU + GPU

Put both processors
to work.

WAMR3D prepares scene data in compiled Rust and sends a frame ready to draw through WebGPU or WebGL 2. No plug-in or separate install is needed; it runs in the browser.

01 · CPU, in WebAssembly

Scene work in compiled Rust.

The Rust engine stores scene data in typed memory and handles transforms, culling and draw ordering. The object API keeps user-facing transforms in JavaScript and synchronizes them in batches.

  • Transforms and world matrices, only for what changed
  • Frustum culling and draw ordering
  • Lights, shadows and materials packed into one uniform buffer
  • Thousands of objects moved by one batched call

02 · The boundary

One crossing per frame.

The object API records your changes and sends them to the engine in a batch. Geometry and world matrices are typed-array views over engine memory: read without copying.

  • Zero-copy views of geometry and matrices
  • Vertex and index buffers uploaded only when they change
  • No per-property calls into WebAssembly

03 · GPU, WebGPU or WebGL 2

A frame that is ready to draw.

A thin host turns the prepared frame into GPU commands: pipelines and programs are cached, instanced meshes draw in one call, and the same frame runs on WebGPU or WebGL 2.

  • Cached pipelines, no per-frame rebuilds
  • Instancing, PCF shadows and physically based lighting
  • Automatic backend selection with WebGL 2 support

The result: the CPU time three.js spends updating and submitting a scene shrinks, and more of each frame is left to the GPU. How much depends on the scene; the benchmarks show measured medians, including where WAMR3D is slower.

Measured, not promised

Batch the work.
See the difference.

The same scene, 8 renderers, one engine at a time. Medians from a single run on one machine; higher is better in every figure here. Open the showcase to measure yours.

60fps

10,000 separate meshes at 1280×720

WAMR3D batched. three.js ran at 44.1 fps with WebGL and 12.2 fps with WebGPU.

4.3× faster

Scene update, 50,000 instanced bodies at 1280×720

WAMR3D batched updated the scene in 9.6 ms; three.js took 43.4 ms with WebGL and 40.8 ms with WebGPU. With five draw calls the frame rates were close: 60.0, 19.9 and 20.3 fps.

5.0× faster

Draw submission than three.js WebGL

10,000 separate meshes at 1280×720: 3.5 ms of CPU time per frame against 17.6 ms. Computed from the measured medians.

59fps

The same 10,000 meshes on WebGL 2

WAMR3D batched on its WebGL 2 renderer, for machines without WebGPU: 1.3× the frame rate of three.js WebGL (44.1 fps) on the same graphics API, with 5.2 ms of CPU per frame against 22.1 ms.

The showcase scene, 8 renderers

Sun, belts, clusters and bodies: a four-level scene graph where every rotation changes each frame. Longer bars are better in the two frame-rate charts; the CPU chart below them is marked separately.

Frames per secondfps · 1280×720 · the display caps it at 60Higher is better
🥇WAMR3D batched
60.0
🥇WAMR3D object API
60.0
🥇WAMR3D JS math
60.0
WAMR3D batched WebGL
58.7
WAMR3D object API WebGL
59.7
WAMR3D JS math WebGL
58.5
three.js WebGPU
12.2
three.js WebGL
44.1
Frames per second at each resolutionfps · same scene, 2 canvas sizesHigher is better
1280×720
🥇60.0
🥇60.0
🥇60.0
58.7
59.7
58.5
12.2
44.1
3840×2160
🥇60.0
59.9
🥇60.0
🥇60.0
🥇60.0
🥇60.0
11.9
42.8
Where the CPU time goesms per frame · 1280×720 · shorter bars mean less workLower is better
🥈WAMR3D batched
5.3
WAMR3D object API
8.3
WAMR3D JS math
7.1
🥇WAMR3D batched WebGL
5.2
WAMR3D object API WebGL
8.3
🥉WAMR3D JS math WebGL
6.6
three.js WebGPU
81.3
three.js WebGL
22.1

scene update: animation, transforms, world matricesdraw submission: the renderer’s CPU work

This is the cost behind the frame rate above: CPU time past the dashed line cannot fit in a 60 fps frame. GPU time is not measured.

  • WAMR3D · batched API
  • WAMR3D · object API
  • WAMR3D · JS math + WebGPU
  • WAMR3D · batched API · WebGL 2
  • WAMR3D · object API · WebGL 2
  • WAMR3D · JS math + WebGL 2
  • three.js · WebGPU
  • three.js · WebGL
Show as table
Showcase measurements for the selected resolution, mode and body count
Enginefps ▲update ms ▼submit ms ▼draw calls
WAMR3D · batched API60.01.83.59870
WAMR3D · object API60.03.84.59878
WAMR3D · JS math + WebGPU60.03.53.69896
WAMR3D · batched API · WebGL 258.71.83.49796
WAMR3D · object API · WebGL 259.73.94.49729
WAMR3D · JS math + WebGL 258.53.33.39763
three.js · WebGPU12.24.676.79712
three.js · WebGL44.14.517.69707

Where it is slower: the object API keeps vectors, matrices, quaternions and colours in plain JavaScript, but the low-level engine classes cross into WebAssembly on every call, which has a fixed cost. Single low-level math calls measured 1.3× to 4.0× slower than three.js. For per-value math next to the low-level API, use the JavaScript values of wamr3d/math and send results in one batched call: that updated 10,000 objects in 0.91 ms, against 2.46 ms for three.js. GPU time is not measured; it only shows in the frame rate.

Intel(R) Core(TM) i9-10900X CPU @ 3.70GHz, NVIDIA GeForce RTX 2070 SUPER, Chrome/157.0.8103.79 headless, Windows x64.
Every chart comes from one run on 2026-11-11. Raw logs: bench/results.

Live demos

Running in your browser.
Right now.

Every demo below is drawn by WAMR3D, with WebGPU or WebGL 2 depending on your browser, except the three.js engines you choose to compare against.

The demos need a browser with WebGPU or WebGL 2; the three.js WebGPU comparisons need WebGPU.

Get started

Install.
Import. Render.

The package ships the WebAssembly module, the object API, the low-level API and TypeScript typings.

$ npm install wamr3d
Rendering
A browser with WebGPU, or WebGL 2 where WebGPU is missing. Pages must be served over HTTP, not opened from file://.
Without a renderer
Node.js 18 or newer runs the math and the scene graph.
Resolving the package
Use a bundler or an import map for the wamr3d name.
TypeScript
Typings are included. Set "lib": [ "esnext", "dom" ].
main.js
import * as WAMR3D from 'wamr3d/compat';

await WAMR3D.init();

const scene = new WAMR3D.Scene();
const camera = new WAMR3D.PerspectiveCamera( 50, innerWidth / innerHeight, 0.1, 100 );
camera.position.set( 3, 2, 5 );
camera.lookAt( 0, 0, 0 );

const cube = new WAMR3D.Mesh( new WAMR3D.BoxGeometry(), new WAMR3D.MeshLambertMaterial( { color: 0x4f8cff } ) );
scene.add( cube, new WAMR3D.DirectionalLight( 0xffffff, 2 ), new WAMR3D.HemisphereLight( 0xbfd4ff, 0x30281e, 1 ) );

const renderer = new WAMR3D.WebGPURenderer( { antialias: true } );
await renderer.init();
renderer.setSize( innerWidth, innerHeight );
document.body.appendChild( renderer.domElement );

renderer.setAnimationLoop( ( time ) => {
  cube.rotation.y = time / 1000;
  renderer.render( scene, camera );
} );

Open source · MIT

Bring your scene.
Measure it yourself.

Run your three.js scene on WAMR3D's WebGPU or WebGL 2 renderer, compare the numbers, then batch the hot paths as your scene grows.