Chapter 3. Shadow Mapping

In this chapter we will cover various shadow mapping techniques:

  • Spot light PCF shadows
  • Point light PCF shadows
  • Cascaded shadow maps
  • PCF with varying penumbra size
  • Visualizing shadow maps

Introduction

Over the previous two chapters, we covered various ways to light a scene. The Blinn-Phong light model we used in all those recipes provides a good approximation to how light interacts with the rendered scene's surfaces. However, one major shortcoming of this light model is that it doesn't take into account occlusion by the various scene elements. In other words, it lacks shadows.

In real life, when a light ray hits an opaque surface, it gets reflected or absorbed and does not continue in the same direction. The Blinn-Phong model ...

Get HLSL Development Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.