ホーム 暮らし [Unity / TextMeshPro] The phenomenon of transparent backgrounds appearing with Outline and how to deal with it [Memorandum]

[Unity / TextMeshPro] The phenomenon of transparent backgrounds appearing with Outline and how to deal with it [Memorandum]

三浦 拓海 三浦 拓海 • 更新: • 公開: • 読了約 4 分
目次
n3b6cabc9971c

When using the TextMeshPro outline feature, an unintended semi-transparent square background may appear around the text.
In this article, I will summarize the cause and how to solve it as a memorandum.

Try generating a Font normally


First, create a Font normally.
This time, I will use it for a font with only Roman letters and numbers.
The RenderMode is SDFAA.

What is SDFAA?
  • SDFAA (Signed Distance Field with Adaptive Anti-Aliasing)

  • Supports high-quality outlines and shadows. The standard for TextMeshPro.

  • Supports high resolution, scaling, and text with outlines

When I put the generated Font into TextMeshPro, it looked like the image below.
There is a transparent square background around the text, right?

To conclude...


To conclude, there is a problem with the Padding.

In TextMesh Pro, to render effects such as outlines and shadows, it is necessary to secure padding around the characters.
If the padding is insufficient, the effect may be clipped at the boundary of the Font Atlas, causing a transparent background to be rendered.

Regenerating the Font Asset


So, I tried setting the Padding value to 10% and ran the Font Generator.

Generate the Font with this and put it into TextMeshPro.
Next, if you adjust the Outline Thickness value, the Outline will appear!

This concludes the memorandum.

同じカテゴリの記事

三浦 拓海
コンテンツディレクター 三浦 拓海
プロフィールを見る →

映画と連続ドラマの公開情報を追う担当。配給会社のプレスシートと公式サイトの発表日を確認したうえで執筆します。

おすすめの関連記事