#version 450 layout(location = 1) in vec4 in_color; layout(location = 2) in vec2 in_uv; layout(location = 0) out vec4 outColor; layout(set = 2, binding = 0) uniform sampler2D textSampler; void main() { // Sample the glyph alpha from the texture float glyphAlpha = texture(textSampler, in_uv).a; // Output straight alpha: (RGB, Alpha) // The blender (BlendAlpha) will multiply RGB by Alpha during compositing. // This avoids black fringes because we don't interpolate the texture's RGB. outColor = vec4(in_color.rgb, in_color.a * glyphAlpha); }