Click to Rate and Give Feedback
MSDN
MSDN Library
XNA Game Studio
XNA Game Studio 3.1
Programming Guide
Graphics
3D Graphics
"How To" Articles
 How To: Check for Shader Model 2.0 ...

  Switch on low bandwidth view
XNA Game Studio 3.1
How To: Check for Shader Model 2.0 Support
Demonstrates how to find out whether a graphics card supports Shader Model 2.0.

Checking for Shader Model 2.0 Support

To check for Shader Model 2.0 support

  1. Use the GraphicsDevice.GraphicsDeviceCapabilities Property to find the capabilities of the game's graphics device.

  2. Compare GraphicsDeviceCapabilities.MaxPixelShaderProfile to the member of the ShaderProfile enumeration that represents pixel shader version ps_2_0.

    In this example, if the graphics device does not support this shader model, the output window displays a message when you run the game in debug mode.

C#
// Check the graphics device used by the game 
// for the necessary shader support.
GraphicsDeviceCapabilities caps = 
    GraphicsDevice.GraphicsDeviceCapabilities;
if (caps.MaxPixelShaderProfile < ShaderProfile.PS_2_0)
{
    // This device does not support Shader Model 2.0.
    System.Diagnostics.Debug.WriteLine(
        "This adapter does not support Shader Model 2.0.");
}
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker