This CodePen draws a corridor with a fullscreen shader. Each pixel traces a ray through a distance field that describes the walls, floor, and repeated panels.
Repeat a single segment
Fold the coordinate along the corridor into a single cell before evaluating its signed distance function. Every cell then reuses the same geometry. Generate the terminal graphics on a 2D canvas and sample those textures on the walls.
Make the floor reflect the scene
When the primary ray hits the floor, march a reflected ray from that point. Blend the result into the floor shading with a Fresnel term, so the reflection is stronger at grazing angles. The original demo uses a deterministic path with eased turns to fly through the corridor.
Open the original demo by sabosugi · Original article (Chinese)



