a Signed Distance Function (SDF) is a function that returns the distance from a primitive. there exist SDFs of many different shapes, both in 2D and 3D this project shows how to query the distance from a point to a map defined with SDFs the map is made up of rectangles and circles, using union and subtraction operations to form complete geometry move your mouse around - the circle around the mouse represents the closest distance to any geometry - green if the distance is positive, red if it's negative due to how the union and subtraction operators work, you may not get expected results at some points on the map SDF functions from Inigo Quilez transparent rectangle filler by @SpinningCube all other code by me, @falkimore