Version: 6000.3
语言: 中文
在着色器中设置深度偏差
在着色器中设置深度测试模式

在着色器中设置深度剪辑模式

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

其他资源

在着色器中设置深度偏差
在着色器中设置深度测试模式