ShaderLab: Legacy BindChannels
来源:互联网 发布:java汽车租赁 编辑:程序博客网 时间:2024/06/01 10:25
ShaderLab: Legacy BindChannels
BindChannels 命令允许你定义顶点数据如何映射到显卡。
Note*: 当使用 vertex programs 时, _BindChannels 不会生效, 在这种情况下 bindings 被 vertex shader 输入控制。如今使用可编程 shader 代替固定管线过程是明智的。*
默认情况,Unity 会处理 bingdings,但是在某些情况,你会希望自定义一个。
例如你可以映射主UV被设置用在第一个 texture 阶段,第二级UV被用在第二个 texture 阶段;或告诉硬件顶点颜色应该被考虑。
Syntax
BindChannels { Bind "source", target }
制定顶点数据 source 映射给硬件 target.
Source 可以是其中一个:
- Vertex: vertex position
- Normal: vertex normal
- Tangent: vertex tangent
- Texcoord: primary UV coordinate
- Texcoord1: secondary UV coordinate
- Color: per-vertex color
Target 可以是其中一个:
- Vertex: vertex position
- Normal: vertex normal
- Tangent: vertex tangent
- Texcoord0, Texcoord1, …: texture coordinates for corresponding texture stage
- Texcoord: texture coordinates for all texture stages
- Color: vertex color
Details
Unity对哪些资源可以映射到哪些目标进行了一些限制。Source 和 target 必须匹配 Vertex, Normal, Tangent 和 Color。来自 mesh 的 Texture 坐标 (Texcoord and Texcoord1) 可以被映射进纹理坐标 target (Texcoord for all texture stages, or TexcoordN for a specific stage).
这里有 BindChannels 的两个典型用例:
- Shaders that take vertex colors into account.
- Shaders that use two UV sets.
Examples
// Maps the first UV set to the first texture stage// and the second UV set to the second texture stageBindChannels { Bind "Vertex", vertex Bind "texcoord", texcoord0 Bind "texcoord1", texcoord1}
// Maps the first UV set to all texture stages// and uses vertex colorsBindChannels { Bind "Vertex", vertex Bind "texcoord", texcoord Bind "Color", color}
阅读全文
0 0
- ShaderLab: Legacy BindChannels
- ShaderLab: Legacy Lighting
- ShaderLab: Legacy Texture Combiners
- ShaderLab: Legacy Alpha Testing
- ShaderLab: Legacy Fog
- BindChannels纹理绑定详解[Unity ShaderLab]
- BindChannels纹理绑定详解[Unity ShaderLab]
- Shader - BindChannels
- Unity-shaderLab
- shaderlab 关键字
- ShaderLab 笔计一
- ShaderLab: Stencil
- ShaderLab-UV
- shaderlab 基础
- shaderLab语法
- Shaderlab blend
- ShaderLab: Pass
- ShaderLab Syntax
- spring 1.5.6 整合redis 出现ClassNotFoundException: RepositoryConfigurationSource
- TCP连接中的TIME_WAIT状态
- Kali 安装详细步骤
- 光环国际PMP:现代企业经营法则
- python_字符格式化
- ShaderLab: Legacy BindChannels
- Django报错:django.template.exceptions.TemplateDoesNotExist: index.html
- maven用法注意事项
- Swift
- JDK源码解析集合篇--HashMap无敌全解析
- Maven 初识
- 分布式缓存技术redis学习系列(三)——redis高级应用(主从、事务与锁、持久化)
- Tomcat的生命周期管理简要分析
- 最少硬币问题-java实现