Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

Bug World space canvas TMPro shimmering with TAA enabled

Discussion in 'UGUI & TextMesh Pro' started by Gooren, Jan 23, 2024.

  1. Gooren

    Gooren

    Joined:
    Nov 20, 2015
    Posts:
    333
    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 :D

    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
    upload_2024-1-23_23-24-19.png

    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?
     

    Attached Files:

    Last edited: Jan 24, 2024
  2. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,937
    Gooren likes this.
  3. Gooren

    Gooren

    Joined:
    Nov 20, 2015
    Posts:
    333
    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?
     
  4. Gooren

    Gooren

    Joined:
    Nov 20, 2015
    Posts:
    333
    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.
     
    Last edited: Jan 24, 2024
  5. Gooren

    Gooren

    Joined:
    Nov 20, 2015
    Posts:
    333
    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.
     
  6. Gooren

    Gooren

    Joined:
    Nov 20, 2015
    Posts:
    333
    theforgot3n1 likes this.
  7. theforgot3n1

    theforgot3n1

    Joined:
    Sep 26, 2018
    Posts:
    216
    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.