Gaussian splat encased in refractive glass — real screen-space refraction + chromatic dispersion (PlayCanvas)
Latest experiment with Gaussian splats in the PlayCanvas engine: sealing a splat inside a solid glass shape and refracting the view through it. Video above; live demo at the bottom.
You pick the shape — cube, sphere, gem, or hex prism — and the glass bends both the splat and the skybox behind it at the surface, with chromatic dispersion splitting the colors slightly. There are live controls for refraction index, reflection, dispersion, and frost.
How it works:
- The splat renders into its own layer placed before the camera frame's scene-color grab pass, so the refractive glass material can sample that grab texture and bend the already-rendered splat + background through the shape's surface.
- The splat is cropped to the inside of the shape by scaling any splats outside its faces to zero, and splats near the surface are shrunk a bit so they don't poke through the glass.
- Refraction/dispersion/reflection are a fairly standard screen-space glass material on the shape mesh — the interesting part was getting the splat to live inside the grab pass so it refracts correctly rather than just compositing on top.
Runs on WebGPU and WebGL. It's an open PR into the engine examples, so the full source is there to read and reuse.
Live demo: https://engine-it4qgogtr-playcanvas.vercel.app/#/gaussian-splatting/glass-refraction
Happy to answer questions on the approach.