SystemInfo.graphicsShaderLevel 显卡着色器级别

static var graphicsShaderLevel : int

Description描述

Graphics device shader capability level (Read Only).

图形设备着色器性能级别。(只读)

This is approximate "shader capability" level of the graphics device, expressed in DirectX shader model terms. Possible values are:

这是图形设备的近似着色器性能级别,代表DirectX着色器模式。可能的值有:

 

30	    Shader Model 3.0
20	    Shader Model 2.x
10	    Shader Model 1.x
7	    Fixed function, roughly DirectX 7 features (cubemaps, dot3)
6	    Fixed function, roughly DirectX 6 features (basic multitexture)
5	    Fixed function, roughly DirectX 5 features

参见: SystemInfo.graphicsPixelFillrate.

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	public void Awake() {
		if (SystemInfo.graphicsShaderLevel >= 20)
			print("Woohoo, decent shaders supported!");

	}
}
// Check for shader model 2.0 or better support
//检测着色器模式或很好支持

if (SystemInfo.graphicsShaderLevel >= 20)
	print ("Woohoo, decent shaders supported!");
Page last updated: 2011-3-18