Blending

  Blending is used to make transparent objects.

  Blending

  When graphics are rendered, after all shaders have executed and all textures have been applied, the pixels are written to the screen. How they are combined with what is already there is controlled by the Blend command.

[Syntax]

  Blending

  

  Additionally, you can set upper-rendertarget blending modes. When using multiple render target (MRT) rendering, the regular syntax above sets up the same blending modes for all render targets. The following syntax can set up different blending modes for individual render targets, where N is the render target index (0..7). This feature works on most modern APIs/GPUs (DX11/12, GLCore, Metal, PS4):

  • Blend N SrcFactor DstFactor
  • Blend N SrcFactor DstFactor, SrcFactorA DstFactorA
  • BlendOp N Op
  • BlendOp N OpColor, OpAlpha

[Blend Operations]

  Blending

[Blend factors]

  Blending

[常用混合类型]

  Blending

[Examples]

1、Here is a small example shader that adds a texture to whatever is on the screen already:

Shader "Simple Additive" {
    Properties {
        _MainTex ("Texture to blend", 2D) = "black" {}
    }
    SubShader {
        Tags { "Queue" = "Transparent" }
        Pass {
            Blend One One
            SetTexture [_MainTex] { combine texture }
        }
    }
}
View Code

相关文章:

  • 2021-04-30
  • 2021-11-26
  • 2021-07-31
  • 2021-09-06
  • 2021-04-13
  • 2021-08-18
  • 2022-01-13
猜你喜欢
  • 2022-12-23
  • 2021-10-15
  • 2021-06-22
  • 2022-12-23
  • 2021-12-22
  • 2022-12-23
  • 2021-09-23
相关资源
相似解决方案