Wave J2 · Task 5 · WebGL · THROWAWAY PROTO — 2026-06-21

Seafloor sand — WebGL technique bake-off

Two WebGL approaches to "individual grains of sand" that react to a click. Panel A uses a pure vertex-shader displacement field (lightest — no GPU compute passes). Panel B uses GPGPU ping-pong simulation (real spring physics per grain). Each panel auto-demos every 2–3 s. Click the sand to trigger manually. Toggle (top-right) for light vs dark.

Panel A · Displacement field (lightest)

Vertex-shader displacement

9 000 grains with fixed rest positions. A ring buffer of 6 click events drives an analytic radial push + decaying hump in the vertex shader. Zero GPU compute passes — cheapest possible.

click the sand

Panel B · GPGPU grains (real physics)

GPU simulation (spring + impulse)

4 096 grains (64×64 texture). Position + velocity updated every frame by simulation fragment shaders. Click impulse repels; spring restores rest bed. Real emergent tumbling and pile-settling.

click the sand