Unity3D Shader官方教程翻译(十七)----Shader语法 FallBack
2014-12-03 11:50
369 查看
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原创,转载请说明。
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原创,转载请说明。
相关文章推荐
- Unity3D Shader官方教程翻译(十七)----Shader语法 FallBack
- Unity3D Shader官方教程翻译(十七)----Shader语法 FallBack
- Unity3D Shader官方教程翻译(十七)----Shader语法 FallBack
- Unity3D Shader官方教程翻译(十七)----Shader语法 FallBack
- Unity3D Shader官方教程翻译(十一)----Shader语法:Pass的Blending(混合)
- Unity3D Shader官方教程翻译(三)----Shader语法:属性
- Unity3D Shader官方教程翻译(七)----Shader语法:Pass的Culling & Depth Testing
- Unity3D Shader官方教程翻译(五)----Shader语法:Pass
- Unity3D Shader官方教程翻译(四)----Shader语法:SubShader
- Unity3D Shader官方教程翻译(四)----Shader语法:SubShader
- Unity3D Shader官方教程翻译(十九)----Shader语法,编写表面着色器
- Unity3D Shader官方教程翻译(十)----Shader语法:Pass的Alpha测试
- Unity3D Shader官方教程翻译(七)----Shader语法:Pass的Culling & Depth Testing
- Unity3D Shader官方教程翻译(十五)----Shader语法 UsePass
- Unity3D Shader官方教程翻译(十一)----Shader语法:Pass的Blending(混合)
- Unity3D Shader官方教程翻译(五)----Shader语法:Pass
- Unity3D Shader官方教程翻译(九)----Shader语法:Pass的雾化处理
- Unity3D Shader官方教程翻译(八)----Shader语法:Pass的纹理处理
- Unity3D Shader官方教程翻译(十三)----Shader语法:Pass的Name
- Unity3D Shader官方教程翻译(八)----Shader语法:Pass的纹理处理 .