深度测试允许具有“Early-Z”功能的 GPU 在管道的早期拒绝几何体,并确保几何体的正确排序。您可以更改深度测试的条件以实现诸如对象遮挡之类的视觉效果。
此示例代码演示了在 Pass 块中使用此命令的语法。
Shader "Examples/CommandExample"
{
SubShader
{
// The rest of the code that defines the SubShader goes here.
Pass
{
// Sets the depth test operation to Equal for all pixels in this Pass
// You would typically do this if you want to render the geometry exactly where already rendered geometry is
ZTest Equal
// The rest of the code that defines the Pass goes here.
}
}
}
此示例代码演示了在 SubShader 块中使用此命令的语法。
Shader "Examples/CommandExample"
{
SubShader
{
// Sets the depth test operation to Equal for all pixels in this Pass
// You would typically do this if you want to render the geometry exactly where already rendered geometry is
ZTest Equal
// The rest of the code that defines the SubShader goes here.
Pass
{
// The rest of the code that defines the Pass goes here.
}
}
}