Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
CloseBindChannels コマンドにより,頂点データがグラフィック ハードウェアにどのようにマッピングされるかを指定できます。
BindChannels は,プログラム可能な頂点シェーダの使用タイミングには影響しません。その場合,バインディングは頂点 シェーダ入力で制御されます。
デフォルトでは,Unity がバインディングを算定しますが,カスタムのバインディングを使用したい場合もあるでしょう。
例えば,1 つ目のテクスチャ ステージで使用されるよう設定された 1 つ目の UV と 2 つ目のテクスチャ ステージで使用されるように設定された 2 つ目の UV をマッピングするか,頂点色を考慮するようハードウェアに指示できます。
BindChannels { Bind "source", target }
ハードウェアの ターゲット に頂点データの ソース マップを指定します。
ソース は,次のうちのいずれかになります:
ターゲット は,次のうちのいずれかになります。
Unity には,ターゲットと,それにマッピングされるソースに関して厳しい制約があります。 ソースと目標は, Vertex , Normal , Tangent および Color に対して一致する必要があります。 メッシュからのテクスチャ ( Texcoord および Texcoord1 ) はテクスチャ座標のターゲット (すべてのテクスチャ ステージに対しては Texcoord ,指定したステージに対して, TexcoordN ) にマッピングできます。
BindChannels に対して,通常,次の 2 つの使用事例があります。
// 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
}