D3DMSHADEMODE (Windows CE 5.0)

Send Feedback

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).

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

OS Versions: Windows CE 5.0 and later.
Header: D3dmtypes.h.

See Also

Direct3D Mobile Enumerations | Interpolation | D3DMRENDERSTATETYPE | D3DMCAPS

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.