GPU의 뎁스 클립 모드를 clamp로 설정하면 스텐실 그림자 렌더링에 유용할 수 있습니다. 이는 지오메트리가 원평면보다 멀어지면 특수 케이스 처리를 할 필요가 없음을 의미하는데, 이 경우 렌더링 연산이 감소합니다. 하지만 Z 순서가 잘못될 수 있습니다.
이 예제 코드는 Pass 블록에서 이 커맨드를 사용하기 위한 구문을 나타냅니다.
Shader "Examples/CommandExample"
{
SubShader
{
// The rest of the code that defines the SubShader goes here.
Pass
{
// Sets the GPU's depth clip mode to clamp for this Pass
// You would typically do this if you are rendering stencil shadows
ZClip False
// The rest of the code that defines the Pass goes here.
}
}
}