From 33f8ef9ee006522351f03fde6a884f5dafff901f Mon Sep 17 00:00:00 2001 From: JacobTech Date: Sun, 31 Mar 2024 19:16:15 -0400 Subject: [PATCH] Font Fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit •Only the font alpha channel is decreased. •Display missing texture for missing glyphs --- GraphicsManager/GraphicsManager.csproj | 2 +- GraphicsManager/Objects/Core/Texture.cs | 13 +++++++++++++ GraphicsManager/Resources/Shaders/Label.frag | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/GraphicsManager/GraphicsManager.csproj b/GraphicsManager/GraphicsManager.csproj index 3299491..99c0d72 100644 --- a/GraphicsManager/GraphicsManager.csproj +++ b/GraphicsManager/GraphicsManager.csproj @@ -10,7 +10,7 @@ False https://git.jacobtech.com/JacobTech.com/GraphicsManager git - 1.0.8-alpha99 + 1.0.9-alpha01 diff --git a/GraphicsManager/Objects/Core/Texture.cs b/GraphicsManager/Objects/Core/Texture.cs index 0c8df56..5be6b8d 100755 --- a/GraphicsManager/Objects/Core/Texture.cs +++ b/GraphicsManager/Objects/Core/Texture.cs @@ -271,6 +271,19 @@ public class Texture if (!BadChars.ContainsKey(l)) { BadChars.Add(l, TextureManager.TextureManagers[con].AddTexture(Tools.GetResourceStream("GraphicsManager.Resources.Textures.BadChar.png"))); + BadChars[l].Unit = (s.GetUniformLocation("u_texture") switch + { + 0 => TextureUnit.Texture0, + 1 => TextureUnit.Texture1, + 2 => TextureUnit.Texture2, + 3 => TextureUnit.Texture3, + 4 => TextureUnit.Texture4, + 5 => TextureUnit.Texture5, + 6 => TextureUnit.Texture6, + 7 => TextureUnit.Texture7, + 8 => TextureUnit.Texture8, + 9 => TextureUnit.Texture9, + }); Label._characters[con][l].Add(temp, new() { Size = Label._characters[con][l].First().Value.Size, diff --git a/GraphicsManager/Resources/Shaders/Label.frag b/GraphicsManager/Resources/Shaders/Label.frag index 66142a2..b1a837c 100755 --- a/GraphicsManager/Resources/Shaders/Label.frag +++ b/GraphicsManager/Resources/Shaders/Label.frag @@ -12,5 +12,5 @@ void main() { vec2 uv = vUV.xy; float text = texture(u_texture, uv).r; - fragColor = textColor*text; + fragColor = vec4(textColor.rgb, textColor.a*text); } \ No newline at end of file