Falling Constellations
Antique star-atlas constellations fall over a slowly turning spiral galaxy.
- Role
- Solo: the constellation generator, the WebGL2 galaxy and sky, the Canvas 2D atlas layer and the tests.
- Stack
- JavaScript, Canvas 2D, WebGL2, Bun
- Year
- 2026
A generative art piece that runs live in the browser. Randomly generated constellations, drawn in the style of an antique star atlas, drift down the screen forever over a slowly turning spiral galaxy; click anywhere to summon another. It is plain JavaScript modules with no dependencies and no build step.

Key features and results
The galaxy is layered like a real one: a warm core of old stars, blue-white arms, dark dust lanes along the arms and pink star-forming knots that slide along them, fade and are reborn. Behind it, nebulae form and dissolve while distant galaxies and star clusters drift. In front, each constellation draws in stars first, then the lines between them, in one ink colour with graded star sizes, and shooting stars cross as blue streaks with a lingering trail.

Architecture
Two stacked canvases. At the back, raw WebGL2 draws the far field and the galaxy: 60,000 stars on slightly tilted elliptical orbits, moved in the shader, so the spiral arms hold their shape instead of winding up. The scene renders brighter than white, then a bloom chain and an ACES tone map bring it back to the screen. At the front, Canvas 2D draws the constellations, the coordinate grid and the shooting stars, where fine lines are cheap. A seven-step quality ladder trades resolution, star count and bloom for frame rate; the page recovers from a lost WebGL context and falls back to Canvas 2D without WebGL2; Bun unit tests cover the pure logic.

Origins
It began as a Canvas 2D prototype. Its galaxy spun inner stars faster than outer ones along a fixed spiral, which looks right for a minute but winds the arms up: the centre gains a full turn on the edge about every 65 seconds, and the arms smear out within minutes. Reading up on how real galaxies keep their shape led to the rebuild: nested, slightly tilted ellipses, then HDR and bloom, then dust, gas and star-forming knots. The rebuild happened in one day, 31 October 2026, across 13 commits.
