# Refracting the Milky Way through a glass prism (Snell's law at each face)

**URL:** <https://discourse.threejs.org/t/refracting-the-milky-way-through-a-glass-prism-snells-law-at-each-face/95665>\
**Category:** Showcase\
**Created:** [October 21, 2026, 5:23pm UTC](https://discourse.threejs.org/t/refracting-the-milky-way-through-a-glass-prism-snells-law-at-each-face/95665 "2026-10-21T17:23:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![prismtect](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/prismtect/32/74101_2.png) [@prismtect](https://discourse.threejs.org/u/prismtect)\
**Post date:** [October 21, 2026, 5:23pm UTC](https://discourse.threejs.org/t/refracting-the-milky-way-through-a-glass-prism-snells-law-at-each-face/95665/1 "2026-10-21T17:23:30Z")

</div>

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](https://prismtect.com/?r=tjforum)  
Happy to go deeper on any part.

 ![1-lead](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/9/5/95e563c12d1c7afdf42de057d12b054603a9121f.jpeg)

---

<div class="post-metadata">

**Author:** ![PavelBoytchev](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/pavelboytchev/32/38639_2.png) [@PavelBoytchev](https://discourse.threejs.org/u/PavelBoytchev)\
**Post date:** [October 21, 2026, 6:14pm UTC](https://discourse.threejs.org/t/refracting-the-milky-way-through-a-glass-prism-snells-law-at-each-face/95665/2 "2026-10-21T18:14:26Z")

</div>

I’m not quite sure of the terminology, but refraction “bends” the light direction. I do not see refraction in your model. Splitting the white light into a rainbow is call dispersion (and it is a kind of wavelength-based refraction).

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/8/6/86c91113cdb1d7421fab6fca929025dc5ff7a679.jpeg)
