No ETA yet but most likely at some point in the 2020 cycle.
Perfect, thanks! Looking forward to it.
Have tried 1.4.1, but havenāt tried 1.5.0. So, in 1.4.1 it would fail to add new glyphs when a dynamic font atlas is full filled. And the multi atlas solution Iām not sure how much memory it would take. Does it have logic to clean the texts that are no longer alive?
My case is : using text in chatting, where user can type freely. And the texts need to have outline or shadow, so UGUI Text is not a good solution(but now still using UGUI Text for dynamic content). And wondering if TMP would clean unused text strings in the atlas.
When it is no longer possible to add a glyph to an atlas texture, TMP does like before and looks for a potential fallback.
In terms of the Multi Atlas feature, when it is no longer possible to add a glyph to the current atlas, a new atlas texture is created with the same Generation Setting to which the glyph is added. In terms of memory, it is the whatever the new texture requires which is identical to the previous atlas texture since they use the same settings.
There is not as this has additional performance overhead and can lead to lots of issues.
The Dynamic System in TMP combined with Multi Atlas feature and fallback system can easily handle this use case.
Please note that newly created dynamic font assets have their atlas texture size at 0 until the first glyph is added. As such, they take little space in a build and little memory overhead until the first glyph needs to be added at which point they are re-sized from Zero to their defined size in the Generation Settings.
It is important to understand that changes to font asset in the Editor are persistent but not at runtime. These means these font assets and atlas texture are reset to their default state at the start of every play session. As such, these font assets only need to handle whatever characters are needed in a single session. Should the need arise, there is also API function to reset font assets.
Latest preview release is now available, I suggest you give that a shot. Latest release for Unity 2018.4 is 1.5.0-preview.2 and 2.1.0-preview 2 for Unity 2019.x or newer.
Release 1.5.0-preview.2 for Unity 2018.4 is now available as well as release 2.1.0-preview.2 for Unity 2019.x or newer. See release notes for changes.
Please continue to provide feedback specific to these release in this thread and general feedback / questions in separate threads.
IMPORTANT NOTE:
As a result of adding support for setting culling mode in the material in the Debug Settings of the material inspector, users should update the TMP Essential Resources via the āWindow - TextMeshPro - Import TMP Essential Resourcesā menu option to import the revised shaders.
i get errors after upgrading from preview 1 to preview 2. Whatās the reason for this?
-
(happens somehow with empty text fields)
NullReferenceException: Object reference not set to an instance of an object
TMPro.TMP_Text.StringToCharArray (System.String sourceText, TMPro.TMP_Text+UnicodeChar[ ]& charBuffer) (at Library/PackageCache/com.unity.textmeshpro@2.1.0-preview.2/Scripts/Runtime/TMP_Text.cs:2530) -
(happens for all textfields which are still using <style=X>)
UnassignedReferenceException: The variable m_sharedMaterial of TextMeshProUGUI has not been assigned.
You probably need to assign the m_sharedMaterial variable of the TextMeshProUGUI script in the inspector.
UnityEngine.Material.GetFloat (System.String name) (at C:/buildslave/unity/build/Runtime/Export/Shaders/Shader.cs:523)
TMPro.TMP_SubMeshUI.UpdateMaterial () (at Library/PackageCache/com.unity.textmeshpro@2.1.0-preview.2/Scripts/Runtime/TMP_SubMeshUI.cs:691)
I am not sure about this one. Can you please provide me with a repro scene / project for the above?
As per my important note just before your post, you need to import the latest TMP Essential Resources (the shaders namely which have a new property to provide control over culling).
@Stephan_B i will try to reproduce it in a very small project. Regarding point 2, i did import the TMP Essential Resources, without doing that i had like hundreds of missing __Culling shader properties but they were gone after importing and only hundreds of the other errors were left and ONLY for textfields using , i will try to make a repo for that as well
This change to the TMP_SubMeshUI.cs and the equivalent change to TMP_SubMesh.cs should resolve #2

