Version: Unity 6.0 (6000.0)
언어 : 한국어
셰이더에서 뎁스 테스트 모드 설정
셰이더에서 스텐실 버퍼 확인 또는 쓰기

셰이더에서 뎁스 버퍼에 쓰기 비활성화

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.
        }
    }
}

추가 리소스

셰이더에서 뎁스 테스트 모드 설정
셰이더에서 스텐실 버퍼 확인 또는 쓰기