March 2013
Intermediate to advanced
984 pages
26h 18m
English
Chapter Objectives
After reading this chapter, you’ll be able to do the following:
• Code a spectrum of fragment shaders to light surfaces with ambient, diffuse, and specular lighting from multiple light sources.
• Migrate lighting code between fragment and vertex shaders, based on quality and performance trade-offs.
• Use a single shader to apply a collection of lights to a variety of materials.
• Select from a variety of alternative lighting models.
• Have the objects in your scene cast shadows onto other objects.
In the real world, we see things because they reflect light from a light source or because they are light sources themselves. In computer graphics, just as in real life, we won’t be able to see an object ...