Im posting this here because i was having issues with this but found a solution. This is some step by step instructions on how to give TMP text lighting in 2D URP.
-
Install TMP V3.2.0-pre.3. This is a pre release package and from what if found this is the only way to do it. Start by going to the package manager hitting the plus icon in the top left and then add package by name. then in the name as com.unity.textmeshpro and the version as 3.2.0-pre.3
-
you need to reimport text mesh pro. you can do this by clicking windows → TextMeshPro → Import TMP Essential resources
-
now there should be a shader called TMP_SDF-URP Lit you can find it by searching for the name in the TextMeshPro Package
-
open the shader graph for the TMP_SDF-URP Lit and change the material from lit to sprite lit and make sure to save as and rename it so you dont get rid of TMP_SDF-URP Lit. (you can change the name to something like TMP_SDF-URP Sprite Lit)
-
On the Text mesh pro object you want light to be affected by select it and scroll to the bottom and change the shader to the new one you just made TMP_SDF-URP Sprite Lit
After this it should work with the unity 2D URP lighting. There are a few error that it throws form time to time that i have not yet found a way to fix. But for the most part it works



