Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Bug TextMeshPro bad performance when creating material presets

Discussion in 'UGUI & TextMesh Pro' started by Hazneliel, May 31, 2023.

  1. Hazneliel

    Hazneliel

    Joined:
    Nov 14, 2013
    Posts:
    303
    I have been using TextMeshPro for years in my project without ever needing material presets, however a few days ago I created a material preset for a font I'm using and started to notice massive lag spikes when those canvas were enabled during the game.
    I profiled it and couldn't really tell where the problem was
    upload_2023-5-31_11-16-19.png

    Since I couldn't figure it out I decided to search the commit where this was introduced and it turns out to be the one where I created the material preset:
    I created it like this:
    upload_2023-5-31_11-19-44.png
    BLACKCAPS-Regular BolderOutline is the new material I added.

    I deleted that material and voila! No more lag spikes!
    upload_2023-5-31_11-23-42.png

    I am not even using this material preset on this scene.

    So my questions are:
    • Did I created the material preset wrong?
    • Is this a Unity or TextMeshPro Bug?
    • Am I missing something?
    Thanks for any help with this.
     

    Attached Files: