A final project for an independent study on shader programming: recreating the "Bad Apple" music video in real time using 1,000 GPU-instanced paper airplanes, each acting as a single pixel-like unit in the final image.
Demonstration below, all rendered in real-time. Some fidelity was lost in the video compression for this web portfolio.
Side-by-side comparison with the original music video.
Airplanes are programmed to stay within the white areas of each frame. Without accounting for population density, they would clump together instead of spreading out evenly within those areas, leaving the white regions looking sparse and hollow instead of solid, filled shapes.
The naive fix, each airplane checking every other airplane's position to space itself out, is O(n²) across 1,000 objects per frame, which is far too expensive to run in real time.
A two-pass compute shader architecture replaces the pairwise comparison entirely. The first pass has every airplane log its screen position in parallel to build a population density map. The second pass has each airplane sample that density map directly, rather than iterating over every other airplane, to decide where to move. Each airplane updates its own transformation matrix independently through the compute shader, and the whole set is rendered with GPU instancing.
A solo project delivering a real-time recreation of the entire music video, driven by 1,000 procedurally animated objects, running at 500fps.