- 最后登录
- 2018-12-19
- 注册时间
- 2012-8-20
- 阅读权限
- 90
- 积分
- 54706
- 纳金币
- 32328
- 精华
- 41
|
The UsePass command uses named passes from another shader.UsePass 命令 使用 来自另一个着色器的命名通道。
Syntax 语法UsePass "Shader/Name"
Inserts all passes with a given name from a given shader. Shader/Name contains the name of the shader and the name of the pass, separated by a slash character.
插入所有来自给定着色器中的给定名字的通道。Shader/Name包含了通过斜杠字符分割的着色器的名字和通道的名字 Details 细节Some of the shaders could reuse existing passes from other shaders, reducing code duplication. For example, in most pixel lit shaders the ambient or vertex lighting passes are the same as in the corresponding VertexLit shaders. The UsePass command does just that - it includes a given pass from another shader. As an example the following command uses the pass with the name "BASE" from the builtin Specular shader:某些着色器重用其他着色器中已存在的通道,减少重复的代码。例如,在许多像素光照着色器中,阴影色或顶点光照通道在在相应的顶点光照着色器中是相同的。UsePass命令只是包含了另一个着色器的给定通道。例如当如下的命令可以使用内置的高光着色器中的名叫"Base"的通道:UsePass "Specular/BASE"In order for UsePass to work, a name must be given to the pass one wishes to use. The Name command inside the pass gives it a name:为了让UsePass能正常工作,必须给希望使用的通道命名。通道中的Name命令将提供这个名字:Name "MyPassName"Note that internally all pass names are uppercased, so UsePass must refer to the name in uppercase.注意,所有通道名字都是大写开头,因此UsePass必须使用大写开头的名字来书写索引 。
【来源:互联网】
更多精彩教程,尽在web3D纳金网http://www.narkii.com/college/ |
|