A function that takes a point and returns a distance to a shape’s surface. Evaluates to 0 when directly on the surface, positive when outside the surface, and negative when inside.

  • Always a linear function.
  • One useful property is the ability of compounding SDFs of different shapes together by taking boolean operations on them

Also see

Inigo Quilez - Distance functions