Skip to content

Text: alpha blending of the fonts is not applied correctly in shader #1245

@hordurj

Description

@hordurj

The glyph texture uses the alpha channel to anti-alias fonts. This information is not correctly used in the text shader.

return vec4<f32>(color.rgb * c.a, color.a);

where c.a is the font texture.

this will make the color darker which will only work on a black background. Instead, the following should be used:

return vec4<f32>(color.rgb, c.a);

This will properly blend the font with the background. If the alpha channel in the color should be used to make transparent text, then

return vec4<f32>(color.rgb, color.a * c.a);

could be used.

Example:

Before:
before

After:
after

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds-triageIssues that need triaging

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions