We’re modifying the TextMeshPro’s mesh in runtime to achieve the shadow effect you can see below. However, upgrading to a version later than 1.3.0 makes the text disappears when its pivot goes off the screen.
Is it possible to have the behaviour from 1.3.0 in 2.1.0+? If so, can you point me to the right direction? I’ve been fiddling with the shaders to no avail. I attached the test script used in the gifs below.
Using Underlay restricts us on how much offset we can have without having a large padding that will cause us to have bigger atlas or have a smaller point size which cause the text to become soft. Both are not desirable with our constraints.
Increasing the Underlay range does indeed require increasing padding values. As you stated, this does impact sampling point size and texture space.
How much range do you need on the Shadow? For instance, a ratio of Sampling Point Size to Padding of 20% usually provides decent range. Sampling point size should be within 72 to 120 point size depending on the type face complexity. It is rare to need higher sampling. Asian character usually work well between 36 - 48.
Do you need this depth of shadow on all text or just titles? If just titles, it might make sense to use a different font asset and texture just for those few characters.
Just looking for a better understanding of the use case given it is unusual to have shadows that extend far away from the text outside of world space type usage where for those use cases, using a Surface / lit shader where the text object casts a shadow in the scene usually works best.
P.S. I’ll take a look at the initial report / pivot relationship and culling.
It’s being used for both titles and regular text. An example would be if the font size of a text is 12 and requires a 4pt vertical offset, the padding would then need to be around 33%.
We’re basically mimicking how Unity UI Shadow does it; but we’re not using Unity UI and all our UI items are in world space.
The text object should remain visible until its bounds are outside of the camera view.
Having said that, this wasn’t always the case so please test with the latest release of the TMP package which is version 3.2.0-pre.3 for Unity 2020.3 or newer. Be sure to re-import the TMP Essential Resources as the shaders have changed in these most recent releases.
The culling is definitely handled differently between the Canvas and the Mesh Renderer. On the normal TMP text object’s mesh renderer, you can disable Dynamic Occlusion. When you do so, does that make the object remain visible?
Unity 2022.1, TMPro 3.2.0-pre.4
Similar problem, but my text dissappear when its edge touches screen’s edge (not pivot!).
And when I this text is visible in “screen” tab, it’s working nice in “game” tab.
It seems to be ok in build, but in editor there is some strange behaviour =_=.