A distance, and a sign

SDF field explorer

A signed distance field does not store a shape. It stores, for every point in space, how far away the nearest surface is — negative inside, positive outside, zero exactly on it. Move the pointer anywhere in the field below: the dashed circle is the largest circle you could draw at that point without touching the surface, and its radius is the value the function returned.

The field d(p)
Move to probe · drag the centre dot to move the shape
outside — d > 0 inside — d < 0 the surface — d = 0 nearest point on the surface
Shape and field parameters
0.75
0.45
0.20
d along the dashed line cross‑section

The field is smooth and continuous everywhere — it crosses zero as you pass through the surface and keeps growing beyond it. That is what makes it safe to march along.

The whole shape live

      
Probe position p
Distance d(p)
Sign says
Largest safe step from here
Four lines of arithmetic, no vertices. Nothing here is stored as geometry — there is no vertex buffer, no triangle list, no resolution. The shape exists only as the set of points where one short function happens to return zero, and you can ask that function about any point in space, at any precision, for the cost of a few multiplies. Keep an eye on the last readout: the distance to the nearest surface is exactly how far a ray could travel from here without any risk of passing through something. That single observation is the whole of sphere tracing, which is the next demo.