This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for

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::SetRenderStatemethod 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.

Copy Code
// 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


Render States