Search Unity

Multiple "Shader error" messages when building for Windows; text is all pink boxes

Discussion in 'UGUI & TextMesh Pro' started by Reisender, Oct 4, 2017.

  1. Reisender

    Reisender

    Joined:
    Jun 26, 2014
    Posts:
    35
    Hey all!

    I'm building a Windows version of my game using TextMesh Pro; some weird stuff happens, I hope you can save my day...

    - First, when I'm building, the console shows these shader errors:
    Shader error in 'TextMeshPro/Mobile/Distance Field (Surface)': failed to open source file: 'TMPro_Properties.cginc' at line 64 (on d3d9)
    Shader error in 'TextMeshPro/Mobile/Distance Field (Surface)': failed to open source file: 'TMPro_Properties.cginc' at line 64 (on d3d11)
    Shader error in 'TextMeshPro/Distance Field Overlay': failed to open source file: 'TMPro_Properties.cginc' at line 126 (on d3d9)
    Shader error in 'TextMeshPro/Distance Field (Surface)': failed to open source file: 'TMPro_Properties.cginc' at line 78 (on d3d9)
    Shader error in 'TextMeshPro/Distance Field (Surface)': failed to open source file: 'TMPro_Properties.cginc' at line 78 (on d3d11)
    Shader error in 'TextMeshPro/Mobile/Distance Field Overlay': failed to open source file: 'TMPro_Properties.cginc' at line 89 (on d3d9)
    Shader error in 'TextMeshPro/Mobile/Distance Field - Masking': failed to open source file: 'TMPro_Properties.cginc' at line 95 (on d3d9)
    Shader error in 'TextMeshPro/Mobile/Distance Field': failed to open source file: 'TMPro_Properties.cginc' at line 89 (on d3d9)
    Shader error in 'TextMeshPro/Mobile/Distance Field': failed to open source file: 'TMPro_Properties.cginc' at line 89 (on d3d11)
    Shader error in 'TextMeshPro/Distance Field': failed to open source file: 'TMPro_Properties.cginc' at line 126 (on d3d9)
    Shader error in 'TextMeshPro/Distance Field': failed to open source file: 'TMPro_Properties.cginc' at line 126 (on d3d11)

    - The exe is built successfully despite of these. I can run it in 2 different Windows pc's and everything works like a charm.
    - I also have cloud builds configured for this project. No errors or issues at all here. I can also run the game and works perfectly.
    - The problem comes when one of my stakeholders runs the game that was built from my pc on his pc. All texts that are using TextMesh Pro are shown as pink boxes. This isn't happening with the build from cloud, just the one I build from my pc.

    Any thoughts?
     
    ROBYER1 and makaka-org like this.
  2. benzuk

    benzuk

    Joined:
    Mar 11, 2014
    Posts:
    117
    I'm getting similar errors during play mode inside an editor. Everything was working fine on Unity 2017.1, but after I upgraded to 2017.2, It seems broken completely. I'm so disappointed about this asset.

    Here is the errors: https://i.gyazo.com/d4f576b296a9c3c6ba17b08446380d65.png

    EDIT: You can choose another shader for your material. I chose Bitmap for now.
     
    Last edited: Oct 9, 2017
  3. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Make sure that when you update to a new version of Unity that you also update to the matching release of TMP for that version of Unity.

    In terms of the list of error above, more specifically the issue with the TMPro_Properties.cginc, this appears to be an import issue or shader compiler issue. Please delete the "TextMesh Pro/Resources/Shaders" folder and re-import it. This should make that issue go away.
     
  4. benzuk

    benzuk

    Joined:
    Mar 11, 2014
    Posts:
    117
    Thank you very much!
     
    Stephan_B likes this.
  5. Reisender

    Reisender

    Joined:
    Jun 26, 2014
    Posts:
    35
    Yep, that worked! Thanks a lot!
     
  6. flapy-monkey

    flapy-monkey

    Joined:
    Dec 23, 2014
    Posts:
    7
    yes, reimport after delete
     
  7. Shah494

    Shah494

    Joined:
    Jan 26, 2017
    Posts:
    2
    Just right click the all the culprit shaders and select 'Reimport'.
    Faster & cleaner than deleting and reimporting manually.
     
    ATate, FlightOfOne, glenneroo and 2 others like this.
  8. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,438
    got this error when i copied tmpro shader (to modify it), and moved it outside the textmesh pro folder.

    works fine if modified shader is within the original shaders folder.
    (probably since the cginc file there, although i expected it to read cginc file from anywhere..)
     
  9. George-Dolbier

    George-Dolbier

    Joined:
    Sep 1, 2013
    Posts:
    9
    Still it is a bug with the importer. And this still occurs in 2019.1.3, especially when importing packages with TMPro dependancies. Or maybe the bug is not in the importer, but with package EXPORT?
     
  10. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    I have seen this behavior resurface but not sure why. The TMPro_Properties.cginc hasn't changed in a long time nor has the configuration / location of the shaders. Maybe it is some issue with Shader compilation that is now surfacing.
     
  11. JinHu4494

    JinHu4494

    Joined:
    Jun 28, 2018
    Posts:
    1
    나는 wanna convert TMP to nomal Text
    TMP have mayy troubles
     
  12. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    What specific issues are you having?

    Make sure you are using the latest release of TMP which is version 1.5.0 for Unity 2018.x, version 2.1.0 for Unity 2019.x and version 3.0.0 for Unity 2020.x

    UI Text is considered a legacy text component and is no longer on active development. Please report any issues you have with TMP so that we may fix those.
     
  13. makaka-org

    makaka-org

    Joined:
    Dec 1, 2013
    Posts:
    1,026
    Unity 2019.1.10f, TextMesh Pro 2.1.3, OpenGLES3.

    Still have:
    "Shader error in 'TextMeshPro/Mobile/Distance Field': failed to open source file: 'TMPro_Properties.cginc' at line 95 (on gles3)"

    Solution: Delete Mobile Shader.
     
  14. McPeppergames

    McPeppergames

    Joined:
    Feb 15, 2019
    Posts:
    103
    (posted already in another thread)

    My problem is the TextMeshPro/Mobile material fails to compile on a PC under Windows. Runs fine on Mac but not on PC.

    Is there a way to fix this? I already have the newest TextMeshPro version.

    Update:

    I got the error:
    Shader error in "TextMeshPro/Mobile/Distance Field": Couldn't open include file "TMPro_Properties.cginc.at line 91
     
  15. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    The TMP shaders were initially contained in "TextMesh Pro/Resources/Shaders/...". They were eventually moved to "TextMesh Pro/Shaders/...". As such it is possible that in your project these are split including between those two folders.

    If these are split in your project, move all of them into the same "TextMesh Pro/Shaders/..." folder including the .cginc files. Once done and since the shaders have been updated over time, I would suggest to re-importing the shader included in the TMP Essential Resources using the "Window - TextMeshPro - Import TMP Essential Resources" menu.

    It is also possible the issue is related to an issue in the Library cache where this issue would also be resolved by re-importing the shaders.
     
  16. McPeppergames

    McPeppergames

    Joined:
    Feb 15, 2019
    Posts:
    103
    Thanks for your feedback. There is no Shaders folder inside the TextMesh Pro/Resources folder.
    I will try to reimport everything.