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.

Bug textmeshpro distance field (surface) is pink in URP

Discussion in 'UGUI & TextMesh Pro' started by laurentlavigne, Jan 17, 2021.

  1. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    5,793
    upload_2021-1-17_0-6-51.png
    upload_2021-1-17_0-6-55.png

    overlay was my goto solution but ... it's overlay so it goes through geometry in world UI
     
    patrickdown likes this.
  2. patrickdown

    patrickdown

    Joined:
    Jul 20, 2017
    Posts:
    4
  3. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,581
    Surface shaders are not supported with SRP which is why you get the pink error shader.

    New shaders with support for SRP are included in the latest preview release of the TMP package for Unity 2020.3 or newer. Note some of those shaders and custom editors were written for version 11.0 of the SRP packages but now broken for version 12 but will be updated in the next preview release.

    The preview release for Unity 2020.3 or newer is version 3.2.0-pre.1.

    There is also a long thread about this topic and HDRP shaders for TMP which contains additional information.
     
  4. Ikaro88

    Ikaro88

    Joined:
    Jun 6, 2016
    Posts:
    264
    there any solution for 2019.4 version?
     
  5. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,581
    No solution for 2019.4 due to major changes in SRP between 2019.4 and 2020.3. I wanted to support 2019.4 but too many changes from inspectors, SRP itself, ShaderGraph, etc.
     
  6. Ikaro88

    Ikaro88

    Joined:
    Jun 6, 2016
    Posts:
    264
    Ok thanks.

    I cannot upgrade the project...
    There is any way to have 3d text thet is not always on top on URP and 2019.4 version?
     
  7. wilgieseler

    wilgieseler

    Joined:
    Oct 17, 2013
    Posts:
    59
    I'm still seeing the Distance Field (Surface) shaders render magenta in 3.2.0-pre.2 and Unity 2021.2.9
     
  8. Pathojen

    Pathojen

    Joined:
    Feb 4, 2019
    Posts:
    92
  9. MilenaRocha

    MilenaRocha

    Joined:
    Jun 30, 2018
    Posts:
    10
    Bump, same problem.
     
  10. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,581
    SRP does not support Surface Shaders.

    In Unity 2020.3 or newer, you should be using version 3.2.0-pre.3 of the TMP package which include new shader designed for SRP.

    Since these new shaders are contained in the TMP Essential Resources, you will need to re-import via the "Window - TextMeshPro - Import ..." menu after upgrading to the newer version of the package.

    The above information is contained in the Update Notes of the package in Package Manager.
     
  11. dragoNogarb

    dragoNogarb

    Joined:
    Nov 19, 2012
    Posts:
    6
    TextMeshPro still bug when I try to use Surface Material

    upload_2022-11-18_1-25-41.png
    upload_2022-11-18_1-25-52.png

    I already install TextMeshPro 3.2.0-pre.3 I use Unity 2021.3.9f1 and I use URP 12.1.7

    upload_2022-11-18_1-26-21.png
    upload_2022-11-18_1-26-38.png

    How to fix this? or How to make a text not bright in a dark scene like this
    upload_2022-11-18_1-31-56.png
     
  12. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,581
    Surface Shaders are not compatible with SRP which includes URP and HDRP. This is not specific to TMP. This is an SRP thing.

    Version 3.2.0-pre.3 includes new shaders that are compatible with SRP. These new shaders are contained in the updated TMP Essential Resources which you will need to import via the "Window/TextMeshPro/Import TMP Essential Resources" menu option.

    Once these have been imported, you will find then in the shader list under "TextMeshPro/SRP/...".
     
  13. dragoNogarb

    dragoNogarb

    Joined:
    Nov 19, 2012
    Posts:
    6
    Thank you for your reply. I use the shader from this
    now. and I got this upload_2022-11-21_15-53-21.png
    the text has the light on edges. How to fix this? This is my shader setting
    upload_2022-11-21_16-26-12.png upload_2022-11-21_16-26-35.png
    try to turn everything black except for the face color but not thing work