The D3DMATERIAL structure specifies material properties in calls to the IDirect3DMaterial3::GetMaterial and IDirect3DMaterial3::SetMaterial methods.
typedef struct _D3DMATERIAL {
DWORD dwSize;
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;
};
D3DTEXTUREHANDLE hTexture; // Used only by Ramp devices.
DWORD dwRampSize;
} D3DMATERIAL, *LPD3DMATERIAL;
The texture handle specified by the hTexture member is acquired from Direct3D by loading a texture into the device. The texture handle may be used only when it has been loaded into the device. This texture handle is only used by the legacy ramp device, which is not supported by interfaces introduced in DirectX 6.0, such as the new IDirect3DDevice3 interface. For more information, see Ramp Device.
To turn off specular highlights for a material, you must set the dvPower member to 0—simply setting the specular color components to 0 is not enough.
Windows NT/2000: Requires Windows NT 4.0 SP3 or later.
Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
Header: Declared in d3dtypes.h.
IDirect3DMaterial3::GetMaterial, IDirect3DMaterial3::SetMaterial