I want to render a cube on a transparent background. I did enable blending for this and tryed to set alpha 0 for background. The window background is transparent. If the window background would be black (the black color is not from the windows background, I am not sure why it's rendering it) , the cube would render normally. When I move around it acts like drawing with a white brush. Any help, please ? picture
struct CD3D11_BLEND_DESC : public D3D11_BLEND_DESC
{
CD3D11_BLEND_DESC()
{}
explicit CD3D11_BLEND_DESC( const D3D11_BLEND_DESC& o ) :
D3D11_BLEND_DESC( o )
{}
explicit CD3D11_BLEND_DESC( CD3D11_DEFAULT )
{
AlphaToCoverageEnable = FALSE;
IndependentBlendEnable = TRUE; //FALSE;
const D3D11_RENDER_TARGET_BLEND_DESC defaultRenderTargetBlendDesc =
{
TRUE, //FALSE, //
D3D11_BLEND_ONE, D3D11_BLEND_ZERO, D3D11_BLEND_OP_ADD, //D3D11_BLEND_SRC_ALPHA, D3D11_BLEND_INV_SRC_ALPHA, D3D11_BLEND_OP_ADD, //
D3D11_BLEND_ONE, D3D11_BLEND_ZERO, D3D11_BLEND_OP_ADD, //
D3D11_COLOR_WRITE_ENABLE_ALL, //0x0f //
};
for (UINT i = 0; i < D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT; ++i)
RenderTarget[ i ] = defaultRenderTargetBlendDesc;
}
~CD3D11_BLEND_DESC() {}
operator const D3D11_BLEND_DESC&() const { return *this; }
};
...
SLATE_BEGIN_ARGS( SViewport )
: _Content()
, _ShowEffectWhenDisabled(true)
, _RenderDirectlyToWindow(true)
, _EnableGammaCorrection(true)
, _ReverseGammaCorrection(false)
, _EnableBlending(true)
, _EnableStereoRendering(false)
, _PreMultipliedAlpha(true)
, _IgnoreTextureAlpha(false)
, _ViewportSize(FVector2D(320.0f, 240.0f))
...
SceneColorBufferFormat = PF_FloatRGBA;