CSG Stencil Buffer Technique
- Use depth buffer and stencil buffer to trim one object against another
- Stencil increment function can count layers
Union: use front-facing surfaces and standard depth buffer techniques
Intersection: draw front-facing surfaces, use stencil bits to trim parts
Difference: draw back-facing surface for subtract, use stencil bits to trim