I wanted to use TMPro in world space to create labels for some gameobjects. But my project has custom shader for 3D objects to make curved world effect.
To match labels with everything else I made a copy of TMP_SDF-Mobile shader and added a few lines to vertex part of it to make things look nice. It works fine, but in order to do that I had to modify some files in Packages folder (basically to make editor UI work for new shader).
I guess it’s not the best thing to do because of obvious reasons. So my question is: is there any “right way” to do such a thing, or have I done something that I was not supposed to?
Ok, answering for myself: to avoid all my changes being overwritten after TMPro package update, I’ve hardcoded all the values into shader code, moved it into separate directory in Assets folder. Downside of this method: no sliders in editor, to make curvature value tuning I will have to modify shader code, but it’s kind of sustainable solution.
The shaders are added to the local project in Resources/Shaders/… along with the .cginc files.
You should be able to copy one of those shaders and modify it for your needs.
Yep, I did the exact same thing, and created a copy of the txte mesh pro shader I needed to modify.
tip: modify the shader name in the code, or else you will have 2 shaders with the same name in the editor