Alpha Misunderstanding?

I believe I’m missing something with alpha blending. I have letters rendered to a texture so I can draw text to the screen. The texture is solid white but only the pixels for the letters are solid everything else should be invisible. What I get however is white blocks where the text should be. The confusing part of me is that if I turn on the alpha channel in renderdoc I can see my text correctly. Do I have to do something in my fragment shader to handle this? I thought blending was fixed function. Below are my attachment and color settings.

colorWriteMask = 0xf;
blendEnable = VK_TRUE;
colorBlendOp = VK_BLEND_OP_ADD;
srcColorBlendFactor = VK_BLEND_FACTOR_SRC_COLOR;
dstColorBlendFactor = VK_BLEND_FACTOR_DST_COLOR;
alphaBlendOp = VK_BLEND_OP_ADD;
srcAlphaBlendFactor = VK_BLEND_FACTOR_ONE;
dstAlphaBlendFactor = VK_BLEND_FACTOR_ZERO;

logicOpEnable = VK_FALSE;
logicOp = VK_LOGIC_OP_NO_OP;
attachmentCount = 1;
blendConstants[0] = 1.0f;
blendConstants[1] = 1.0f;
blendConstants[2] = 1.0f;
blendConstants[3] = 1.0f;

Hello disks86,
i did not fully understand what do you mean by the letters are solid and the texture is white, but the general way to accomplish Alpha-Blending is a srcColorBlendFactor of VK_BLEND_FACTOR_SRC_ALPHA and a dstColorBlendFactor of VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA. You may want to take a look at this very good site: Anders Riggelsen - Visual glBlendFunc and glBlendEquation Tool

Hope i could help you :slight_smile:

That was it, thank you.