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