查看: 1494|回复: 0
打印 上一主题 下一主题

[Unity 组件参考手册]着色器参考之着色器语法:UsePass

[复制链接]
.    

3797

主题

11

听众

5万

积分

首席设计师

Rank: 8Rank: 8

纳金币
32328
精华
41

活跃会员 优秀版主 荣誉管理 论坛元老

跳转到指定楼层
楼主
发表于 2013-2-25 17:19:35 |只看该作者 |倒序浏览
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/
分享到: QQ好友和群QQ好友和群 腾讯微博腾讯微博 腾讯朋友腾讯朋友 微信微信
转播转播0 分享淘帖0 收藏收藏0 支持支持0 反对反对0
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

手机版|纳金网 ( 闽ICP备2021016425号-2/3

GMT+8, 2024-9-22 15:43 , Processed in 0.304786 second(s), 33 queries .

Powered by Discuz!-创意设计 X2.5

© 2008-2019 Narkii Inc.

回顶部