The .l2d format

Bundle

An .l2d file is a standard ZIP archive. Format identifier: layer2d/v1. JSON members are deflated; textures are stored uncompressed so the runtime can read them directly.

layer2d.json       open manifestpack.json          meshes, keyforms, physics, expressionstex/<id>.webp      layer textures, eye masks, expression piecespreview.png        optional portrait, 1200 × 1600 RGBASHA256SUMS.json    digest for every other member

Required: layer2d.json, pack.json, SHA256SUMS.json, and every texture referenced by pack.json. Absolute paths, .. segments and duplicate entries are rejected.

Manifest

layer2d.json describes the avatar without parsing the runtime pack.

{  "format": "layer2d/v1",  "id": "demo",  "name": "Layer2D Demo",  "version": "1.0.0",  "license": "MIT",  "entry": "pack.json",  "texExt": "webp",  "canvas": [1200, 2000],  "stats": { "layers": 19, "expressions": 5, "chains": 2 },  "capabilities": { "obsAlpha": true, "springChains": true },  "preview": "preview.png"}
FieldTypeMeaning
formatstringAlways layer2d/v1. Readers reject other values.
idstringLowercase slug, unique per avatar.
namestringDisplay name.
versionstringAvatar release version (semver).
licensestringLicense identifier or summary for the artwork and rig.
entrystringRuntime pack path, normally pack.json.
texExtstringPrimary layer texture extension: webp or png.
canvas[w, h]Source canvas size in pixels. All mesh coordinates use this space.
statsobjectlayers, chains, samples, expressions, holds, outfits, exprPieces, vowels. Must match pack.json.
capabilitiesobjectheadYawSamples, headPitch2D, springChains, tailRig, obsAlpha, micLipSync, webcamTracking.
previewstringOptional portrait path.

Runtime pack

pack.json holds everything the player draws and animates. Each entry in layers references tex/<id>.<texExt>; optional per-layer variants add companion textures.

KeyContents
layersOrdered draw list: mesh, depth, warp grid, toggles. Variants: _sheer, _hole, _up, _palm, _posed, _wipe, _open.
samplesHead-yaw keyforms by angle.
chainsSpring chains for hair locks, ears, tail, ribbons and tassels.
exprfaces, pieces, holds, vowels and blink data.
outfitsNamed layer toggle sets.
hairStylesAlternate hair layer sets.

Depth & physics

Hair is split into stacked strata — back, back sides, scalp cap, bangs, sides — each with a signed depth. Back hair carries negative depth, so head turns produce true parallax instead of crossfades. Hair opacity never fades during a turn.

Spring chains are multi-joint and solved per frame in the runtime, independent of frame rate.

Integrity

SHA256SUMS.json maps every member except itself to its SHA-256 hex digest. A valid bundle has an exact key match, matching digests, all referenced textures present, and manifest stats equal to the pack.

$ python -m rigkit.format validate demo.l2d

License

The layer2d/v1 specification is open and royalty-free. Anyone may read, write and ship .l2d files without fees. Each avatar declares its own artwork license in the manifest.