Hi Guys,
I have a problem where rendering direct to the back buffer is fine. But if I create a render target and draw to it, then render it to the back buffer, the sprite transparency eats holes through anything on the RT. Which then reveals the back buffer itself.
On the right side the render target is coloured a dark red to highlight the problem.
The blend state is being created and set early on (shortly after context creation) and is working ok as the back buffer is behaving as expected.
// Create default blend state
ID3D11BlendState* d3dBlendState = NULL;
D3D11_BLEND_DESC omDesc;
ZeroMemory(&omDesc, sizeof(D3D11_BLEND_DESC));
omDesc.RenderTarget[0].BlendEnable = true;
omDesc.RenderTarget[0].SrcBlend = D3D11_BLEND_SRC_ALPHA;
omDesc.RenderTarget[0].DestBlend = D3D11_BLEND_INV_SRC_ALPHA;
omDesc.RenderTarget[0].BlendOp = D3D11_BLEND_OP_ADD;
omDesc.RenderTarget[0].SrcBlendAlpha = D3D11_BLEND_ONE;
omDesc.RenderTarget[0].DestBlendAlpha = D3D11_BLEND_ZERO;
omDesc.RenderTarget[0].BlendOpAlpha = D3D11_BLEND_OP_ADD;
omDesc.RenderTarget[0].RenderTargetWriteMask = D3D11_COLOR_WRITE_ENABLE_ALL;
if (FAILED(d3dDevice->CreateBlendState(&omDesc, &d3dBlendState)))
return E_WINDOW_DEVICE_BLEND_STATE;
d3dContext->OMSetBlendState(d3dBlendState, 0, 0xffffffff);
if (d3dBlendState)
d3dBlendState->Release();
Any ideas would be greatly appreciated.
Thanks in advance.