Chapter 7. Shadows
In this chapter, we will cover:
- Rendering shadows with shadow maps
- Anti-aliasing shadow edges with PCF
- Creating soft shadow edges with random sampling
- Creating shadows using shadow volumes and the geometry shader
Introduction
Shadows add a great deal of realism to a scene. Without shadows, it can be easy to misjudge the relative location of objects, and the lighting can appear unrealistic, as light rays seem to pass right through objects.
Shadows are important visual cues for realistic scenes, but can be challenging to produce in an efficient manner in interactive applications. One of the most popular techniques for creating shadows in real-time graphics is the shadow mapping algorithm (also called depth shadows). In this chapter, we'll look at several recipes surrounding the shadow mapping algorithm. We'll start with the basic algorithm, and discuss it in detail in the first recipe. Then we'll look at a couple of techniques for improving the look of...