I got some strange results while rendering text in directX11 over other objects. Each character becomes a black background (my clearing color). If the text gets rendered directly to the background everything is fine. Im using the imgui lib to render. I think this gets caused by a wrong setup of the blending - those are my settings:
D3D11_BLEND_DESC desc;
desc.AlphaToCoverageEnable = false;
desc.IndependentBlendEnable = false;
desc.RenderTarget[0].BlendEnable = false;
desc.RenderTarget[0].SrcBlend = D3D11_BLEND_ONE;
desc.RenderTarget[0].DestBlend = D3D11_BLEND_ZERO;
desc.RenderTarget[0].BlendOp = D3D11_BLEND_OP_ADD;
desc.RenderTarget[0].SrcBlendAlpha = D3D11_BLEND_ONE;
desc.RenderTarget[0].DestBlendAlpha = D3D11_BLEND_ZERO;
desc.RenderTarget[0].BlendOpAlpha = D3D11_BLEND_OP_ADD;
desc.RenderTarget[0].RenderTargetWriteMask = D3D11_COLOR_WRITE_ENABLE_ALL;
This is an image which shows the issue:
Update #1:
This is the method which im using to draw a string: https://github.com/ocornut/imgui/blob/9cff4d6e5e76dd18d9c4ee7a1560563da2059a44/imgui_draw.cpp#L2937
My clearcolor is:
ImVec4 clearColor = ImVec4(0.f, 0.f, 0.f, 0.f);
With the settings of ErnieDingo im getting this result: The positive part: The boxes around each character are gone. The bad part: Text which is very blurry/unsharp especially if the text gets rendered on a dark background/without background.
Update #2: This image seems to show the issue in a nutshell: The overlapping part of the square should be yellow and not green like the one at the top. The fist image also shows that only the transparent background of the font is considered which leads to the strange bars behind each letter.