【Unity3d Shader】颜色叠加算法

把图片B(半透明)压在图片A(半透明)上面的颜色叠加算法

half4 blend_color(half4 c1, half4 c2)
    {
        half4 result = half4(0, 0, 0, max(c1.a, c2.a));
        result.rgb = c1.rgb * (1 - c2.a) + c2.rgb * c2.a;
        return result;
    }

猜你喜欢

转载自blog.csdn.net/PangNanGua/article/details/106523217