Ambient Lighting

Ambient light is the surrounding light that comes from all directions. Your application sets the color of the ambient lighting by invoking the IDirect3DDevice3::SetLightState method and passing the enumerated value D3DLIGHTSTATE_AMBIENT as the first parameter. The second parameter is a color in RGBA format. The default is zero.

// This code fragment assumes that lpD3DDevice3 is a valid pointer to
// a Direct3DDevice3.
 
// Set the ambient light.
D3DCOLOR d3dclrAmbientLightColor = D3DRGBA(1.0f,1.0f,1.0f,1.0f);
lpD3DDevice3->SetLightState(D3DLIGHTSTATE_AMBIENT, 
                            d3dclrAmbientLightColor);
 

Ambient light levels should not be confused with direct light. For more information, see Direct Light vs. Ambient Light.