Lighting is one of the most important operations performed by 3D applications. Unfortunately, due to the specifics of graphics libraries and the graphics hardware itself, lighting calculations have one major drawback--they don't have information about positions of all drawn objects. That's why generating shadows requires a special approach and advanced rendering algorithms.
There are several popular techniques targeted at efficient generation of natural looking shadows. Now we will learn about a technique called shadow mapping.
An example of an image generated with this recipe looks like:
