.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.
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.
Designed as a modular, zero-mystery TypeScript codebase with clean separation between core evaluation, animation, WebGL2 rendering, and platform adapters.
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.
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.
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.
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.
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.
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.
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.
<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> import { Application } from "pixi.js";
import { MochiSprite } from "mochi2d/pixi";
const app = new Application();
await app.init({ resizeTo: window });
const avatar = await MochiSprite.from(url, {
renderer: app.renderer,
ticker: app.ticker,
});
app.stage.addChild(avatar); import { NodeRenderer, loadModelFromDisk } from "mochi2d/node";
const model = await loadModelFromDisk("assets/models/avatar/avatar.model3.json");
await model.startMotionFile("Animation/idle.motion3.json");
for (let i = 0; i < 60; i++) model.update(1 / 60);
const renderer = await NodeRenderer.open();
const { png } = await renderer.render(model, { width: 512, height: 1024 });
await renderer.close(); # Build library, viewer, CLI, and stdio MCP server
npm ci && npm run build
# Register the MCP server (reads only under --root)
claude mcp add mochi2d -- node "$PWD/dist/tools/mochi2d-mcp.js" --root "$PWD/assets/models"
# Or render directly from the CLI
npx mochi2d render assets/models/avatar --params ParamMouthOpenY=1 --out out/open.png Mochi2D is the foundation of a full open-source 2D avatar ecosystem — spanning web, native C++, authoring tools, live VTubing, and future language cores.
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.
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.
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.
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.
Dedicated Python and Rust cores are planned to bring clean-room .moc3 evaluation and rendering natively into Python AI/ML pipelines and Rust engines.
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.
Studies public format specs, runs black-box test vectors, and writes behavior descriptions in prose, math, and byte tables — never touching the implementation repo.
Audits and redacts every specification and feedback report before committing reviewed documents into cleanroom/inbox/.
Builds the TypeScript runtime, WASM kernels, and WebGL2 renderer solely from cleanroom/inbox/ and model files — with zero access to reference code.
Most of Mochi2D’s code was written by AI coding agents (Anthropic’s Claude) under the direction of the project’s maintainer following the clean-room process. To the extent copyright subsists in it, it is released under the MIT License (third-party notices in THIRD_PARTY_NOTICES.md). Models carry their own terms of use.
Live2D and Live2D Cubism are trademarks or registered trademarks of Live2D Inc. Mochi2D is an independent project; it is not affiliated with, endorsed by, sponsored by, or supported by Live2D Inc. The MIT License grants no patent rights — check applicable patent requirements (such as glue or blend shapes) for commercial use in your jurisdiction.