Iāll take a look as soon as possible once you get me the repro project.
just sent you the repro project, check your inbox. Would be cool if you can tell me if it really was a bug or some mistake or broken asset on my side.
That doesnāt fix those exceptions for me. Iām seeing MissingReferenceException: The variable m_sharedMaterial of TextMeshProUGUI doesn't exist anymore. in TMP_SubMeshUI.cs:691, but 1) you already null-check m_sharedMaterial above, and 2) that line doesnāt have any references to m_sharedMaterial.
This is the entire code for that section. There is a specific check for m_sharedMaterial at line 688 so it should return before line 691.
protected override void UpdateMaterial()
{
//Debug.Log("*** STO-UI - UpdateMaterial() *** FRAME (" + Time.frameCount + ")");
if (m_sharedMaterial == null)
return;
//if (canvasRenderer == null) m_canvasRenderer = this.canvasRenderer;
// Special handling to keep the Culling of the material in sync with parent text object
if (m_sharedMaterial.HasProperty(ShaderUtilities.ShaderTag_CullMode))
{
float cullMode = textComponent.fontSharedMaterial.GetFloat(ShaderUtilities.ShaderTag_CullMode);
m_sharedMaterial.SetFloat(ShaderUtilities.ShaderTag_CullMode, cullMode);
}
canvasRenderer.materialCount = 1;
canvasRenderer.SetMaterial(materialForRendering, 0);
//m_canvasRenderer.SetTexture(mainTexture);
#if UNITY_EDITOR
if (m_sharedMaterial != null && gameObject.name != "TMP SubMeshUI [" + m_sharedMaterial.name + "]")
gameObject.name = "TMP SubMeshUI [" + m_sharedMaterial.name + "]";
#endif
}
Make sure you imported the revised Shaders contained the updated TMP Essential Resources. You can select to only import the shader folder.
Also make sure you made the changes in the global package cache otherwise the changes will be reset every time you restart Unity.
If the issue persists, I will need more information such as when is this happening? Can you produce it easily and can you provide me with a repro project / scene?
Yes ā that was how my code looked; I had imported the essentials; and I had made the change in the global cache. However: since the only font material reference on line 691 was to textComponent.fontSharedMaterial, I added an extra null-check for that to the m_sharedMaterial check, and the errors went away. Not sure why the console was reporting it as a null-ref on the incorrect variable (maybe theyāre aliased to each other at that point).
Edit: so now lines 685-686 look like this:
if (m_sharedMaterial == null || textComponent.fontSharedMaterial == null)
return;
When was this happening? Ie. Just after enabling an object or just after instantiation?
Trying to figure out why fontSharedMaterial would be null in this case.
I had upgraded from 2.1.0 preview 1 to preview 2. As soon as that finished compiling, I got two sets of errors to console: the (apparently misleading) m_sharedMaterial nullref, and the various _CullMode errors. After seeing your posts, I imported essentials, which fixed the _CullMode ones, but the m_sharedMaterial ones popped up again. I then added the HasProperty check, which didnāt change anything because the nullref was on textComponent.fontSharedMaterial.
This was all in editor, without pressing Play.
For more details: exactly 6 m_sharedMaterial errors got printed to the console. When I clicked on them, they would all ping my Resources/Prefabs/UI folder, but not any specific prefabs. So I guess somewhere in there are six TMP components on up to six prefabs that have the issue, but I donāt know which ones because itās not pinging a specific GameObject.
Happy to provide more info or even export those prefabs with dependencies if that would help somehow.
Also want to mention that Iāve been using TMP since 2014 and it is probably the most fantastic plugin Iāve ever used ā thank you for elevating all of our projectsā polish so dramatically and for being so responsive in the customer support arena.
Would be great if you could submit a bug report with the included project and steps to reproduce the errors. There is no limit on the project size but if it is too big / becomes inconvenient, you can export those prefab with dependencies and provide those to me here or via private message on the forum. Bug report is always best with the full project. If you go this route, please provide me with the case # as soon as you get from Unity via automatic email reply.
Thank you for the kind words and you are most welcome ![]()
I submitted bug #1202856 with the project attached. I got a Connection Closed error from the bug reporter, so I donāt know whether the upload went through. I thought none of it had gone through so I also submitted #1202858 with a note to give me an upload share, but that one is probably closeable. Let me know if I can be of any other assistance.
Pulling the bug files to see if it all made it through. Download is super slow right now (not sure why). Iāll let you know once I have the file if everything checks out ok in terms of the download.
