description | ms.assetid | title | ms.topic | ms.date |
---|---|---|---|---|
Ambient light is surrounding light that radiates from all directions. For information about how Direct3D uses ambient light, see Mathematics of Lighting (Direct3D 9). |
c5aa493e-09b8-433c-a21c-e39af795b3c9 |
Ambient Lighting State (Direct3D 9) |
article |
05/31/2018 |
Ambient light is surrounding light that radiates from all directions. For information about how Direct3D uses ambient light, see Mathematics of Lighting (Direct3D 9).
A C++ application sets the color of ambient lighting by invoking the IDirect3DDevice9::SetRenderState method and passing the enumerated value D3DRS_AMBIENT as the first parameter. The second parameter is a color value. The default value is zero.
// This code example assumes that d3dDevice is a
// valid pointer to an IDirect3DDevice9 interface.
// Set the ambient light.
d3dDevice->SetRenderState(D3DRS_AMBIENT, 0x00202020);