MIT Licensed Clean-Room · v0.21.0

Open-source runtime for Live2D models.

Mochi2D loads .moc3 (versions 1–6) and .model3.json packages directly in TypeScript and WebGL2 — built from scratch with zero Live2D code, bit-identical evaluation, and pixel-identical reference renders.

Runs in Browser WebGL2 PixiJS v8 Node.js MCP & CLI
mochi-mascot.moc3 v6
ArtMesh: 5 drawables Warp: 4×4 · Physics: on
Move pointer or drag sliders
Conformance

Tested against the official runtime, bit for bit.

Read conformance report →
573 / 573
Static scenarios bit-identical
+ 1,106 second-pack scenarios
0 differing px
Across 209 reference renders
53 catalog + 156 second pack
28,839 / 28,856
Animation frames bit-identical
17 differ only in ~10⁻³¹ double tails
.moc3 v1–6
Full format coverage
827 scenarios in conformance catalog

Results from Mochi2D’s own test catalog runs comparing against Live2D’s Cubism SDK runtime and SwiftShader reference renderer. These are independent test results, not a third-party certification.

Core Runtime

Everything needed to load, animate, and inspect models.

Designed as a modular, zero-mystery TypeScript codebase with clean separation between core evaluation, animation, WebGL2 rendering, and platform adapters.

01 Format

.moc3 v1–6 & companion files

Reads .moc3 binaries (versions 1–6, little & big-endian) alongside .model3.json, motions, expressions, physics, pose, display info, user data, and CJK-encoded .zip archives.

02 Rendering

Direct & layered WebGL2 pipelines

Supports offscreen render targets, advanced blend modes, clipping masks (fast mask atlas or per-drawable reference masks), and a drop-in MochiSprite display object for PixiJS v8.

03 Evaluation

WASM kernels + float32 determinism

Fixed float32 order of operations across warp deformers, rotation deformers, glue, and blend shapes — powered by assembled WebAssembly kernels with a bit-identical JS fallback.

04 Animation

Physics, expressions & motion sync

Runs motion queues, fade-blended expressions, pose, eye blink, breath, look, live in-memory microphone lip sync, and .motionsync3.json via Mochi2D’s own audio analysis.

05 Tooling

Headless Node, PNG & .moc3 I/O

Evaluate models without a browser, render reference PNGs with NodeRenderer, or read, validate, and write .moc3 and .physics3.json data byte-for-byte with mochi2d/headless.

06 Agents & Viewer

Built-in viewer, CLI & MCP server

Inspect models in the browser with curve graphs, file diffing, and expression editing — or let AI agents load, pose, hit-test, and render models over stdio MCP.

Quickstart

Up and running in minutes.

Clone the repository to launch the interactive web viewer, bundle the library with npm run build:lib, or connect an AI agent over MCP. Requires Node ≥ 20 and WebGL2.

$ git clone https://github.com/waifucave/mochi2d.git && cd mochi2d && npm ci && npm run dev
index.html
<canvas id="model" style="width: 100%; height: 600px"></canvas>
<script type="module">
  import { MochiView } from "./mochi2d.js";

  const view = new MochiView(document.getElementById("model"));
  const model = await view.load("models/my-model/my-model.model3.json"); // or .zip / File
  view.on("hit", () => model.startMotion("TapBody"));
</script>
Ecosystem

One open stack from rigging to live stream.

Mochi2D is the foundation of a full open-source 2D avatar ecosystem — spanning web, native C++, authoring tools, live VTubing, and future language cores.

Mochi2D

TypeScript & WebGL2 Core
Available Now · v0.21.0

From-scratch web and Node runtime for .moc3 v1–6 models. Includes WASM evaluation kernels, direct & layered renderers, interactive viewer, headless .moc3 reader/writer, CLI, and MCP server.

TypeScriptWebGL2WASMPixiJS v8Node / MCP

Mochi2D Native

C++ Runtime & GPU Backends
In Development · Opening Soon

Native counterpart to Mochi2D with bit-exact evaluation, a software reference rasterizer, frame-plan backends for GL, Vulkan, Metal, and D3D11, and a C API built for Unity, Godot, and Unreal bindings.

C++ / SSE2OpenGLVulkan 1.1MetalDirect3D 11
Private repo · Moving to Mochi2D org

Mochi Maker

Open-Source Rigging & Animation Editor
In Development · Opening Soon

An open-source, agent-first alternative to Live2D Cubism Editor built on Mochi2D. Imports layered PSD/OpenRaster art, builds meshes, nested warp/rotation deformers, timelines, physics, and exports .moc3 v3–5.

PSD / ORA ImportDeformersDope Sheet.moc3 ExportMCP Bridge
Private repo · Moving to Mochi2D org

Mochi Studio

Open-Source Live Avatar & VTubing App
In Development · Opening Soon

A clean-room live-avatar app built on Mochi2D — webcam face/hand tracking, mic lip sync, parameter mapping, VTube Studio settings import, OBS Spout2/Linux virtual camera, 6-avatar WebRTC collabs, and an agent bridge.

Face & Hand Tracking.vtube.jsonSpout2 / vcamWebRTC CollabsAgent Bridge
Private repo · Moving to Mochi2D org
Planned Language Cores

Python & Rust Cores

Dedicated Python and Rust cores are planned to bring clean-room .moc3 evaluation and rendering natively into Python AI/ML pipelines and Rust engines.

Repository roadmap: Repositories currently live under github.com/waifucave and will transition to the dedicated Mochi2D GitHub organization as the native, editor, and studio repositories are opened publicly.
Clean-Room Process

Independent by construction.

Mochi2D contains none of Live2D’s code or files. Every line in the runtime is written in isolation from reviewed functional specifications and observed test vectors.

01 · Research Side

Functional Spec

Studies public format specs, runs black-box test vectors, and writes behavior descriptions in prose, math, and byte tables — never touching the implementation repo.

02 · Coordinator

Reviewed Inbox

Audits and redacts every specification and feedback report before committing reviewed documents into cleanroom/inbox/.

03 · Implementation Side

Clean-Room Code

Builds the TypeScript runtime, WASM kernels, and WebGL2 renderer solely from cleanroom/inbox/ and model files — with zero access to reference code.