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

[Unity 组件参考手册]着色器参考之着色器语法:其他命令

[复制链接]
.    

3797

主题

11

听众

5万

积分

首席设计师

Rank: 8Rank: 8

纳金币
32328
精华
41

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

跳转到指定楼层
楼主
发表于 2013-2-25 17:22:21 |只看该作者 |倒序浏览
Category 分类Category is a logical grouping of any commands below it. This is mostly used to "inherit" rendering state. For example, your shader might have multiple subshaders, and each of them requires fog to be off, blending set to additive, etc. You can use Category for that:分类是如下任意命令的逻辑组。大多数情况下是被用于继承渲染状态。例如,你的着色器可以有多个子着色器,他们都需要关闭雾效果,附加的混合,等等。你能在这些情况使用种类:Shader "example" {
Category {
    Fog { Mode Off }
    Blend One One
    SubShader {
        // ...
    }
    SubShader {
        // ...
    }
    // ...
}
}Category block only affects shader parsing, it's exactly the same as "pasting" any state set inside Category into all blocks below it. It does not affect shader&nbsp***cution speed at all.分类块只影响着色器解析,作用和粘贴状态集到分类所包含的子着色器块中的效果一样。完全不影响着色器的运行速度。
【来源:互联网】
更多精彩教程,尽在web3D纳金网http://www.narkii.com/college/
分享到: QQ好友和群QQ好友和群 腾讯微博腾讯微博 腾讯朋友腾讯朋友 微信微信
转播转播0 分享淘帖0 收藏收藏0 支持支持0 反对反对0
回复

使用道具 举报

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

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

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

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

© 2008-2019 Narkii Inc.

回顶部