stretchystudio: Stretchy Studio: The Browser Editor That Treats 2D Characters Like Deformable Meshes

A look at the WebGL2 pipeline, Draft Pose workflow, and stencil-buffer tricks behind a new kind of animation tool for layered art.

8 min read • View on GitHub • More from mangolion

A layered character illustration is being pulled into a triangulated mesh inside a browser editor while a compact GPU engine underneath updates the shape in real time. The image explains the repo's core idea: 2D art becomes a live deformable surface instead of a bone-rigged puppet.
Stretchy Studio starts with the mesh, not the skeleton.
Key Takeaways

Why Meshes, Not Bones

Most 2D animation tools begin with the skeleton. Stretchy Studio begins with the surface. That choice matters because many modern character styles, especially painterly or anime-inspired art, live or die on subtle shape change: cheeks compress, hair masses bend, and eyes need clean occlusion. A mesh-first editor can express those motions directly, without making every gesture look like a hinge.

That is the conceptual flip at the center of the repo. Instead of asking how to attach artwork to joints, it asks how to make layered illustration behave like deformable material. It is a small change in vocabulary with a large effect on the kind of motion the tool can produce.

ApproachStrengthWeaknessBest fit
Bone-first 2D riggingPredictable limb motionRigid results on soft formsCartoon poses and mechanical motion
Generic canvas editorEasy to prototypeLimited animation structureSimple interactive demos
Mesh-first deformationOrganic squash and stretchMore careful setupLayered characters and expressive facial motion

The Trick That Keeps It Fast

The renderer is the hidden bet. Stretchy Studio uses WebGL2 with a custom pipeline built around VAOs and interleaved vertex buffers, then updates positions through a hot path called uploadPositions. The point is not just GPU acceleration. The point is that deformation can stay local, so the app does not have to re-upload or reassemble everything every time a vertex moves.

The renderer keeps topology stable and pushes only the changed vertex positions through the fast path.

That architecture explains why the project feels like a pro tool instead of a demo. Real-time deformation lives or dies on small implementation details, and this repo is full of them: scene graph traversal, world matrix computation, and a GPU-minded separation between mesh structure and mesh position updates.

How the Editor Thinks About State

The editor splits project data from editor state. That sounds ordinary until you see the consequence: the file model can stay clean and serializable while the UI lets an artist wander through Draft Pose experiments without immediately committing every nudge into the final animation state. In practice, that makes the app feel exploratory instead of brittle.

{
  "nodes": [
    { "id": "head", "parent": null, "type": "group" },
    { "id": "hair", "parent": "head", "type": "layer" },
    { "id": "face", "parent": "head", "type": "layer" },
    { "id": "eye-l", "parent": "face", "type": "part" }
  ],
  "editorState": {
    "poseMode": "draft",
    "playhead": 12,
    "selection": ["eye-l"]
  }
}

The flat parent-based node structure is also practical. It keeps hierarchy easy to serialize, easy to undo, and easy to reason about when the scene grows beyond a few parts. In a browser editor, that matters more than it sounds like it should.

A close-up eye socket shows an iris sliding behind a precise stencil boundary while the white of the eye acts as a clean mask. The image explains how a GPU-era clipping trick solves a very specific character animation problem without bleeding outside the socket.
The stencil buffer turns eye motion into a clean anatomical mask.

That eye example reveals the project’s taste. It is not reaching for generic masking abstractions when a hardware stencil buffer can solve the problem more cleanly. The result is a tool that feels built around the anatomy of 2D characters, not just around pixels.

Stretchy Studio's Place in the Pipeline

The repo sits between two workflows. Upstream, AI layer decomposition can break a character into parts that are usable for animation. Downstream, Stretchy Studio turns those parts into a mesh-driven performance system. That middle layer is the interesting one, because it turns raw segmented art into something a creator can actually pose, test, and ship.

Layered AI decompositionStretchy StudioDownstream animation
Produces separated character partsConverts parts into editable meshesUses committed poses and keyframes
Great at generating inputsGreat at shaping motionGreat at playback and iteration
Needs a bridge to become usableIs the bridgeNeeds stable exported state

That is why the project matters even if you never use its exact stack. It points at a browser-native future where the editor is not an afterthought to generation. It is the place where generated art becomes controllable motion.