Blend 커맨드가 사용하는 블렌딩 작업을 설정합니다. 이 커맨드가 작동하려면 같은 패스 블록(이 커맨드가 패스 블록 내에 있는 경우) 또는 서브셰이더 블록(이 커맨드가 서브셰이더 블록 내에 있는 경우)에도 Blend 커맨드가 있어야 합니다.
모든 블렌딩 작업이 모든 기기에서 지원되는 것은 아니며, 그래픽스 API 및 하드웨어에 따라 지원됩니다. 지원되지 않는 블렌딩 작업은 그래픽스 API마다 다르게 처리됩니다. GL은 지원되지 않는 작업을 건너뛰고 Vulkan과 Metal은 Add 작업으로 폴백합니다.
| 기능 이름 | URP(유니버설 렌더 파이프라인) | HDRP(고해상도 렌더 파이프라인) | 커스텀 SRP | 빌트인 렌더 파이프라인 |
|---|---|---|---|---|
| BlendOp | 지원 | 지원 | 지원 | 지원 |
이 커맨드는 렌더 상태를 변경합니다. Pass 블록에서 사용하여 해당 패스의 렌더 상태를 설정하거나, SubShader 블록에서 사용하여 해당 서브셰이더에 있는 모든 패스의 렌더 상태를 설정할 수 있습니다.
| 서명 | 예제 구문 | 기능 |
|---|---|---|
BlendOp <operation> |
BlendOp Sub |
Blend 커맨드가 사용하는 블렌딩 작업을 설정합니다. |
| 파라미터 | 값 | 기능 |
|---|---|---|
| operation | Add |
소스와 대상을 더합니다. |
Sub |
소스에서 대상을 뺍니다. | |
RevSub |
대상에서 소스를 뺍니다. | |
Min |
소스와 대상 중 더 작은 것을 사용합니다. (1) | |
Max |
소스와 대상 중 더 큰 것을 사용합니다. (1) | |
LogicalClear |
논리 연산: Clear (0) (1) |
|
LogicalSet |
논리 연산: Set (1) (1) |
|
LogicalCopy |
논리 연산: Copy (s) (1) |
|
LogicalCopyInverted |
논리 연산: Copy inverted (!s) 2 |
|
LogicalNoop |
논리 연산: Noop (d) (1) |
|
LogicalInvert |
논리 연산: Invert (!d) (1) |
|
LogicalAnd |
논리 연산: And (s & d) (1) |
|
LogicalNand |
논리 연산: Nand !(s & d) (1) |
|
LogicalOr |
논리 연산: Or (s | d) (1) |
|
LogicalNor |
논리 연산: Nor !(s | d) (1) |
|
LogicalXor |
논리 연산: Xor (s ^ d) (1) |
|
LogicalEquiv |
논리 연산: Equivalence !(s ^ d) (1) |
|
LogicalAndReverse |
논리 연산: Reverse And (s & !d) (1) |
|
LogicalAndInverted |
논리 연산: Inverted And (!s & d) (1) |
|
LogicalOrReverse |
논리 연산: Reverse Or (s | !d) (1) |
|
LogicalOrInverted |
논리 연산: Inverted Or (!s | d) (1) |
|
Multiply |
고급 OpenGL 블렌딩 작업: Multiply (2) |
|
Screen |
고급 OpenGL 블렌딩 작업: Screen (2) |
|
Overlay |
고급 OpenGL 블렌딩 작업: Overlay (2) |
|
Darken |
고급 OpenGL 블렌딩 작업: Darken (2) |
|
Lighten |
고급 OpenGL 블렌딩 작업: Lighten (2) |
|
ColorDodge |
고급 OpenGL 블렌딩 작업: ColorDodge (2) |
|
ColorBurn |
고급 OpenGL 블렌딩 작업: ColorBurn (2) |
|
HardLight |
고급 OpenGL 블렌딩 작업: HardLight (2) |
|
SoftLight |
고급 OpenGL 블렌딩 작업: SoftLight (2) |
|
Difference |
고급 OpenGL 블렌딩 작업: Difference (2) |
|
Exclusion |
고급 OpenGL 블렌딩 작업: Exclusion (2) |
|
HSLHue |
고급 OpenGL 블렌딩 작업: HSLHue (2) |
|
HSLSaturation |
고급 OpenGL 블렌딩 작업: HSLSaturation (2) |
|
HSLColor |
고급 OpenGL 블렌딩 작업: HSLColor (2) |
|
HSLLuminosity |
고급 OpenGL 블렌딩 작업: HSLLuminosity (2) |
참고:
GLES3.1 AEP+, GL_KHR_blend_equation_advanced, GL_NV_blend_equation_advanced가 필요합니다. 표준 RGBA 블렌딩만 사용할 수 있으며 별도의 RGB 및 알파 블렌딩과 호환되지 않습니다.Shader "Examples/CommandExample"
{
SubShader
{
// The rest of the code that defines the SubShader goes here.
Pass
{
// Enable subtractive blending for this Pass
Blend SrcAlpha One
BlendOp RevSub
// The rest of the code that defines the Pass goes here.
}
}
}
이 예제 코드는 SubShader 블록에서 이 커맨드를 사용하기 위한 구문을 나타냅니다.
Shader "Examples/CommandExample"
{
SubShader
{
// Enable subtractive blending for this SubShader
Blend SrcAlpha One
BlendOp RevSub
// The rest of the code that defines the SubShader goes here.
Pass
{
// The rest of the code that defines the Pass goes here.
}
}
}