Three.js as a compile target for phones and headsets
Three-Live compiles ordinary Three.js scenes on-device into native Filament, RealityKit, and WebXR renderings, so one script runs everywhere.
What it does: It takes standard Three.js code (THREE.Mesh, userData.xr, KHR_interactivity) and compiles it in a sandboxed Rust VM into a GLB that native renderers load directly: Google Filament and Jetpack XR SceneCore on Android, Apple RealityKit on iOS and visionOS, and WebGL2/WebXR on the web. The same script also works headlessly through three-live-cli, which renders PNG contact sheets with no GPU, lints scenes spatially, and converts to .glb or .usdz. An MCP server exposes all of that to coding agents in Gemini CLI, Claude Code, and other clients.
The interesting bit: The pitch is that LLMs write short Three.js well and write hundreds of lines of platform-specific 3D boilerplate badly, so Three.js becomes the portable IR and the compiler handles the native plumbing. The agent “gym” tools (three_live_gym_reset / step / close) let an agent act, observe, and react inside a scene to verify a level is winnable, with no ML involved despite the name.
Key highlights
- Zero-copy JNI on Android; the compiled GLB buffer goes straight into Filament’s asset loader.
- 60 Hz rigid-body physics and live
KHR_interactivitygraphs step per frame on both Android and RealityKit. - Web components stay small:
< 35 KB gzviewer,< 100 KB gzfor the XR element, with 1-tap mobile AR handoff. - AI edits compile in the sandbox first, get one auto-repair attempt, and only then hot-swap, so a bad generation never breaks the live scene.
- Voice selection resolves phrases like “the two red chairs on the left” locally, with no model call, and asks when a reference is ambiguous.
from-imagesynthesizes a procedural scene from a photo, sketch, or blueprint, with side-by-side and silhouette-diff comparison sheets.
Caveats
- Explicitly not an officially supported Google product.
- AI texture baking needs an external image endpoint (
THREE_LIVE_AI_IMAGE_ENDPOINT), and web AI edits expect you to proxy an LLM endpoint from your own server.
Verdict: Worth a look if you build 3D or XR apps and want one scene description across Android, Apple headsets, and the web, or if you want coding agents that can see and verify the 3D they generate. Skip it if you need a supported product with a vendor behind it.
Frequently asked
- What is google/three-live?
- Three-Live compiles ordinary Three.js scenes on-device into native Filament, RealityKit, and WebXR renderings, so one script runs everywhere.
- Is three-live open source?
- Yes — google/three-live is open source, released under the Apache-2.0 license.
- What language is three-live written in?
- google/three-live is primarily written in TypeScript.
- How popular is three-live?
- google/three-live has 504 stars on GitHub.
- Where can I find three-live?
- google/three-live is on GitHub at https://github.com/google/three-live.