Share via


D3DSHADEMODE

This enumeration defines constants that describe the supported shading modes.

typedef enum _D3DSHADEMODE {
  D3DSHADE_FLAT = 1,
  D3DSHADE_GOURAUD = 2,
  D3DSHADE_PHONG = 3,
  D3DSHADE_FORCE_DWORD = 0x7fffffff
} D3DSHADEMODE;

Constants

  • D3DSHADE_FLAT
    Flat shading mode. The color and specular component of the first vertex in the triangle are used to determine the color and specular component of the face. These colors remain constant across the triangle; that is, they are not interpolated. The specular alpha is interpolated. See Remarks.
  • D3DSHADE_GOURAUD
    Gouraud shading mode. The color and specular components of the face are determined by a linear interpolation between all three of the triangle's vertices.
  • D3DSHADE_PHONG
    Not supported.
  • D3DSHADE_FORCE_DWORD
    Forces this enumeration to compile to 32 bits in size. This value is not used.

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.

The members of this enumerated type define the vales for the D3DRS_SHADEMODE render state.

Requirements

OS Versions: Windows CE .NET 4.0 and later.
Header: D3d8types.h.

See Also

D3DRENDERSTATETYPE

 Last updated on Thursday, April 08, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.