Search Unity

  1. Unity 2019.1 is now released.
    Dismiss Notice

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

Discussion in 'Unity UI (uGUI) & TextMesh Pro' started by Reisender, Oct 4, 2017.

  1. Reisender

    Reisender

    Joined:
    Jun 26, 2014
    Posts:
    26
    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?
     
  2. benzuk

    benzuk

    Joined:
    Mar 11, 2014
    Posts:
    112
    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

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    2,770
    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:
    112
    Thank you very much!
     
    Stephan_B likes this.
  5. Reisender

    Reisender

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

    flapy-monkey

    Joined:
    Dec 23, 2014
    Posts:
    6
    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.
     
  8. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    5,188
    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

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    2,770
    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.