Platform SDK: DirectX

Introduction to Lighting and Materials

When lighting is enabled, as Direct3D rasterizes a scene in the final stage of rendering, it determines the color of each rendered pixel based on a combination of the current material color (and the texels in an associated texture map), the diffuse and specular colors at the vertex, if specified, as well as the color and intensity of light produced by light sources in the scene or the scene's ambient light level. When you use Direct3D lighting and materials, you are allowing Direct3D to handle the details of illumination for you, but advanced users can perform lighting on their own if necessary.

How you work with lighting and materials makes a huge difference in the appearance of the rendered scene. Materials define how light reflects off of a surface. Direct light and ambient light levels define the light that is being reflected. You must use materials to render a scene if you are letting Direct3D handle lighting. Lights are not actually required to render a scene, but you'll be hard pressed to see much in a scene rendered without light. At best, rendering an unlit scene will result in a silhouette of the objects in the scene—not enough detail for most purposes.