DirectX SDK

D3DMATERIAL7

The D3DMATERIAL7 structure specifies material properties in calls to the IDirect3DDevice7::GetMaterial and IDirect3DDevice7::SetMaterial methods.

typedef struct _D3DMATERIAL7 {
    union {
        D3DCOLORVALUE   diffuse; 
        D3DCOLORVALUE   dcvDiffuse;
    };
    union {
        D3DCOLORVALUE   ambient; 
        D3DCOLORVALUE   dcvAmbient;
    };
    union {
        D3DCOLORVALUE   specular; 
        D3DCOLORVALUE   dcvSpecular;
    };
    union {
        D3DCOLORVALUE   emissive; 
        D3DCOLORVALUE   dcvEmissive;
    };
    union {
        D3DVALUE        power; 
        D3DVALUE        dvPower;
    };
} D3DMATERIAL7, *LPD3DMATERIAL7; 

Members

dcvDiffuse, dcvAmbient, dcvSpecular, and dcvEmissive
Values specifying the diffuse color, ambient color, specular color, and emissive color of the material, respectively. These values are D3DCOLORVALUE structures.
dvPower
Value of the D3DVALUE type specifying the sharpness of specular highlights. To turn off specular highlights for a material, set this member to 0; setting the specular color components to 0 is not enough.

Remarks

This structure, introduced with DirectX 7.0, supersedes the D3DMATERIAL structure used with previous versions of DirectX.

This structure, unlike the legacy D3DMATERIAL structure, does not support texture handles (for textured viewport background) or ramp sizes for the legacy Ramp software device.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Windows CE: Unsupported.
  Version: Requires DirectX 7.0.
  Header: Declared in d3dtypes.h.

See Also

IDirect3DDevice7::GetMaterial, IDirect3DDevice7::SetMaterial, Lighting and Materials