Blend SrcAlpha OneMinusSrcAlpha        //alpha blending
        Blend One OneMinusSrcAlpha             //premultiplied alpha blending
        Blend One One                          //additive
        Blend SrcAlpha One                     //additive blending
        Blend OneMinusDstColor One             //soft additive
        Blend DstColor    Zero                 //multiplicative
        Blend DstColor SrcColor                //2x multiplicative
        Blend Zero SrcAlpha                    //multiplicative blending for attenuation by the fragment's alpha

如上,Blend有许多种,如果不熟悉他们的效果,只需记住下面的公式:

float4 result = SrcFactor * fragment_output(计算出来的颜色) + DstFactor * pixel_color(已经存在的颜色);

(在混合操作中,我们将片段着色器中计算出来的颜色称之为 “源颜色”,帧缓存中对应的像素已经存在的颜色叫做“目标颜色”。)

 

而混合操作的基本语法为

Blend SrcFactor DstFactor

然后推算和尝试,去获得想要的结果,多了就能一眼看出各个Blend的效果了。

原文地址:http://www.cnblogs.com/daxiaxiaohao/p/4059310.html

相关文章:

  • 2022-12-23
  • 2021-10-13
  • 2021-08-16
  • 2021-09-29
  • 2022-01-07
  • 2021-06-25
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-01
  • 2022-12-23
  • 2022-12-23
  • 2021-10-13
  • 2021-11-08
  • 2021-09-14
  • 2022-01-02
相关资源
相似解决方案