Kōrei Rendered by distance

Kōrei

No 3D models. Every pixel is a distance, measured.

Light

Kōrei

This dreamscape is drawn by a WebGL2 fragment shader, which this browser has turned off. The notes below still explain how it works.

A landscape with no geometry

Nothing on this page was modeled. The stones, the gate, the sea and the sky are one mathematical function, evaluated for every pixel, sixty times a second — a technique called raymarching signed distance fields.

Distance fields

Each shape is a formula that answers one question: how far is this point from my surface? Spheres and a ring, blended with a smooth minimum so they melt together like wet clay.

Sphere tracing

For every pixel, a ray walks forward out of the camera. At each step it asks the scene how far the nearest surface is, and safely jumps exactly that far — until it lands on something, or escapes into the sky.

Light, twice more

Once a ray lands, two more are fired: one toward the sun, whose near-misses become soft shadows, and one bounced off the water, which is how the stones find their reflections.