Pass はタグを使用して、いつどのようにしてレンダリングエンジンでレンダリングするか指定します。
Tags { "TagName1" = "Value1" "TagName2" = "Value2" }
TagName1 が値 Value1、TagName2 が値 Value2 であることを指定します。タグの数に制限はありません。
タグは基本的に Key-Value ペアです。Pass の中でタグは、当該パスがライティングパイプライン (環境光、頂点ライティング、ピクセルライティング) の中でどの役割であるかを制御したり、他のオプションのために使用されます。 Unity により認識される以下のタグは、SubShader の中でなく 必ず Pass セクションの中に置くように注意してください。
LightMode タグはライティングパイプラインでのパスの役割を定義します。詳細は Unity のレンダリングパイプライン を参照してください。これらのタグは手動で使用されることは稀で、ライティングと相互作用のあるほとんどのシェーダーは サーフェスシェーダー で記述され、すべてはその中で処理されます。
LightMode で利用可能なタグは以下の通りです。
パスはフラグを使って、レンダリングパイプライン がどのようにデータをパスに渡すかを変更することができます。これには、スペースで区切られたフラグ名を値としてもつ PassFlags タグが使用されます。現在、以下のフラグがサポートされています。
特定の外部条件が満たされた場合のみレンダリングすることを、パスで指定することができます。これは RequireOptions タグで行われ、値はスペースで区切られた文字列によるオプションです。現在、以下のオプションが Unity でサポートされています。
SubShader にもタグを指定することが可能です。詳細は ShaderLab: SubShader 内の Tags を参照してください。
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.