Microsoft DirectX 8.1 (Visual Basic)

Ambient Lighting State

Ambient light is surrounding light that radiates from all directions.

For specific information on how Microsoft® Direct3D® uses ambient light, see Direct Light vs. Ambient Light, and Mathematics of Lighting.

A Microsoft Visual Basic® application sets the color of ambient lighting by invoking the Direct3DDevice8.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 contains a valid
' reference to a Direct3DDevice8 object.

' Set the ambient light.
Call D3DDevice.SetRenderState(D3DRS_AMBIENT, &H202020)