Examples /

Silk atelier

Gather a suspended sheet of silk into folds that catch the light.

Initializing WebGPUwgpu-kit 2.2.0

Drag the silk to gather it. Release to let the folds settle. Arrow keys move the grip; Space releases it.

How it works

Graph-colored XPBD distance constraints solve a persistent cloth mesh on the GPU. Each dispatch updates disjoint edges to avoid write conflicts. Native WebGPU derives the deformed normals and weave direction for satin-like lighting. Picking reads positions once when a grip begins; dragging updates a uniform. Self-collision and tearing are not modeled.

Read the related guide →

Search concepts, APIs, and examples