Skip to main content

GPU skinning

· One min read
Balaur

A rig deforms its mesh on the GPU, from a palette of joint matrices, and the mesh's buffers are never touched.

What landed

  • 3D rigs. An imported glTF rig — joints, weights and clips — is skinned in the vertex shader from a joint palette the animation writes each frame. Thousands of vertices cost the palette upload, not a rebuild.
  • 2D polygons. A polygon with bone weights is skinned the same way, at its pixels_per_unit, so a skinned character in 2D is one draw.
  • The CPU path stays. A node with its own material skins on the CPU, and headless tests measure that path: the reference the GPU result is checked against, with no GPU in CI.
[nodes.mesh]
source = "models/column.glb"

[nodes.animation]
clip = "animations/sway.toml"

balaur import model.glb writes the joints, the mesh and the clips as TOML the editor edits. Animation has the rig tools.