Renderering text onto another textures with alpha blending |
Renderering text onto another textures with alpha blending |
David Olofson
Guest
|
I believe the dark edges come from 'blendedTexture'. To generate an RGBA texture with "pure" edges, you need to make sure all pixels have the correct (text) color - even the invisible ones. So, that texture needs to be the same color as the text, or you have to prepare the texture in some other way. Otherwise, colors bleed into the edges through the antialiased edges of the text.​
|
|||||||||||
|
stewambo
|
Thanks for the hint. After experimenting a bit I found out that using SDL_RenderClear with the color of the text worked like a charm. So just insert the following after setting the render target to the texture:
|
|||||||||||||
|