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.
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.
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.
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…)
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?
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.
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.
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.