ABSTRACT

Lighting effects can greatly enhance the three-dimensional nature of a scene. This chapter describes different types of lighting (ambient, diffuse, specular, and emissive), light sources (directional and point), illumination models (Lambert and Phong), and shading models (flat, Gouraud, and Phong). The graphics framework is extended to include objects that simulate these different types of light sources and shaders that use this data to render more realistic scenes. Normal vector data is generated for the geometric shapes included in the framework. Bump mapping techniques are added, which use light to create the illusion of fine levels of surface detail on geometric objects. The set of postprocessing effects is extended, enabling the creation of light bloom and glow effects. Shadow mapping is discussed and implemented, which enables objects to cast shadows on other objects.