뎁스 테스트는 ‘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.
}
}
}