device->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA); device->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA); device->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
Maybe there's something wrong with the mask I'm using? Here are the images I'm testing with:
The main image to apply the mask to.
[attachment=9596:test.png]
The image mask to apply. It has a green color just to make it more obvious if there was a problem with the color part. The empty areas have zero alpha, which needs to be applied to the first image somehow.
[attachment=9597:testMask.png]
This is what the result should be.
[attachment=9598:testResult.png]