A glass tetrahedron turns under a long-exposure Milky Way above a winter coast, and the starlight leaves it as a rainbow on the still water.
How it’s built, briefly:
- The glass is a MeshPhysicalMaterial (transmission 1, ior 1.5, dispersion 0.4) in front of a copy of the exact patch of sky it covers, lit by a PMREM “dark studio” of eleven softbox planes.
- The rounded body is the convex hull of small spheres at the corners of a smaller core, with every normal recomputed from the nearest core face, so the faces stay flat and each edge carries one clean highlight.
- The rainbow is traced per colour in JS: enter at the first face (vector Snell), cross, leave at the next face. Each of the six bands has its own index (1.46 + 0.045 i), wider than real glass so the fan reads.
- The sky is computed, not a photo: a Milky Way glow worked out cell by cell from noise, painted in a worker on an OffscreenCanvas and kept in IndexedDB.
Live, phones too, free: Prismtect: a prism that refracts the Milky Way
Happy to go deeper on any part.

