BindChannels command allows you to specify how vertex data maps to the graphics hardware.
Note: _BindChannels has no effect when vertex programs are used, as in that case bindings are controlled by vertex shaderA program that runs on each vertex of a 3D model when the model is being rendered. More info
See in Glossary inputs. It is advisable to use programmable shadersA small script that contains the mathematical calculations and algorithms for calculating the Color of each pixel rendered, based on the lighting input and the Material configuration. More info
See in Glossary these days instead of fixed function vertex processing.
By default, Unity figures out the bindings for you, but in some cases you want custom ones to be used.
For example you could map the primary UV set to be used in the first texture stage and the secondary UV set to be used in the second texture stage; or tell the hardware that vertex colors should be taken into account.
BindChannels { Bind "source", target }
Specifies that vertex data source maps to hardware target.
Source can be one of:
Target can be one of:
Unity places some restrictions on which sources can be mapped to which targets. Source and target must match for Vertex, Normal, Tangent and Color. Texture coordinates from the meshThe main graphics primitive of Unity. Meshes make up a large part of your 3D worlds. Unity supports triangulated or Quadrangulated polygon meshes. Nurbs, Nurms, Subdiv surfaces must be converted to polygons. More info
See in Glossary (Texcoord and Texcoord1) can be mapped into texture coordinate targets (Texcoord for all texture stages, or TexcoordN for a specific stage).
There are two typical use cases for BindChannels:
// Maps the first UV set to the first texture stage
// and the second UV set to the second texture stage
BindChannels {
Bind "Vertex", vertex
Bind "texcoord", texcoord0
Bind "texcoord1", texcoord1
}
// Maps the first UV set to all texture stages
// and uses vertex colors
BindChannels {
Bind "Vertex", vertex
Bind "texcoord", texcoord
Bind "Color", color
}