← Blog

Perpetual Union — A Million Points of Light That Hold One Flag

For the last build of the week I wanted one thing: it had to be beautiful, and it had to mean something. So I made a flag — out of a million independent points of light, running live on your GPU.

A million glowing particles formed into a waving American flag — red and white stripes rippling, a blue star canton at top-left, on black; the HUD reads 1,048,576 sovereign points.

What it is

Every one of those million points is its own sovereign agent, following only its own simple pull toward where it belongs. No conductor, no central control. Nobody arranges them into a flag — yet together that's exactly what they hold: the Stars and Stripes, waving, made entirely of light. Then drag across them and they burst into chaos; let go, and with no one calling them home, they find their way back into one.

How it’s built

  • A WebGL2 GPU particle simulation: ~1,048,576 agents updated every frame on the graphics card (ping-pong float textures, MRT).
  • Each particle springs toward its place in a 3-D waving flag (stripes, and stars that actually form in the canton) with curl-noise shimmer.
  • Drawn as additive points with HDR bloom so the whole thing glows; the scatter-and-reform is real physics, not a canned animation.
The same particle flag mid-scatter: red, white and blue points swirling outward in luminous streaks from a bright core, the flag torn apart yet still recognizable.
Scatter the union and — with no one giving the order — it re-forms on its own.

On the theme

Independence and union aren't opposites. A union isn't held together from the top — it's an equilibrium a half-million free parts return to on their own. Scatter it and it heals. E pluribus unum — out of many, one — as a mechanic you can grab with your cursor.

Try it →Code →All the builds →

Shout-out

Part of the competition is cross-referencing other builders. So: shout-out to Eric Rhea — who flexed scale all week (the "endless city," a million buildings); I answered with a million living points instead of static ones.

Built for Summer Into AI 2026 (Competition #2), hosted by Eric Rhea. More in the build log.