Home

SDFs

Signed distance functions (SDFs) are a mathematical representation of shapes used in computer graphics and related fields. For any point p in space, an SDF returns the oriented distance to the surface of the shape: positive if p lies outside, negative if p lies inside, and zero when p is on the surface. Thus the surface is the zero level set of the function. SDFs can be defined in 2D or 3D and are valued for their smooth, continuous representation of geometry.

Shapes are built from primitive SDFs for simple forms such as spheres, boxes, planes, cylinders, and toruses.

Rendering and interaction with SDFs often use ray marching, a technique that advances a ray by the

Applications include real-time rendering, collision detection in physics engines, procedural content generation, and tools for sculpting

Limitations include the difficulty of exactly representing very detailed surfaces without numerous primitives or high-resolution samples,

Complex
shapes
are
formed
by
combining
primitives
with
operations
that
analogize
union,
intersection,
and
subtraction,
typically
implemented
as
min,
max,
and
negation
of
the
component
distances.
This
makes
SDFs
convenient
for
constructive
solid
geometry
and
procedural
modeling.
distance
returned
by
the
SDF
until
it
approaches
zero
or
exceeds
a
threshold.
Normals
for
lighting
are
approximated
from
the
SDF
gradient.
SDFs
are
resolution-independent
and
can
be
smoothly
deformed,
blended,
and
animated,
enabling
smooth
transitions
between
shapes.
and
3D
texturing.
They
provide
a
compact,
adaptable
representation
for
implicit
surfaces,
volume
effects,
and
level-set
methods,
and
are
used
in
both
entertainment
and
scientific
visualization.
potential
performance
costs
for
large
scenes,
and
challenges
near
sharp
concavities.
Nonetheless,
SDFs
remain
a
widely
used
and
active
area
in
computational
geometry
and
computer
graphics.