Direct3D rendering 2D images with “multiply” blending mode and alpha

后端 未结 4 1984
暖寄归人
暖寄归人 2021-01-03 04:31

I\'m trying to replicate the Photoshop filter multiply with Direct3D. I\'ve been reading and googling about the different render states and I\'ve got the effect almost worki

4条回答
  •  悲哀的现实
    2021-01-03 05:28

    It sounds like you want:

    dst.rgb = (src.a * src.rgb) * ((1 - src.a) * dst.rgb)
    

    You would use D3DRS_BLENDOP to do that, but unfortunately there isn't a D3DBLENDOP_MULTIPLY. I don't think this operation is possible without a fragment shader.

提交回复
热议问题