I gave a puzzle game
real ray tracing.
A drop-and-merge game where the pieces are physical glass. Not sprites of glass — actual refraction, computed per pixel, on the phone's ray tracing hardware. Light bends through each cube, picks up its colour on the way past (Beer–Lambert absorption), and lands on the shelf as a coloured shadow.
The cubes are not a mesh. Each one is a signed distance field the ray marches to find the true rounded surface, which means the edges are mathematically round rather than faceted, and the code knows the exact distance light travelled inside the glass.
At the edges a six-wavelength spectral fan splits the light into visible prism fire — but only at edges and corners, because that is the only place real glass does it.
- Renderer
- Metal, hardware RT
- Target
- 120 Hz locked
- Requires
- A17 Pro or newer
- Fallback
- Full SceneKit path
The bug I chased twice before diagnosing it. Cubes looked like they had square corners. I twice guessed at the geometry and twice was wrong. So I built a debug view that paints each ray branch a different colour — and it showed a clean rounded arc. The geometry was never wrong. At a cube's silhouette the surface is edge-on, so Fresnel drives it to pure reflection — and my environment had nothing to the sides to reflect. The rims rendered near-black, and a dark outline reads exactly like a hard edge. The fix was adding studio light panels outside the camera's view. Diagnose, don't guess.