ShaderLab syntax: Fallback
After all Subshaders a Fallback can be defined. It basically says "if none of subshaders can run on this hardware, try using the ones from another shader".
在所有Subshaders之后可以定义1个FallBack。它的意义是:如果没有1个subshaders可以运行在这个硬件上,那么就试图使用其他shader中的一个。
Syntax
Fallback "name"
- Fallback to shader with a given name.
- 返回给定名称的着色器
- Fallback Off
- Explicitly state that there is no fallback and no warning should be printed, even if no subshaders can run on this hardware.
- 关闭Fallback,就算没有subshader在显卡上运行,也不会有任何返回和警告。
Details 详情
A fallback statement has the same effect as if all subshaders from the other shader would be inserted into its place.
Fallback还有1个作用是将另外1个Shader中的所有subshader插入到指定的位置中。
Example 例子
Shader "example" { // properties and subshaders here... Fallback "otherexample" }
由www.J2meGame.com原创,转载请说明。