Ball Physics

160 balls, simulated entirely on the GPU. Position and velocity live in a float render target; each frame a fragment pass integrates them and resolves every contact, then the spheres read their own centres out of that texture in the vertex shader. The CPU uploads gravity and a timestep — nothing else. A shadow pass reads the same texture from the light’s point of view, so the heap shadows itself without a single position ever coming back to the CPU. The glass reflects the pile by marching its reflected ray through an off-screen copy of the scene.

160
0.62
9.8
0 fps · 0.0 ms
160 balls · 4 GPU passes per frame: physics, shadow, scene copy, render