Mesh shading styles

Top  Previous  Next

Constants used with the C3DMesh::SetShading method.

 

Constant

Description

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

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

 

Additional Info:

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.