Living Prism Observatory
A white light beam, a crystal lens, a prism and three turning stained-glass rings under a dark dome. Split the light, and the colours paint stripes up the dome while tuning prisms answer with chords. Get the files
The recording shows the WebGL2 path, not WebGPU.
What you get
- One HTML file, about 40 KB. No images, sound files, libraries or downloads: open the file and it runs offline.
- The file has both a WebGPU and a WebGL2 renderer. As it stands, the page you open by default runs in WebGL2, including on an M1 Mac where WebGPU can paint the same scene. A first-frame check runs before the canvas is sized, so it switches to WebGL2.
- Drag the floor to aim the beam. Drag a crystal to move it, and use the mouse wheel on it to turn it. The rings keep turning, and a slider sets their speed.
- Seven tuning prisms stand by the wall. When light hits one, it plays a chord, made live in the browser with Web Audio.
- Shatter & Reform breaks the lens into 14 shards. They fall, then snap back together about 3 seconds after you press the button.
What didn’t work at first
- On a test machine without a graphics card, WebGPU started but the screen stayed empty. The page now checks its first frame and switches to WebGL2 if nothing shows.
- On an M1 Mac that can show WebGPU, that same check still fails, because it runs before the canvas is sized. The page opens in WebGL2. That is what the recording shows. The HTML was not changed.
- The first version ran at about 3 frames per second there. Adding up the dome light in one simple strip made it more than ten times faster.
Good to know
- The colour split is exaggerated so you can see it. It’s a toy, not an exact glass simulation.
- Turning a crystal needs a mouse wheel.
- The recording shows the WebGL2 path, not WebGPU.
How it was made
Written as plain JavaScript by my AI build assistant, without a 3D library. Not with Claude this time.