Unity3D Shader官方教程翻译(十七)----Shader语法 FallBack

来源:互联网 发布:tensorflow 训练时间 编辑:程序博客网 时间:2024/05/18 02:51
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原创,转载请说明。
原创粉丝点击