#418Refraction Through Glass
A slab of glass hangs in front of a drifting field of coloured light. Its shape is an SDF, and every pixel inside it re-samples the background along a bent vector: the surface normal — recovered from the SDF gradient — steers the offset, ramping up toward the edges where the glass acts most like a prism, while the body adds a gentle slab parallax. Red, green and blue are refracted by slightly different amounts so the rims bleed into spectral fringes, and a Fresnel highlight rings the silhouette. Move the pointer to slide the block across the scene; scroll to change its refractive index.