junkpile

22 · wgpu Skeletal Pose Lab

A standalone Tauri 2 + wgpu 29 example for loading, animating, inspecting, and manually posing skinned glTF/GLB characters on a native GPU surface.

Run

npm install
npm run dev:metal

Other backend wrappers are included:

npm run dev:vulkan
npm run dev:dx12
npm run dev

What this example adds

Bundled model

src-tauri/assets/sample-skinned.glb is a generated four-joint weighted tube with a looping wave animation. It is intentionally small and inspectable. It proves the entire skinning path without requiring an external asset.

External assets

Use Open glTF / GLB to select a character. For .gltf files, keep referenced .bin and image files beside the JSON document.

The example currently focuses on one standard skinning layer:

Morph targets are reserved for example 23.

Architecture

glTF / GLB
   ↓
Rust scene graph + skins + animation channels
   ↓
node local pose → node world matrices
   ↓
inverse(mesh world) × joint world × inverse bind
   ↓
per-primitive joint storage buffer
   ↓
WGSL linear-blend skinning
   ↓
material shading + skeleton diagnostic overlay

See SKELETAL-POSE-GUIDE.md for the data flow and extension points.

22.1 correction

The skeleton overlay uses PrimitiveTopology::LineList. Its depth state now uses DepthBiasState::default() because nonzero depth bias is valid only for triangle primitives in wgpu 29. The mesh pipeline remains unchanged.