Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Ambient light is surrounding light that radiates from all directions.
For specific information on how Microsoft® Direct3D® Mobile uses ambient light, see Direct Light vs. Ambient Light, and Lighting Equations.
An application sets the color of ambient lighting by invoking the IDirect3DMobileDevice::SetRenderState method and passing the enumerated value D3DMRS_AMBIENT as the first parameter, see D3DMRENDERSTATETYPE. The second parameter is a color value. The default value is zero.
// This code example assumes that d3dmDevice is a
// valid pointer to an IDirect3DMobileDevice interface.
// Set the ambient light.
d3dmDevice->SetRenderState(D3DMRS_AMBIENT, 0x00202020);
See Also
Send Feedback on this topic to the authors