Skip to content

Commit

Permalink
TMP字体渲染修正,使用字体资源获取字库纹理的尺寸,避免通过程序创建的资源取到字体纹理尺寸为0导致阴影效果渲染有误的问题。
Browse files Browse the repository at this point in the history
  • Loading branch information
Geequlim committed Jul 11, 2024
1 parent 494c63c commit 14fab03
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Assets/Scripts/Extensions/TextMeshPro/TMPFont.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ void Init()

void OnCreateNewMaterial(Material mat)
{
mat.SetFloat(ShaderUtilities.ID_TextureWidth, mainTexture.width);
mat.SetFloat(ShaderUtilities.ID_TextureHeight, mainTexture.height);
mat.SetFloat(ShaderUtilities.ID_TextureWidth, fontAsset.atlasWidth);
mat.SetFloat(ShaderUtilities.ID_TextureHeight, fontAsset.atlasHeight);
mat.SetFloat(ShaderUtilities.ID_GradientScale, _gradientScale);
mat.SetFloat(ShaderUtilities.ID_WeightNormal, fontAsset.normalStyle);
mat.SetFloat(ShaderUtilities.ID_WeightBold, fontAsset.boldStyle);
Expand Down

0 comments on commit 14fab03

Please sign in to comment.