Version: 6000.3
语言: 中文
设置GPU渲染到的颜色通道
使用 Category 块对命令进行分组

使用 AlphaToMask 模式减少锯齿

Alpha 到覆盖率模式可以减少将多采样抗锯齿 (MSAA) 与使用 Alpha 测试的着色器(如植被着色器)一起使用时发生的过度锯齿。为此,它会根据片段输出中的 alpha 值按比例修改多采样覆盖掩码着色器在 GPU 上运行的程序。更多信息
请参阅术语表
结果。

此命令旨在与 MSAA 一起使用。如果在不使用 MSAA 时启用 alpha 到覆盖率模式,则结果可能不可预测;不同的图形 API 和 GPU 处理此问题的方式不同。

例子

Shader "Examples/CommandExample"
{
    SubShader
    {
         // The rest of the code that defines the SubShader goes here.

        Pass
        {    
              // Enable alpha-to-coverage mode for this Pass
              AlphaToMask On
            
              // The rest of the code that defines the Pass goes here.
        }
    }
}

此示例代码演示了在 SubShader 块中使用此命令的语法。

Shader "Examples/CommandExample"
{
    SubShader
    {
         // Enable alpha-to-coverage mode for this SubShader
         AlphaToMask On

         // The rest of the code that defines the SubShader goes here.        

        Pass
        {    
              // The rest of the code that defines the Pass goes here.
        }
    }
}

其他资源

设置GPU渲染到的颜色通道
使用 Category 块对命令进行分组