Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Outline glitching / Text redraw every time the camera moves

A topic by Kazzter created Nov 25, 2024 Views: 347 Replies: 10
Viewing posts 1 to 5

Hi, I'm having the two following issues with SuperTextMesh:

1. I have a dialogue box using YarnSpinner and SuperTextMesh together that stays in the same place in the world when the camera moves. However, when I move the camera every so slightly, and the dialogue box moves, the text is redrawn. The same thing doesn't happen when I use TextMeshPro, however.

Is there a way to not have the text be redrawn every time the camera moves? Here's some footage of the issue:



2. When I use outlines in the UI, it has a bunch of strange glitches all around it. It doesn't happen every time the text is drawn, but it is present on both editor and build.



Here's how the text is configured:



Developer

1. Have you updated to the latest version? I changed some things related to the text mesh automatically redrawing when the RectTransform is changed in a recent version, so I'm wondering if this is a side-effect... does disabling "autoRead" (under the timing foldout) produce a differet result?


2. At first it looks like just how the Universal outline shader renders when the outline width is too far, (that shader only does an 8-pass outline) but the outline being thinner than the text on that shader is something I haven't seen... What version of Unity is this? Additionally, try out the "Ultra" shader, that's where I've been putting more work into prettier outlines, recently!

1. Yes, the plugin is updated to the latest version (1.13.5). Unfortunately without autoRead enabled the text is not displayed inside the dialogue box at all.

2. The version is 2022.3.45f1, I tried changing to the Ultra shader, and it seems it does fix my issue, thanks!

Developer

1. Ah I meant, try manually calling Read() or Rebuild(true) when updating text in your code! Also I forgot to ask, is this happening only in editor, or does it still happen in a build? There's unique behaviour for changing the rectTransform in the editor that causes a rebuild... but it shouldn't happen when the game is playing, which would be the bug. I'll take a look at it soon!


2. Ok I'm glad the ultra shader works here! It's eventually going to replace the other shaders anyway, so I'll accept it as a fix.

1. Yes, those solutions were attempted, but unfortunately it did nothing to help fix the issue. It happens both on editor and in the build.

Developer

Ok, I'll be able to give it a look, soon! I've been really busy with the holidays coming up, but I just want to let you know this is on my to-do list!

Developer

Ok, I'm giving this a shot in Unity 2022 and I still can't seem to replicate it... Is your text box using Unity UI or not? I did notice that resizing the rectTransform for UI text can cause a redraw if "rememberReadPosition" is unchecked, could anything be resizing that box for you as the camera moves...? 

Sorry for the veeery delayed response, but no, the rectTransform stays the same as the camera moves.

Developer

All good! I'm still unfortunately not able to reproduce this...

Could I get a screenshot of your inspector for the reading text? The one you shared was just for the outline, I'd like to see your settings on the reading one.

Additionally, would it be possible for you to set up a test event for me? I've got an "OnRebuildEvent" under the "Events" tab, and if you could make that call a debug and then show me the entire debug message, that would tell me exactly the cause of the redraw!

Hi, sorry for reviving this old post, just wanted to update in case anyone else had this issue, but I got the solution from reading one of the dev's responses, the issue was that "Remember Read Position" was actually unchecked, and checking the box solved the issue for me.

As for the outline issue, I solved it by using a different material for the outline. Thanks for the dev for helping me solve this.

Developer

Oh that's a relief to hear actually... I was reviewing my to-do list and realized this was left unanswered, so... I actually went in and added some optimization to the OnRectTransformDimensionsChanged() callback over the weekend. So now it only calls Rebuild() when it absolutely needs to (much less intensive to check for this change than just go through with it, turns out...) and I added a toggle to completely disable the callback in case this situation arises again. (Or I guess Remember Read Position can be left unchecked now if this extra boolean is enabled!)

That should be out in the next update, just making sure other fixes work before publishing it.


Additionally, since we last talked, an update came out that allows Unity's "Outline" component to be used with STM with the new STMMaskableGraphic component, and the Ultra shader is even better now! (One bugfix for the Ultra shader is in the next update coming out, but you'll get 100 points if you manage to figure out the condition that causes the bug I fixed to appear in the first place)