当前位置:   article > 正文

Shader命令——Blend 混合_shader blend

shader blend

Unity官网Blend API介绍  https://docs.unity3d.com/Manual/SL-Blend.html

Blend透明渲染这块有点头疼。知道参数,还不是很明白计算公式。后续学会的话,来更新文章

 

 

SrcColor  要渲染得颜色 

SrcAplha  要渲染的透明度

 

DstColor 已经再屏幕上显示的颜色

DstAlpha 已经再屏幕上显示得颜色透明度

 

One MinusSrcColor   1减去要渲染的颜色

OneMinusSrcAlpha   1减去要渲染的透明度

One MinusDstColor 1减去屏幕上显示的颜色

OneMinusDstAlpha 1减去屏幕上显示的颜色​​​​​​​的透明度

 

解释:

Blend SrcAlpha OneMinusSrcAlpha

要渲染的颜色 * 要渲染的颜色透明度 + (1-要渲染的颜色透明度)*Gubffer的像素

常用命令

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

 

 

BlendOp  当这个指令存在,则Blend 指令失效

AddAdd source and destination together.
SubSubtract destination from source.
RevSubSubtract source from destination.
MinUse the smaller of source and destination.
MaxUse the larger of source and destination.
LogicalClearLogical operation: Clear (0) DX11.1 only.
LogicalSetLogical operation: Set (1) DX11.1 only.
LogicalCopyLogical operation: Copy (s) DX11.1 only.
LogicalCopyInvertedLogical operation: Copy inverted (!s) DX11.1 only.
LogicalNoopLogical operation: Noop (d) DX11.1 only.
LogicalInvertLogical operation: Invert (!d) DX11.1 only.
LogicalAndLogical operation: And (s & d) DX11.1 only.
LogicalNandLogical operation: Nand !(s & d) DX11.1 only.
LogicalOrLogical operation: Or (s | d) DX11.1 only.
LogicalNorLogical operation: Nor !(s | d) DX11.1 only.
LogicalXorLogical operation: Xor (s ^ d) DX11.1 only.
LogicalEquivLogical operation: Equivalence !(s ^ d) DX11.1 only.
LogicalAndReverseLogical operation: Reverse And (s & !d) DX11.1 only.
LogicalAndInvertedLogical operation: Inverted And (!s & d) DX11.1 only.
LogicalOrReverseLogical operation: Reverse Or (s | !d) DX11.1 only.
LogicalOrInvertedLogical operation: Inverted Or (!s | d) DX11.1 only.
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/weixin_40725706/article/detail/96789
推荐阅读
相关标签
  

闽ICP备14008679号