Share via


Lighting and Materials (Windows Embedded CE 6.0)

1/6/2010

Microsoft® Direct3D® Mobile treats materials in a similar manner to render states. There is a single active material and all primitives drawn with lighting enabled use the current active material. To set the active material, calls the IDirect3DMobileDevice::SetMaterial method and pass a pointer to a D3DMMATERIAL structure describing the new material. The default material has all members and submembers of the D3DMMATERIAL structure set to 0.0 except for Diffuse.r, Diffuse.g, and Diffuse.b, which are all set to 1.0.

Direct3D Mobile includes provisions to select the source of the material input used in the lighting equations. The material input may be taken from the current material or other lighting parameters taken from the D3DMMATERIALCOLORSOURCE enumeration. The application selects the material input by passing the appropriate enumeration value to the D3DMRS_DIFFUSEMATERIALSOURCE, D3DMRS_AMBIENTMATERIALSOURCE, and D3DMRS_SPECULARMATERIALSOURCE render states (see D3DMRENDERSTATETYPE). Passing illegal enumeration values results in a blend error and the material source is not changed.

See Also

Concepts

Lighting