Real-Time Shadows CHAPTER 2——Basic Shadow Techniques

over the last years, many contributions have been made in the field of shadows, and many have found their way into computer games. but at the time of this book’s writing, even though we have come a long way, accurate soft shadows can not be obtained in sufficient quality in real time, and we are only on the verge 边缘 of achieving pixel-accurate hard shadows for geometrically complex scenes at acceptable speed. 只能得到硬阴影

both areas still have room for improvement, especially as a scene with a single point light is not a very common scenario. in modern movie productions, hundreds of lights are placed by hand to create a wanted illumination. in this chapter, we analyze standard techniques to compute shadows based on point lights, where each point light gives rise to a so-called hard shadow. the name stems from the fact that such a shadow is binary in nature; either a point is lit or lies in shadow, creating a sharp, or hard, boundary. a hard shadow can only be created by an infinitesimally 无穷小 small light source, which in practice never appears in real life. nevertheless, in computer graphics, they give useful results and serve as an approximation for very distant light sources. typially, they also represent the basis for more evovled methods.

in the following, we will start by presenting probably the most simple algorithm for hard shadows: projection shadows (section 2.1). then, we given an overview of the two most common and also more general techniques used for hard shadow computation on graphics hardware, namely, shadow mapping (section 2.2) and shadow volumes (section 2.3). we will see that these latter two algorithms are relatively well adapted to current hardware and are at basis of many alogorithms available today. shadow mapping is particularly interesting because it only requires a little information about the actual scene geometry and solely reiles on an image that encodes the distance to the light source (plane). nevertheless, there are shortcomings and, over the years, much research has focused on improving the algorithms. besides explaining the main principles in detail, we will hence also take a closer look at such enhancements. due to their volume, more advanced topics relating to shadow mapping are covered later in chapters 3,4,and 5.

2. 1 projection shadows

projected shadows are very simple but suffer from several shortcomings, which nowadays render them a somewhat outdated method for most real-time applicatoins. however, they still have their use cases when artistic freedom of modifying the shape, color, and texture of the shadows is more important than physical accuracy.
Real-Time Shadows CHAPTER 2——Basic Shadow Techniques
figure 2.1. if the light source is located between the plane and any part of the shadow caster, the projection erroneously gives rise to so-called anti-shadows.