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

后端 未结 4 2011
暖寄归人
暖寄归人 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:31

    dev->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_DESTCOLOR);
    dev->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);
    

    Will do the trick. You cannot use the 'alpha' from the diffuse vertex color anymore though. Setting a low alpha on the vertex colors will actually brighten your overlaying pixels.

提交回复
热议问题