SDF basics 1
Concept
SDF refers to “Signed Distance Function”.
The surface of a geometry f(p) = 0
, an implicit function, where p
is a point in the space. Usually ray marching approach can be used to draw such geometry objects.
Ray marching
We start from the camera, trying to find the closest distance. Then from the distance on the ray, march again, and again, until the distance is too long, or it can’t reach much further.


Normals
Ref from Inigo Quilez
The normal of the surface can be down through the gradient of the SDF at points located on the surface.