Shading State (Direct3D 9) - Win32 apps
- ️stevewhims
- ️Wed Jan 06 2021
Skip to main content
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Shading State (Direct3D 9)
- Article
- 01/06/2021
In this article
Direct3D supports both flat and Gouraud shading. The default is Gouraud shading. To control the current shading mode, your C++ application specifies a member of the D3DSHADEMODE enumerated type for the D3DRS_SHADEMODE render state.
The following C++ code example demonstrates the process of setting the shading state to flat shading mode.
// This code example assumes that d3dDevice is a
// valid pointer to a IDirect3DDevice9 interface.
// Set the shading state.
d3dDevice->SetRenderState(D3DRS_SHADEMODE, D3DSHADE_FLAT);