Microsoft DirectX 8.0 (Visual Basic)

Pixel Shader Lighting

The following diagram illustrates the mechanics behind pixel shader lighting.

For example, in the case of a 3-D bump environment map, you sample the normal map and iterate a 3×3 matrix across the polygon using texture coordinates as rows. Then, you can transform and index into a diffuse radiance cube map, or reflect and index into a specular environment cube map. You apply to the base from a previous pass.