I’ve been trying to manage a little UI System. I have the URP installed so I can add some fancy lighting to my 2D UI system (The entire game is essentially a UI system). The lighting with URP doesn’t seem to affect TMP text objects.
To use TMP with SRP, you will need to make sure you are using the latest release of the TMP package which is version 3.2.0-pre.3 for Unity 2020.3 or newer.
You will also need re-import the TMP Essential Resources which contain the updated SRP shaders. To re-import the TMP Essential Resources, go to “Window - TextMeshPro - Import …” menu.
Once the TMP Essential Resources have been updated, you will see new shaders available which includes both URP and HDRP sets of shaders including Unlit and Lit shaders.
Thanks for the quick reply! Unfortunately my 2020.3.32f1 version of Unity only allows me to have TMP Version 3.0.6. It will not allow me to update it. I’m going to upgrade the project to 2021.3.4f1 to see if that allows me to update it from the package manager.
Version 3.2.0-pre.3 is a preview release. You will need to enable show preview packages in Package Manager in order to see it but you will most certainly be able to use it in 2020.3 or newer versions of Unity.
I have [Enable Pre-release Packages] Turned on, and I can see other items in the Unity Registry marked with the yellow Pre label. However there is still only TMP 3.0.6 marked with the Release sticker. There aren’t any indicators pointing me to the preview release. I am rather confused, I’m even using the guide at: https://docs.unity3d.com/Packages/com.unity.textmeshpro@3.2/manual/index.html
Apologies for the inconvenience, normally I’d find a Youtube tutorial, but most people seem to be using 3.0.6
[UPDATE] : It appears that Unity Version 2021 never actually shows the pre release package for TMP 3.2.0. I downgraded back to 2020.3.32 and found that after uninstalling TMP the reinstall allows you to “See other versions”. Currently fixing all the bugs from the downgrade
[UPDATE 2] : Unfortunately It did not work, I installed the pre release and re-Imported but the Text is still unresponsive to URP 2D Lights.
Again, thanks for helping me out with this. Here is an attachment with what I’m seeing right now. I have TMP 3.2.0-pre.3 And the Shader SDF URP LIT is applied. The only distinction I can make is the base material for your text is SDF - URP LIT. Could this be the cause? If so, I can’t seem to find that specific material in the TMP Folders.
I tried your suggestion and used the non UI Text mesh pro alongside the normal TextMeshPro (MeshRenderer).
Both with the correct shader on. Neither reacting to the 2D lighting system. Here’s another file of what I see.
(I’d still want to use the UI Components in any case as the project is mostly 2D UI)
To those of you wondering, I found an answer (Although it wasn’t the one I was hoping for). TMP does not seem to work with the 2D URP lighting system. By switching back to the base URP lighting system (Which doesn’t work as efficiently for 2D projects) I found that the TMP objects, specifically the ones with mesh rendering components, work just fine.
Unfortunately I don’t have a workaround right now, I’ll keep messing around with things until I find a solution. Here’s an attachment of what it looks like without the 2D Renderer on, The TMP is now responsive to the light, at the cost of not having the canvas light itself correctly. Rip
I encountered this problem in my 2D project a while back. I eventually decided to use the Universal Renderer over the 2D Renderer.
Before the switch, however, I was able to come up with a workaround for this problem. What I did was open up the “TMP_SDF-URP Lit” shader graph and change the material in the graph inspector from Lit to Sprite Lit.
If you want to keep the original Lit shader graph intact, you can duplicate the file, make the new changes in it, and rename it to something like “TMP_SDF-URP Sprite Lit”.
I didn’t do much experimenting so I can’t guarantee if you’ll encounter any new errors down the road. Hopefully this fixes your problem in the short term until an official bug fix is released.
Oh my god, dude. You saved me! Thanks so so much for this… it’s so dumb, really.
Please, Unity developer Stephan_B, if you’re still working at Unity: Fix this! It’s 2 minutes work, just copy-paste the URP Lit shader and set the Material to “Sprite Lit” instead of “Lit”. This just cost me 2 hours of research. Jesus.
Hi there. Thanks for the info @Metamor . Can someone from Unity please indicate whether using the “Sprite Lit” material is the preferred way to workaround (or fix) this problem? I’m not finding any bug report that matches this problem in the unity issue tracker.