Version: Unity 6.0 (6000.0)
언어 : 한국어
셰이더에서 뎁스 클립 모드 설정
셰이더에서 뎁스 버퍼에 쓰기 비활성화

셰이더에서 뎁스 테스트 모드 설정

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

추가 리소스

셰이더에서 뎁스 클립 모드 설정
셰이더에서 뎁스 버퍼에 쓰기 비활성화