Unity 6.3
0 онлайн 118 гостей 3 в системе
Вход
Материалы и шейдеры Шаг 246 из 442

Настройка режима тестирования глубины в шейдере

Глубинное тестирование позволяет GPUs, имеющим функциональность “Early-Z”, отклонять геометрию на раннем этапе конвейера, а также обеспечивает правильную упорядоченность геометрии. Вы можете изменить условия глубинного тестирования для достижения визуальных эффектов, таких как окклюзия объекта.

Примеры

Этот пример кода демонстрирует синтаксис использования этой команды в блоке Pass.

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

        Pass
        {    
              // Sets the depth test operation to Equal for all pixels in this Pass
              // You would typically do this if you want to render the geometry exactly where already rendered geometry is
              ZTest Equal
            
              // The rest of the code that defines the Pass goes here.
        }
    }
}

Этот пример кода демонстрирует синтаксис для использования этой команды в блоке SubShader.

Shader "Examples/CommandExample"
{
    SubShader
    {
        // Sets the depth test operation to Equal for all pixels in this Pass
        // You would typically do this if you want to render the geometry exactly where already rendered geometry is
        ZTest Equal

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

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

Дополнительные ресурсы