纳金网

标题: [Unity 组件参考手册]着色器参考之着色器语法:其他命令 [打印本页]

作者: .    时间: 2013-2-25 17:22
标题: [Unity 组件参考手册]着色器参考之着色器语法:其他命令
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/




欢迎光临 纳金网 (http://course.narkii.com/club/) Powered by Discuz! X2.5