Unity Shader: Blend混合

Unity Shader:Blend 混合

Blending is used to make transparent objects.
在这里插入图片描述
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.

混合不仅仅用于透明度混合,我们要开启混合,在Unity中设置的同时也进行了开启,但如果在其他图形API中是需要我们自己手动开启的。
源颜色(Src,source color):由片元着色器产生的颜色值
目标颜色(Dst,Destination color):从颜色缓冲中读取到的颜色值
这里的颜色值都是包括RGBA四个通道

1 混合命令语法(Syntax)

Blend Off

Turn off blending (this is the default)
默认设置,关闭混合
示例:
Blend Off

Blend SrcFactor DstFactor

Configure and enable blending. The generated color is multiplied by the SrcFactor. The color already on screen is multiplied by DstFactor and the two are added together.
开启混合并设置混合因子。源颜色会乘以SrcFactor,而目标颜色会乘以DstFactor,然后把两者相加再存入颜色缓冲中
示例:
Blend SrcAlpha OneMinusSrcAlpha
透明度混合的命令

Blend SrcFactor DstFactor, SrcFactorA Dst

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值