Literally everything so far, but I will absolutely keep my eyes peeled and report anything back that I see.
Draque
Recent community posts
Ok, I have some significant findings.
1) This is tied to the STMMaskableGraphic class. When I deactivate or remove it, the exception does not appear.
2) As you suspected, this has something to do with a mismatch of the font which is selected in the Inspector properties of the STM object and the font which is assigned via tags. I am not sure what the mismatch is or what makes things compatible. All of the fonts I have created are OTF fonts and are compatible. But I also have some OTF fonts which are NOT compatible, and make the bug happen.
3) After text auto-typing completes, the shadows will vanish. This happens 100% of the time, whether or not compatible fonts are chosen.
3b) Commenting out ShowAllText() on the last line of ReadOutText() corrects this, so ShowAllText() must somehow eliminate the shadow glyphs
3bI) buuuut.... commenting this out also leads to another error entirely being thrown repeatedly (included below)
3c) Calling SkipToEnd() does not activate this bug
4) Dropping text in which does not auto type, but which appears instantly (for instance, editing it through the inspector) makes shadows appear and stay
4b) this is likely because ShowAllText() is not called in this case
EXCEPTION POPPING WHEN ShowAllText() is commented out at the bottom of ReadOutText():
ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
System.Collections.Generic.List`1[T].get_Item (System.Int32 index) (at <cac1dea318b4499fb9eaf77618617c23>:0)
Assets.Scripts.TestActorVoice.CreateGUI () (at Assets/Scripts/Editor/TestActorVoice.cs:38)
System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <cac1dea318b4499fb9eaf77618617c23>:0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <cac1dea318b4499fb9eaf77618617c23>:0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <cac1dea318b4499fb9eaf77618617c23>:0)
UnityEditor.UIElements.DefaultEditorWindowBackend.Invoke (System.String methodName) (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Editor/WindowBackends/DefaultEditorWindowBackend.cs:358)
UnityEditor.RetainedMode:UpdateSchedulers() (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Editor/RetainedMode.cs:55)
Also potentially relevant. This code runs immediately before the new, erroring text is set. I'm free later in the afternoon on Monday if you were interested in doing any kind of screen share to look at code being run on a system where the error is guaranteed to pop.
public void SetSpeed()
{
var multiplier = charConvVoice.GetTextSpeedMultiplier() * ReadSpeedMultiplier;
// invert speed multiplier, then reduce the slope of the curve to get framerate mult
var frameMult = 1 + (1 / multiplier - 1) * 0.4f;
if (charConvShaderAnimation != null)
charConvShaderAnimation.FrameLengthMultiplier = frameMult;
superTextMesh.speedReadScale = multiplier;
if (multiplier == 1 && superTextMesh.isSpeedReading)
superTextMesh.RegularRead();
else if (multiplier != 1 && !superTextMesh.isSpeedReading)
superTextMesh.SpeedRead();
}
Ok, I have found a way to reliably recreate this. It's somehow tied specifically to the STMMaskableGraphic class, as when I disable it on the SuperTextMesh object,the error no longer pops. Here are the steps:
1) Start up a STM instance with the same configuration as I have above (although the Shadow doesn't seem to matter, just the STMMaskableGraphic).
2) Set the text to "<e=excl=open><f=Retron2000Regular>Hi hi!<e=excl=close> So great it is you get to meet great master of trade, Din' K'blapp (THAT'S ME). Gots all my nice stuff an' maybe you help get more?<e=excl=open> Shiny coin for hard workers!<e=excl=close></f>" (obv the font name should be something you've got)
3) Set the text to "<f=Retron2000Regular>TODO</f>"
The exception should then pop. I included the exact strings I used in case they had any effect. The callbacks I have in there only change game speech volume (not for any sounds handled by STM incidentally, so no possibility of interaction there).
I am not sure of all the situations where this can come up, but I hit one just now. There's definitely something fishy going on which you can see in the inspector with the configuration error.
This is in 100% normal gameplay, btw. It's simply setting the text from one thing to another. Here's all the info I can really think to include:
info.Count = 75
Submesh_infoIndex = 167
test set to: "<e=excl=open><f=Retron2000Regular>Sooner you say goodbye, sooner you greet Din\' once again!<e=excl=close><e=excl=open> Smartsmart plan!<e=excl=close></f>"
Relevant stack trace (line counts may be slightly off due to some comments I've added while exploring code):
Void SuperTextMesh:UpdateMaskingOnAllSubmeshes () (/Users/draquethompson/Unity/Transience/Assets/Clavian/SuperTextMesh/Scripts/SuperTextMesh.cs:7473)
Void SuperTextMesh:RecalculateMasking () (/Users/draquethompson/Unity/Transience/Assets/Clavian/SuperTextMesh/Scripts/SuperTextMesh.cs:7457)
Material STMMaskableGraphic:GetModifiedMaterial (Material) (/Users/draquethompson/Unity/Transience/Assets/Clavian/SuperTextMesh/Scripts/STMMaskableGraphic.cs:328)
Material STMMaskableGraphic:GetMaterialForRendering (Int32) (/Users/draquethompson/Unity/Transience/Assets/Clavian/SuperTextMesh/Scripts/STMMaskableGraphic.cs:319)
Void STMMaskableGraphic:UpdateMaterial () (/Users/draquethompson/Unity/Transience/Assets/Clavian/SuperTextMesh/Scripts/STMMaskableGraphic.cs:295)
Void STMMaskableGraphic:OnRebuild () (/Users/draquethompson/Unity/Transience/Assets/Clavian/SuperTextMesh/Scripts/STMMaskableGraphic.cs:228)
Void SuperTextMesh:Rebuild (Single, Boolean, Boolean) (/Users/draquethompson/Unity/Transience/Assets/Clavian/SuperTextMesh/Scripts/SuperTextMesh.cs:1652)
Void SuperTextMesh:InternalRebuild (Single, Boolean, Boolean) (/Users/draquethompson/Unity/Transience/Assets/Clavian/SuperTextMesh/Scripts/SuperTextMesh.cs:1530)
Void SuperTextMesh:set_text (String) (/Users/draquethompson/Unity/Transience/Assets/Clavian/SuperTextMesh/Scripts/SuperTextMesh.cs:257)
Void Assets.Scripts.TypeToTextmesh:TypeText () (/Users/draquethompson/Unity/Transience/Assets/Scripts/UI_Scripts/TypeToTextmesh.cs:383)
Void Assets.Scripts.ConversationUI:UpdateConversation () (/Users/draquethompson/Unity/Transience/Assets/Scripts/UI_Scripts/ConversationUI.cs:436)
Void Assets.Scripts.TransConversationState:ConversationUpdated () (/Users/draquethompson/Unity/Transience/Assets/Scripts/TransConversationState.cs:41)
Void Assets.Scripts.TransConversationState:set_CurrentConversation (TransConversationNode) (/Users/draquethompson/Unity/Transience/Assets/Scripts/TransConversationState.cs:18)
Void Assets.Scripts.ConversationUI:EndCall (Boolean) (/Users/draquethompson/Unity/Transience/Assets/Scripts/UI_Scripts/ConversationUI.cs:401)
Void <>c:<AddOnclickFunctions>b__7_4 () (/Users/draquethompson/Unity/Transience/Assets/Scripts/UI_Scripts/UIControls/ConversationVerticalButtonMenu.cs:20)
Void UnityEngine.Events.InvokableCall:Invoke () (Unknown Source:0)
Void UnityEngine.Events.UnityEvent:Invoke () (Unknown Source:0)
Void Assets.Scripts.FaceButton:MainButtonClick () (/Users/draquethompson/Unity/Transience/Assets/Scripts/UI_Scripts/UIControls/FaceButton.cs:51)
Void Assets.Scripts.FaceButton:<Awake>b__23_0 () (/Users/draquethompson/Unity/Transience/Assets/Scripts/UI_Scripts/UIControls/FaceButton.cs:39)
Void UnityEngine.Events.InvokableCall:Invoke () (Unknown Source:0)
Void UnityEngine.Events.UnityEvent:Invoke () (Unknown Source:0)
Void UnityEngine.UI.Button:Press () (/Users/draquethompson/Unity/Transience/Library/PackageCache/com.unity.ugui@1.0.0/Runtime/UI/Core/Button.cs:70)
Void UnityEngine.UI.Button:OnPointerClick (PointerEventData) (/Users/draquethompson/Unity/Transience/Library/PackageCache/com.unity.ugui@1.0.0/Runtime/UI/Core/Button.cs:114)
Void UnityEngine.EventSystems.ExecuteEvents:Execute (IPointerClickHandler, BaseEventData) (/Users/draquethompson/Unity/Transience/Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/ExecuteEvents.cs:57)
Boolean UnityEngine.EventSystems.ExecuteEvents:Execute (GameObject, BaseEventData, EventFunction`1) (/Users/draquethompson/Unity/Transience/Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/ExecuteEvents.cs:272)
Void UnityEngine.InputSystem.UI.InputSystemUIInputModule:ProcessPointerButton (ButtonState, PointerEventData) (/Users/draquethompson/Unity/Transience/Library/PackageCache/com.unity.inputsystem@1.14.0/InputSystem/Plugins/UI/InputSystemUIInputModule.cs:744)
Void UnityEngine.InputSystem.UI.InputSystemUIInputModule:ProcessPointer (PointerModel) (/Users/draquethompson/Unity/Transience/Library/PackageCache/com.unity.inputsystem@1.14.0/InputSystem/Plugins/UI/InputSystemUIInputModule.cs:489)
Void UnityEngine.InputSystem.UI.InputSystemUIInputModule:Process () (/Users/draquethompson/Unity/Transience/Library/PackageCache/com.unity.inputsystem@1.14.0/InputSystem/Plugins/UI/InputSystemUIInputModule.cs:2431)
Void UnityEngine.EventSystems.EventSystem:Update () (/Users/draquethompson/Unity/Transience/Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/EventSystem.cs:530


Ok, I am having trouble recreating this exact scenario, but the line it happens on appears below. I think this is a super edge case when materials are hot-swapped and the info member of the SuperTextMesh class is not updated in time for the call. If it fails once though, it seems to block the update happening later, as it kills the call from RecalculateMasking() before AppplyMaterials() can be called. I'm not sure whether it would work to simply return from UpdateMaskingOnAllSubmeshes() here, or if that would simply push problems downstream.
As you can see, I have a breakpoint in place here, and the next time it's hit, I will collect any relevant data that I'm able and post here. (also, I only realized as I'm looking at it now that the > should be a >=, but I didn't want to bother replacing the image ^^;).

HOWEVER!!! After messing more with the Rect Support, I realized that its shadow support was its own independent implementation! I had thought it was simply a compatibility layer of some sort. It is working exactly as I was looking for! Thank you for the help there! (Also also, I have found an out of index bug within UpdateMaskingOnAllSubmeshes() that I'm hoping to have a writeup on soon... so apologies in advance for picking on you XD).

Here's a font which I made and which I am positive is vector based rather than bitmap. As you can see, the distortion effect is still going in when I use STM Ultra with shadows. The non-ultra shadows not rendering correctly in URP makes sense as well! The Maskable Graphic / "Enable support Rect..." is a solution that I did already try after searching the forum and seeing it suggested for some other troubles (which *did* help me with stuff I would have otherwise posted about here XD).


Below is what the text looks like with the shaders "STM Dropshadow", "STM UI Dropshadow", "STM Universal Dropshadow", and "STM Unlit Dropshadow", regardless of settings. The shadows themselves are the correct, un-distorted shapes, but the text itself is not rendered. Also included are the settings (unchanged between all of the non-Ultra shaders, though the settings shot was taken specifically from UI Dropshadow)


Below is the distorted version of text when I try to use Ultra with dropshadow. It looks slightly different if I scale with object rather than text, but it is still distorted (same with Vector vs. Angle type for dropshadows). I have tried every combination of Cull Mode, Render On Top, and ZWrite, and the distortions remain.

Heyo! I just upgraded to the latest version of STM, and overall, it's running better than ever at this point! There's one problem that I'm running into now that has me really scratching my head, though. Dropshadow (and outline) do not really function for me at all at this point. Dropping all the details I can think of below. Please let me know if there are any other details I can provide! At this point I am using the URP for all rendering, although I have details/results for multiple different shaders below. The Render Queue setting is nonstandard, but the outcome is the same even when set to 3000, as it typically would be. (I am breaking this into multiple posts because the forum keeps giving me "missing token" errors when I try to post anything larger...)
At the end of the Update() method in the SuperTextMesh class, there's the possibility of a null deref if the rect transform has no parent. I know this is a pretty weird scenario, but it managed to come up in my work, so I thought I would just toss it up here! Including changes for completeness. Also, I wasn't completely sure whether a null value should result in a true or false here for the parent changed flag.
// if(uiMode && (tr.hasChanged || tr.parent.hasChanged)) // ORIGINAL
if (uiMode && (tr.hasChanged || (tr.parent != null && tr.parent.hasChanged))) // DRAQUE
{
if(tr.hasChanged) tr.hasChanged = false;
// if(tr.parent.hasChanged) tr.parent.hasChanged = false; // ORIGINAL
if (tr.parent != null && tr.parent.hasChanged) tr.parent.hasChanged = false; // DRAQUE
//Debug.Log(this.name + " detected OTHER rect change!");
CheckRectChange();
}
I did some heavy lifting tests with it and dug pretty deeply into how it's being called and ran into no issues so far. I think that if anything, it might be possible to be more aggressive with how the contents of _workerMeshes is cleared... but also that doing so wouldn't be necessary unless there was a single object which persisted for very long periods of time and for some reason had insane numbers of meshes generated for it.
The class STMMaskableGraphic creates Mesh objects but never destroys them, and they aren't handled by garbage collection. I'm still on an older version of STM, so I am not sure whether this has been cleaned up already, but it seemed like it's worth reporting.
Since _workerMesh is instantiated on every OnEnable(), I added this to the bottom of the OnDisable() method:
if (_workerMesh != null)
Destroy(_workerMesh);
Since _workerMeshes is only populated and never depopulated (and I don't fully understand the full lifecycle for its contents), I just defaulted to adding the below code on the Unity destructor for the class.
protected override void OnDestroy()
{
base.OnDestroy();
foreach (var mesh in _workerMeshes)
if (mesh != null)
Destroy(mesh);
}
Ahh, I. gotcha! It's not a huge deal for me either way, as I can code around it. I do feel like it might be clearer to eliminate the font close tag entirely if it simply acts as a font change tag. Otherwise I would prefer itpushing/pulling to a stack as the tags open and close though, which would act more like I had initially anticipated.
Thanks for the quick response! ^^
Just wanted to report a bug I've found with nested font tags. I have a screenshot of the effect below with the text that leads to it. If you open one font tag inside another then close the inner font tag, the display font returns to default rather than respecting the font of the enclosing tag.
Let me know if any additional details would be helpful! ^^

<f=Retron2000Regular>Gombön is here to <e=bleepOpen><f=Helpers>fuck</f><e=bleepClose><e=excl=open> you up, baby!<e=excl=close></f>
Heyo! Back with another question for you!
Is there a good/easy way to make SuperTextMesh paint directly to the face of a surface? The reason I would like to do this is because it would allow me to place STM beneath objects which are using clear-glass shaders. As it stands, STM renders as a shader, and when you place one shader beneath another... the first simply vanishes. If I can paint it to an object, this issue should go away.
Any thoughts welcome!
Is it possible to export as a set of png files? If I could export planets as
1) A png that could be applied to a sphere, and
2) A png that represents a bump map
This program would suit my needs more or less perfectly if it could do these two things. Is there any way it can do them now? Or is there any way I could convince you to implement this? It would be a massive help to me, and very appreciated! :3
Ahh, I see! Ok, thank you for the clarification there! And no worries, I am still good to wait. I'm on 2022.3, though depending on how things go, I might end up seeing if it's possible to bump that and move to up to 6. As always, I appreciate all the work you put into this, it continues to kick ass! ^^
Is there anything special I need to do to get Dropshadow to work properly in URP? The documentation has some conflicting info about this (saying it is not quite working in one section, then that it has been fixed in an update note). When I try to use it, the shader appears to be broken both in the Editor and in fully built versions. Not sure if there's any kind of setup that I need to complete before it will act the same way it did before.
As a note, I did just bump my project to using URP due to needed shaders requiring it.






