赞
踩
// 颜色混合
static Color NormalBlend(Color background, Color cover)
{
float CoverAlpha = cover.a;
float OneMinuCoverAlpha = 1-CoverAlpha ;
Color blendColor;
blendColor.r = cover.r * CoverAlpha + background.r * OneMinuCoverAlpha ;
blendColor.g = cover.g * CoverAlpha + background.g * OneMinuCoverAlpha ;
blendColor.b = cover.b * CoverAlpha + background.b * OneMinuCoverAlpha ;
blendColor.a = 1;
return blendColor;
}
// 颜色混合- 带 a 通道的颜色混合
static Color NormalBlend2(Color background, Color cover)
{
float CoverAlpha = cover.a;
Color blendColor;
float OneMinuCoverAlpha = 1-CoverAlpha ;
blendColor.a = cover.a + background.a * OneMinuCoverAlpha;
blendColor.r = (cover.r * cover.a + background.r * background.a * OneMinuCoverAlpha) / (blendColor.a);
blendColor.g = (cover.g * cover.a + background.g * background.a * OneMinuCoverAlpha) / (blendColor.a);
blendColor.b = (cover.b * cover.a + background.b * background.a * OneMinuCoverAlpha) / (blendColor.a);
return blendColor;
}
AmplifyShader-带Alpha贴图混合节点下载声明:本文内容由网友自发贡献,转载请注明出处:【wpsshop博客】
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。