Platform SDK: DirectX

Using Lit Vertices

[C++]

Applications that use lit vertices, analogous to the D3DLVERTEX structure, should disable the Direct3D lighting engine by setting the D3DRENDERSTATE_LIGHTING render state to FALSE. By default, when lighting is enabled, the system sets the color for any vertex that doesn't contain a normal vector to 0 (black), even if the input vertex contained a nonzero color value. Because lit-vertices such as D3DLVERTEX don't, by their nature, contain a vertex normal, any color information passed-in to Direct3D will be lost during rendering if the lighting engine is enabled.

Obviously, vertex color is important to any application that performs its own lighting. To prevent the system from imposing the default values, make sure you set D3DRENDERSTATE_LIGHTING to FALSE.

[Visual Basic]

Applications that use lit vertices, analogous to the D3DLVERTEX type, should disable the Direct3D lighting engine by setting the D3DRENDERSTATE_LIGHTING render state to False. By default, when lighting is enabled, the system sets the color for any vertex that doesn't contain a normal vector to 0 (black), even if the input vertex contained a nonzero color value. Because lit-vertices such as D3DLVERTEX don't, by their nature, contain a vertex normal, any color information passed-in to Direct3D will be lost during rendering if the lighting engine is enabled.

Obviously, vertex color is important to any application that performs its own lighting. To prevent the system from imposing the default values, make sure you set D3DRENDERSTATE_LIGHTING to False.