3D and Graphics/Rays and SDFs.
Rays and SDFs.

2.0k words | Dan Hollick

Rays and SDFs.

Rays ask where a line meets a scene; signed distance fields answer how far any point is from the nearest surface.

Rays and SDFs. chapter cover

Rays ask where a line meets a scene; signed distance fields answer how far any point is from the nearest surface. The apparent simplicity comes from a set of carefully chosen representations, transformations and physical assumptions working together.

camera raydistance samplessurface hitnormal + light

Intersections

Analytic shapes can be solved directly, while complex scenes need acceleration structures.

This is one part of a longer chain: camera ray becomes distance samples becomes surface hit becomes normal + light. The useful abstraction hides the physical work, but the underlying constraints still shape the software built above it.

Ray marching

Distance estimates let a ray advance safely through empty space in large steps.

The implementation is full of compromises. Precision, speed, storage and energy rarely improve together, so practical systems choose the errors people are least likely to notice.

Normals

The gradient around a surface reveals its orientation for lighting.

Once this layer is visible, familiar design conventions stop looking arbitrary. They are accumulated responses to the capabilities and limits of the machinery below.

╌╌ END ╌╌
Next chapterBlurs, noise and other effects.

A visual study based on the original chapter. Text is condensed and rewritten.