Diffraction grating cube 🌈

After seeing a few diffraction grating objects in real life, I wanted to try putting a different grating on each face of a cube, with real spectral diffraction in a #glsl fragment shader.

Oct 21, 2026 · 1:01 PM UTC

9
15
127
2,782
RepliesRelevant
Replying to @Jaenam97
@Jaenam97 Is that running in the browser?
1
0
1
205
Replying to @ricardoalves
@ricardoalves Yup! In the browser and in Framer, currently in my own playground
0
0
1
37
Replying to @Jaenam97
@Jaenam97 There's a really good article by Maximeheckel on refraction and dispersion that I would strongly recommend for anyone that wants to make something similar.

blog.maximeheckel.com/posts/refracti…
0
0
2
79
Imagine your ideas becoming a playable story.
73
270
4,351
3,002,110
Replying to @Jaenam97
@Jaenam97 different grating per face is a fun idea. how many wavelengths are you sampling per pixel
0
0
2
65
Replying to @Jaenam97
@Jaenam97 That’s what we call a Bobby Dazzler
0
0
1
45
Replying to @Jaenam97
@Jaenam97 the centre light splitting clean across the face caught me. is each face a different grating angle, or is most of that shift just the viewing angle changing?
0
0
0
63
Replying to @Jaenam97
@Jaenam97 Real spectral diffraction on every face, love it 🌈
0
0
1
81
Replying to @Jaenam97
@Jaenam97 Looks so real🥺
0
0
1
105
Replying to @Jaenam97
@Jaenam97 A different grating per face is such a nice way to show it: the same light, six personalities. How many wavelength samples did you need before the rainbow stopped banding?
0
0
0
26