Hi all,
I'm trying to work my way through exercising with D3D11 blending.
In this case using blending states (not directly in the shader) and without using the alpha component.
I've created the spreadsheet below to make sure I understand the equations.
My questions:
1. Do you see any issues/ errors in the sheet?
2. I have the following challenge:
- render objects to the backbuffer
- render a cylinder with an animated texture
-- the animated texture has a large part of 'black' pixels
- I want the black pixels not to be rendered using blending (keep the 'dest'/ pixels on backbuffer the same), all others I want to stay the same
(not blended/ multiplied with the pixels already on the backbuffer.
So far I've tried this:
transparentDesc2.RenderTarget[0].BlendEnable = true;
transparentDesc2.RenderTarget[0].SrcBlend = D3D11_BLEND_ZERO;
transparentDesc2.RenderTarget[0].DestBlend = D3D11_BLEND_INV_SRC_COLOR;
transparentDesc2.RenderTarget[0].BlendOp = D3D11_BLEND_OP_ADD;
transparentDesc2.RenderTarget[0].SrcBlendAlpha = D3D11_BLEND_ONE;
transparentDesc2.RenderTarget[0].DestBlendAlpha = D3D11_BLEND_ONE;
transparentDesc2.RenderTarget[0].BlendOpAlpha = D3D11_BLEND_OP_ADD;
transparentDesc2.RenderTarget[0].RenderTargetWriteMask = D3D11_COLOR_WRITE_ENABLE_ALL;
The result is that the black pixels are indeed removed, but the color of the remaining pixels in the animated textures, are (I think) multiplied by the pixels already on the backbuffer, in this case the background color (after clearing the backbuffer).
(the non-black of the texture is dark blue/ greenish)
Can someone help me in the right direction to achieve my goal?
Any input is appreciated.