?/TD>
Microsoft DirectX 9.0

Color Vertices


Usually material colors are used for lighting. However, you can specify that material colors—emissive, ambient, diffuse, and specular—are to be overridden by diffuse or specular vertex colors. This is done by calling IDirect3DDevice9::SetRenderState and setting the device state variables listed in the following table.

Device state variableMeaningTypeDefault
D3DRS_AMBIENTMATERIALSOURCEDefines where to get ambient material color.D3DMATERIALCOLORSOURCED3DMCS_MATERIAL
D3DRS_DIFFUSEMATERIALSOURCEDefines where to get diffuse material color.D3DMATERIALCOLORSOURCED3DMCS_COLOR1
D3DRS_SPECULARMATERIALSOURCEDefines where to get specular material color.D3DMATERIALCOLORSOURCED3DMCS_COLOR2
D3DRS_EMISSIVEMATERIALSOURCEDefines where to get emissive material color.D3DMATERIALCOLORSOURCED3DMCS_MATERIAL
D3DRS_COLORVERTEXDisables or enables use of vertex colors.BOOLTRUE

The alpha/transparency value always comes only from the diffuse color's alpha channel.

The fog value always comes only from the specular color's alpha channel.

D3DMATERIALCOLORSOURCE can have the following values.



© 2002 Microsoft Corporation. All rights reserved.