World space canvas TMPro shimmering with TAA enabled

Hi,

We have world space terminals/PCs in our game.
These use world space canvas (size set to 1920x1080 and uniform scale 0.0005).

Our TMPro components use the ‘TMP_SDF-HDRP UNLIT’ shader.

The problem is that when player watches the terminal screen from like 2 meters+, the text is shimmering.
See the attached video for a clear demonstration of the shimmering I’m talking about.

This shimmering disappears when I select non-SRP TMPro mobile shader, but that’s not a solution :smile:

This is reproducible both in play mode (game view) and out of play mode in scene view (NOTE: TAA must first be enabled on the scene view camera).

What I tried so far:

  • “Extra Padding” - slightly increases the distance at which the shimmering appears, but doesn’t really solve the problem

  • Rendering the font SDF texture with “SDFAA_Hinted” mode and others - same results as previous point at best

  • Rendering the font SDF texture with various Sampling Point Size and Padding values

  • Using small size world canvas instead of our current Full HD one. Hence scale [1,1,1] can be used. But font size needs to be absurdly small. - doesn’t help with the problem at all

  • Disabling TAA - TMPro looks jagged but the problem disappears. Well… this is not really a solution though.

  • Using different font (Inconsolata instead of Fira Mono) - not much influence

  • Updating TMPro from 3.2.0-pre.4 to 3.2.0-pre.7 - didn’t affect this problem at all unfortunately

  • Changing parent element Z coordinate to bring the text forward a little (just to make sure Z-fighting isn’t the culprit here) - no change, yet again

  • Tweaking TAA on Camera component - this can reduce the shimmering a little, but doesn’t eliminate it completely and extreme values need to be used which “breaks” the TAA in the process

Example Bake Settings

Environment

  • Unity: 2021.3.21f1, 2022.3.18f1
  • Render pipeline: HDRP 12.1.10, HDRP 14.x
  • TMPro: 3.2.0-pre.7

Any ideas @Stephan_B ? Anyone?

9600374--1360931--movie-ezgif.com-video-to-gif-converter.gif

I’m doubtful there’s a real solution for this as the shimmering effect is a side effect of how the technique works, but I did come across an active issue that is related to world space UI text and TAA that has a fix in review for 2023.3.

https://issuetracker.unity3d.com/issues/the-in-game-ui-text-is-blurry-and-shimmering-when-using-anti-aliasing

1 Like

I didn’t find this on my Google adventures!

Well… not sure this will fix the problem in our case, as testing this solution is not easy. Upgrading Unity in our project is very time consuming and just generally dangerous.
I hope we can even update to Unity 2022 where it is supposed to be already fixed according to the issue tracker link you posted.

Anyway, fixing this would be amazing. I will try the update at some point in the future unless I find some nice workaround or something. Thanks for chipping in @Ryiah <3

Perhaps if I could disable TAA using custom pass or something just for the world space UI. And then if it would be possible to use other AA technique for the UI only? Is that even possible?

UPDATE:

I have made a repro project in latest Unity 2022 LTS version (2022.3.18f1).

Unfortunately the issue is still present in this version.

There is a “Free Camera” script on the camera, so feel free to move around. Issue is immediately visible after entering play mode.
Or with scene view camera as well, just make sure TAA and “Always refresh” is enabled on the scene camera.

I used only large text this time, which I can’t usually do in our game (our world space canvas based screens need to fit more than just a few words) - yet the issue is still very visible and just plain immersion breaking on some camera angles/distances.

Tried changing softness and dilation based on camera distance from the text mesh object.

Unfortunately once tweaked, this will still break after player changes his FOV for example. No idea how to mitigate this problem enough so that we can just presume it works well until at least 10m distance for example. After 10m I can just fade out the text for example, whatever.

Bumpity @Stephan_B

Perhaps I’m just fighting the wind mills here.

Last bump @Stephan_B ?

1 Like

I’ll chime in and just ask for some clarification on this issue. Is this something that will be fixed or there will be a workaround for? @Stephan_B

The workaround we are doing is rendering world space separately to avoid it being affected by FXAA, but it’s not ideal!

I understand if it’s too difficult to fix.