Game dev
Saved & recent

CSG

Also called: constructive solid geometry

Related terms: boolean operations, brushes, smooth union

Building shapes by combining simple solids. Union merges two. Subtract carves one out of the other. Intersect keeps only the overlap. Level editors use it to cut rooms and doorways out of blocks.

With signed distance fields each operation is one line. A smooth union blends the two shapes where they meet, like clay.

union = min(a, b) subtract = max(a, -b)

Further reading
John C. Hart: Sphere Tracing: A Geometric Method for the Antialiased Ray Tracing of Implicit Surfaces (CSG section)
solid A solid B union subtraction intersection
The blue volume crosses the violet solid. Union keeps both, subtraction removes the blue volume from the violet solid, and intersection keeps only the shared volume.

View in the full Game dev collection