Game dev
Saved & recent

Signed distance field

Also called: SDF

Related terms: ray marching

A function or texture that gives, for any point, the distance to the nearest surface. Outside the shape the value is positive. Inside it is negative. The surface is where it reads zero.

Distance changes smoothly, so a small SDF texture can be enlarged and still give a sharp edge. That is how games draw crisp text at any size. SDFs also give cheap outlines, glows and soft shadows. Ray marching draws whole scenes from them.

Further reading
Sum and Product: Signed Distance Functions & Ray-Marching
Distance fieldCut at zero

View in the full Game dev collection