Text Not Blending Properly

Hi all, I’ve been developing a game engine in vulkan for a while, and I’ve had this problem that I can’t quite figure out. I’m using Freetype to render text, and for some reason when I render my text against a light background, the edges are gray. It seems like instead of blending to transparency, it is blending to black.

This problem was only really apparent after I changed the surface format of the engine. I was using

surfaceFormat = VK_FORMAT_B8G8R8A8_SRGB 

but switched to

surfaceFormat = VK_FORMAT_R8G8B8A8_UNORM

Also I am rendering the text to a separate texture here, then doing postprocessing, then combining with the background.

How can I get rid of the gray border? Thanks.

You didn’t really mention how you’re rasterizing and blending your text onto the framebuffer. But I suspect pre-multiplied alpha blending and/or an sRGB framebuffer will resolve your issue. Read this post for more details (including screenshots and tutorial links):

Note: the last few posts in this thread discuss sRGB framebuffers, why, and what you get if you don’t use one.