[OC] An orca pod hunting a herring ball. Every fish and every ray of light computed live
This runs live on an Apple silicon GPU.
The school is a classic flocking simulation, a few thousand agents with separation, alignment and cohesion plus a milling bias that makes them form the rotating ball. The orcas are autonomous agents with a hunt state machine (patrol, position, charge, recover) that carve a void through the school as the fish panic, and the fear spreads neighbour to neighbour faster than any fish swims.
The god rays are computed each frame from a simulated water surface, and the marine snow drifts through them. Everything persists and evolves by its own rules, nothing is keyframed, and it never repeats. Built in Swift and Metal as part of TideGlass, a small Mac app I make where worlds like this run on a second monitor while you work and interacts with your music. Happy to answer anything about the sim.