Skip to content
MotionLab

Instanced Wave Field

Up to 40,000 cubes in one draw call, animated by a travelling wave.

sketchR3FGLSL

How it works

InstancedMesh with per-instance offsets baked into an attribute; the wave is computed in the vertex shader via onBeforeCompile.

Performance

Renders through the single shared <Canvas> via drei <View> — no extra WebGL context, and the render loop only runs while a view is mounted. 1 draw call regardless of count — watch the HUD.

Accessibility & reduced motion

In reduced mode the scene renders on demand only: a static, fully lit frame with no idle motion.

Playgroundshader
Instances
Export
// uCount: "10000"
uniform float uAmp; // 0.6
uniform float uSpeed; // 1.5