Standard Alpha Blending in DirectX 10 (DX9 logic may still apply.)
Well I'm not sure how to set this up so it does basic blending it which the two objects are blended based on there alpha and not there colors. This is the closest I've come from trying random things:
ID3D10BlendState* BlendState = NULL;
D3D10_BLEND_DESC BlendStateDesc;
ZeroMemory(&BlendStateDesc, sizeof(D3D10_BLEND_DESC));
BlendStateDesc.AlphaToCoverageEnable = false;
BlendStateDesc.BlendEnable[0] = true;
BlendStateDesc.SrcBlend = D3D10_BLEND_SRC_ALPHA;
BlendStateDesc.DestBlend = D3D10_BLEND_ONE;
BlendStateDesc.BlendOp = D3D10_BLEND_OP_ADD;
BlendStateDesc.SrcBlendAlpha = D3D10_BLEND_ZERO;
BlendStateDesc.DestBlendAlpha = D3D10_BLEND_ZERO;
BlendStateDesc.BlendOpAlpha = D3D10_BLEND_OP_ADD;
BlendStateDesc.RenderTargetWriteMask[0] = D3D10_COLOR_WRITE_ENABLE_ALL;
g_d3dDevice->CreateBlendState(&BlendStateDesc, &BlendState);
g_d3dDevice->OMSetBlendState(BlendState, D3DXCOLOR( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF);
But it is adding the color to the destination and I want it to blend it by just the alpha and not the color.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement