D3DMSHADEMODE
A version of this page is also available for
4/8/2010
This enumeration provides values that describe the type of shading model to use when rendering a primitive. These values are used in the D3DMRS_SHADEMODE render state (see D3DMRENDERSTATETYPE).
Syntax
typedef enum _D3DMSHADEMODE {
D3DMSHADE_FLAT = 1,
D3DMSHADE_GOURAUD = 2,
D3DMSHADE_FORCE_ULONG = 0x7fffffff,
} D3DMSHADEMODE;
Elements
- D3DMSHADE_FLAT
Indicates flat shading. The diffuse and specular colors from the first vertex of the primitive are used for all pixels in the primitive. All fog values are always interpolated.
- D3DMSHADE_GOURAUD
Indicates Gouraud shading. The driver will interpolate values based on the capability bits it sets in ShadeCaps member of the D3DMCAPS structure. If the capability bit for a particular color component is not set, shading reverts back to DeDMSHADE_FLAT for that component only.
- D3DMSHADE_FORCE_ULONG
Forces the compiler to interpret the enumeration as a ULONG value. This value is not used directly in Direct3D Mobile programming.
Remarks
The first vertex of a triangle for flat shading mode is defined in the following manner.
- For a triangle list, the first vertex of the triangle i is i * 3.
- For a triangle strip, the first vertex of the triangle i is vertex i.
- For a triangle fan, the first vertex of the triangle i is vertex i + 1.
Requirements
Header | d3dmtypes.h |
Windows Embedded CE | Windows CE 5.0 and later |
Windows Mobile | Windows Mobile Version 5.0 and later |
See Also
Reference
Direct3D Mobile Enumerations
D3DMRENDERSTATETYPE
D3DMCAPS