ZWrite は、レンダリング時に深度バッファのコンテンツを更新するかどうかを設定します。通常、ZWrite は不透明なオブジェクトに有効で、半透明なオブジェクトには無効です。
ZWrite を無効にすると、深度の順序付けが正しく行われないことがあります。このような場合は、CPU でジオメトリをソートする必要があります。
このコードサンプルでは、Pass ブロックでこのコマンドを使用するための構文を示しています。
Shader "Examples/CommandExample"
{
SubShader
{
// The rest of the code that defines the SubShader goes here.
Pass
{
// Disables writing to the depth buffer for this Pass
ZWrite Off
// The rest of the code that defines the Pass goes here.
}
}
}
このサンプルコードでは、SubShader ブロックでこのコマンドを使用するための構文を示しています。
Shader "Examples/CommandExample"
{
SubShader
{
// Disables writing to the depth buffer for this SubShader
ZWrite Off
// The rest of the code that defines the SubShader goes here.
Pass
{
// The rest of the code that defines the Pass goes here.
}
}
}