C3DMesh::SetShading

Top  Previous  Next

Syntax:

 

SetShading(int  mode)

 

Purpose:

Sets the shading mode for the mesh.

 

Parameters:

mode - The new shading mode.

 

Returned value(s):

None.

 

Application:

sphere.SetShading(SHADE_GOURAUD)

 

Class Hierarchy

C3DObject

-------C3DMesh

 

Additional Info:

The default shading mode is SHADE_FLAT.

 

The shading mode used to render a polygon has a profound effect on its appearance. Shading modes determine the intensity of color and lighting at any point on a polygon face.

 

In the flat shading mode, the Direct3D rendering pipeline renders a polygon, using the color of the polygon material at its first vertex as the color for the entire polygon. 3-D objects that are rendered with flat shading have visibly sharp edges between polygons if they are not coplanar.

 

When Direct3D renders a polygon using Gouraud shading, it computes a color for each vertex by using the vertex normal and lighting parameters. Then, it interpolates the color across the face of the polygons The interpolation is done linearly.

 

See Also:

Mesh Shading Styles