Implementing shadows for directional lights
In the previous chapter, we explored setting up a shadow mapping pipeline, focusing primarily on the API and the overall implementation process rather than achieving good shadow accuracy or versatility. In the Implementing shadow maps recipe from Chapter 10, we learned how to render shadows from spotlights using perspective projection for the shadow-casting light source. For directional light sources, which are often used to simulate sunlight, a single light source can illuminate the entire scene. Implementing shadows for such a light source requires constructing a projection matrix that accounts for the scene’s bounds. This recipe will explore how to implement this basic approach and incorporate shadows into our Bistro scene.
Getting ready
Ensure you revisit the Implementing shadow maps recipe from Chapter 10 as we move forward into the shadow mapping topic.
The demo for this recipe can be found in Chapter11/03_DirectionalShadows...