Introduction to Distance Functions

Introduction to Distance Functions

Distance functions are mathematical expressions of a shape in 3D. Distance functions were made popular by the research and demos of Inigo Quilez. Let's have a look at one of the most simple distance function, that of a sphere: float sdSphere( vec3 p, float r ) { return length(p)-r; } This function returns the distance from a given point in s...
Continue reading