Implementing shadow maps in OpenGL
As we learned from the previous chapters, we can render complex scenes with varying sets of materials, including physically based rendering (PBR) materials. While these techniques can produce very nice images, the visual realism of our scenes was severely lacking. Shadow mapping is one of the cornerstones of getting more realistic rendering results. In this recipe, we will give initial guidance on how to approach basic shadow mapping in OpenGL. Considering OpenGL is significantly less verbose compared to Vulkan, this recipe's main focus will be the shadow-mapping algorithm details, while its Vulkan counterpart is focused on the Vulkan application programming interface (API) details to get you started with shadow mapping.
Getting ready
The Chapter8/GL01_ShadowMapping
demo application for this recipe implements basic steps for a projective shadow-mapping pipeline. It would be helpful to quickly go through the code before reading this recipe...