Tagging Pixels asShadowed or Unshadowed
Using stencil testing
- High-level algorithm does not say how to update only either pixels in or out of the shadow volume!
- The stenciling approach
- Clear stencil buffer to zero and depth buffer to 1.0
- Render scene to leave depth buffer with closest Zs
- Render shadow volume into frame buffer with depth testing but without updating color and depth, but inverting a stencil bit
- This leaves stencil bit set within shadow!