Microsoft DirectX 8.1 (Visual Basic)

Shading State

Microsoft® Direct3D® supports both flat and Gouraud shading. The default is Gouraud shading. To control the current shading mode, your Visual Basic application specifies a member of the CONST_D3DSHADEMODE enumerated type for the D3DRS_SHADEMODE render state.

The following Visual Basic code example demonstrates the process of setting the shading state to flat shading mode.

' This example assumes that d3dDevice is a valid
' reference to a Direct3DDevice8 object.
 
' Set the shading state.
Call d3dDevice.SetRenderState(D3DRS_SHADEMODE, D3DSHADE_FLAT)