![]() |
![]() |
![]() |
Setting the Shading Mode |
Language: |
Microsoft® Direct3D® enables one shading mode to be selected at a time. Gouraud shading is selected by default. In Microsoft DirectX® 9.0 for Managed Code, the shading mode can be changed by setting the ShadeMode property of the RenderStateManager object that is returned by the Device.RenderState property.
The following C# code example illustrates how the current shading mode of a Direct3D application can be set to either flat or Gouraud.
[C#]
// This code example assumes that device is already initialized . // Set to flat shading. device.RenderState.ShadeMode = ShadeMode.Flat; // Set to Gouraud shading. This is the default for Direct3D. device.RenderState.ShadeMode = ShadeMode.Gouraud;
Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center