Version: Unity 6.0 (6000.0)
언어 : 한국어
셰이더에서 스텐실 버퍼 확인 또는 쓰기
GPU가 렌더링할 컬러 채널 설정

셰이더에서 블렌딩 모드 설정

Blend 커맨드는 GPU가 프래그먼트 셰이더의 출력을 렌더 타겟과 조합하는 방식을 결정합니다.

이 커맨드의 기능은 BlendOp 커맨드를 사용하여 설정할 수 있는 블렌딩 작업에 따라 다릅니다. 블렌딩 자체는 모든 그래픽스 API와 하드웨어에서 지원되지만 일부 블렌딩 작업은 제한적으로 지원됩니다.

블렌딩을 활성화하면 GPU의 일부 최적화(주로 숨겨진 표면 제거/Early-Z)가 비활성화되어 GPU 프레임 시간이 늘어날 수 있습니다.

일반적인 블렌드 유형

다음은 대다수의 일반적인 블렌드 유형을 위한 구문입니다.

Blend SrcAlpha OneMinusSrcAlpha // Traditional transparency
Blend One OneMinusSrcAlpha // Premultiplied transparency
Blend One One // Additive
Blend OneMinusDstColor One // Soft additive
Blend DstColor Zero // Multiplicative
Blend DstColor SrcColor // 2x multiplicative

예제

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

        Pass
        {    
              // Enable regular alpha blending for this Pass
      Blend SrcAlpha OneMinusSrcAlpha
            
              // The rest of the code that defines the Pass goes here.
        }
    }
}

이 예제 코드는 SubShader 블록에서 이 커맨드를 사용하기 위한 구문을 나타냅니다.

Shader "Examples/CommandExample"
{
    SubShader
    {
         // Enable regular alpha blending for this SubShader
         Blend SrcAlpha OneMinusSrcAlpha

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

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

추가 리소스

셰이더에서 스텐실 버퍼 확인 또는 쓰기
GPU가 렌더링할 컬러 채널 설정
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961