File tree Expand file tree Collapse file tree 2 files changed +4
-11
lines changed
kotlin/com/lambda/graphics/renderer/gui/font/core
resources/assets/lambda/shaders/fragment/font Expand file tree Collapse file tree 2 files changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -136,7 +136,8 @@ object LambdaAtlas : Loadable {
136136 val uv1 = Vec2d (x, y) * texelSize
137137 val uv2 = Vec2d (x, y).plus(size) * texelSize
138138
139- constructed[name] = GlyphInfo (size, - uv1, - uv2)
139+ val normalized = 128.0 / size.y
140+ constructed[name] = GlyphInfo (size * normalized, - uv1, - uv2)
140141
141142 x + = emoji.width + 2
142143 }
Original file line number Diff line number Diff line change @@ -14,20 +14,12 @@ float sdf(float channel) {
1414 return 1.0 - smoothstep (u_SDFMin, u_SDFMax, 1.0 - channel);
1515}
1616
17- vec4 sdf(vec4 texture) {
18- return vec4 (
19- sdf(texture.r),
20- sdf(texture.g),
21- sdf(texture.b),
22- sdf(texture.a)
23- );
24- }
25-
2617void main() {
2718 bool isEmoji = v_TexCoord.x < 0.0 ;
2819
2920 if (isEmoji) {
30- color = sdf(texture(u_EmojiTexture, - v_TexCoord)) * v_Color;
21+ vec4 c = texture(u_EmojiTexture, - v_TexCoord);
22+ color = vec4 (c.rgb, sdf(c.a)) * v_Color;
3123 return ;
3224 }
3325
You can’t perform that action at this time.
0 commit comments