您的位置:首页 > 移动开发 > Unity3D

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原创,转载请说明。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: