Search Unity

Resolved uGUI/TextMeshPro: please provide a proper way to make textshadow/glow

Discussion in 'UGUI & TextMesh Pro' started by Sengaya, Aug 26, 2022.

  1. Sengaya

    Sengaya

    Joined:
    Nov 21, 2018
    Posts:
    9
    This is an issue that is bugging me and my devs for a long time:

    Text shadow and glow on TextMeshPro component doesn't work good. Offset and size are not relative to text size, settings of feather and opacity are very restricted, and often times you can see artifacts around the letters (an issue that also appears when shadow or glow is not active).

    Thanks again guys! <3
     
  2. HugoBD-Unity

    HugoBD-Unity

    Unity Technologies

    Joined:
    May 14, 2018
    Posts:
    499
    Hi Sengaya! I am a developer from the Text Team.

    Offset and size are not relative to text size: Could you elaborate on this point? TMP's material properties are relative to the font size of the TextComponent. This is convenient as changing the font size preserves the looks of your material properties.

    Settings of feather and opacity are very restricted: Same here, could you elaborate or share a screenshot of this issue you are experiencing?

    You can see artifacts around the letters: TMP has various configurations depending on your needs. From text that needs to be rendered super fast to a huge title that needs to be as crisp as possible. Can you send a screenshot of what you see ?

    For a title that needs to be extra crisp, here are my recommendations:
    - Use a static font asset and create it through the FontCreator.
    - Only include the characters that are needed for your title as the atlas will be large
    - Increase the sampling point size.
    - Keep in mind that your sampling to padding ratio should stay 1:10.
    - Once all settings are fine, you can play around with the different Rendering Modes. SDFAA is the fastest, but also the less precise. SDF32 is extremely slow to rasterize, but it gives the best result. Perfect for a game title.

    By the way we are in the process of writing documentation for all of the above :)
     
  3. ChimiChangle

    ChimiChangle

    Joined:
    Feb 28, 2017
    Posts:
    8
  4. HugoBD-Unity

    HugoBD-Unity

    Unity Technologies

    Joined:
    May 14, 2018
    Posts:
    499
    Super interesting, I wasn't aware of this asset.

    You can achieve bigger text effects with TMP by increasing your sampling to padding ratio. By default, we recommend 1:10, but if you need larger effects (shadow, outline...) you'll need to increase the padding. Here's what I achieved with a ratio of 1:20 and to be honest I still had a lot of room for bigger effects.

    I do want to point out that we have a few limitations as of now. For instance, when the text effect colour is different than the text colour, it can cause the effect to overlap text if the effect is big enough.



    Screen Shot 2022-08-26 at 9.40.33 AM.png
     
  5. Sengaya

    Sengaya

    Joined:
    Nov 21, 2018
    Posts:
    9
    Thanks a lot for your answers and recommendations guys!

    Unfortunately i have to leave my computer now, as it is already 9 p.m. in germany ^^

    I will provide more info on my issues in the next days if that is even possible.

    Have good day y'all!
     
    HugoBD-Unity likes this.