Search Unity

Bug UI does not have motion vectors for TAA

Discussion in 'High Definition Render Pipeline' started by olavrv, Sep 22, 2020.

  1. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    515
    UI does not have motion vectors for TAA
     
  2. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    934
    Hi, sorry but it lack a bit of detail :), you should be more explicit about what you are trying to achieve.

    Given the few information I expect you have a moving / dynamic UI and you expect it to be antialiasing. As you expect it is before TAA, it mean it is a world UI? Hard to provide more help.
     
  3. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    515
    Sorry for so little details. Yes, we have UI in moving vehicles, and we are using TAA.

    Any input on this issue is appreciated.
     
  4. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,136
    Hi, just encountered this in the new cinematic template for HDRP in unity hub 3.0 for 2021.2.2.
    In the end of the animation, there's an animated credit UI/UGUI. It's quite hard to read with TAA as it doesn't seem to provide motion vectors based on motion vector debugger.

    With TAA:
    T2GUJDZ62t.gif

    Without TAA (using FXAA):
    EtuRENaB9n.gif

    UI:
    upload_2021-11-30_1-4-58.png
     

    Attached Files:

  5. HIBIKI_entertainment

    HIBIKI_entertainment

    Joined:
    Dec 4, 2018
    Posts:
    595
    oh, nice to see the Mich-L demo getting some TLC and a default template.

    if I recall Screen spaced render targets for UI works with TAA, but world Space UI has the same motion issues mentioned above.
     
  6. nehvaleem

    nehvaleem

    Joined:
    Dec 13, 2012
    Posts:
    437
    Really interested about this one as well
     
  7. eggsamurai

    eggsamurai

    Joined:
    Oct 10, 2015
    Posts:
    115
    force _stencilref to 0 is my current solution
     
  8. illinar

    illinar

    Joined:
    Apr 6, 2011
    Posts:
    863
    Hello. I currently have a world space UI in VR, and the UI is very blurry in HDRP with DLSS (which I rely on) or TAA (for older GPUs). Also when I put my fingers through the buttons it distorts the ui with the motion vectors from the fingers making it appear a bit like warping water surface. I can imagine some worse artifacts when there are fast moving objects behind the UI.

    In VR UI every pixel counts, so not having those artifacts and improving clarity would mean a lot.

    So just want to give my feedback and let you know that at least for people with similar projects it is a needed feature.
     
  9. eggsamurai

    eggsamurai

    Joined:
    Oct 10, 2015
    Posts:
    115
    I think you should use msaa for VR always... and increase resolution

    if you have to stick to taa (really bad for vr in my opinion)
    you may try:
    after posteffect or customPass + override depth with after posteffect

    and

    Ask your programmer to :
    change stencilRef to notaa
    and fix the HDRP jitter bug according to :https://github.com/Unity-Technologies/Graphics/commit/0d9cb812c9dc8f13d13e117217eb37d55bc2759f
     
  10. merpheus

    merpheus

    Joined:
    Mar 5, 2013
    Posts:
    202
    This was exactly the behavior I was getting on screen space camera UI. I'll try this suggestion as well.
     
  11. illinar

    illinar

    Joined:
    Apr 6, 2011
    Posts:
    863
    I have to use HDRP, I'll take blur over flicker and aliasing. So there is no MSAA in defered. And SMAA has too many artifacts and I might need DLSS anyway for performance.

    This won't help. There is no artificial jitter on the VR camera, it's natural tracking jitter.

    I have NGUI, I might give that a go. It supports normal PBR materials and will behave like other materials in the scene. The link you gave me made me think about the fact that UI is not getting the post processing and that is not the behaviour I want. I'd want it to be more grounded in the world and maybe even getting some lighting anyway.
     
    Last edited: Jan 2, 2022
  12. Gooren

    Gooren

    Joined:
    Nov 20, 2015
    Posts:
    332
    Oh god this is still a thing :(

    Canvas renderer just doesn't output motion vectors when used on world space uGUI objects no matter what shader I use ("HDRP/Unlit" for example).

    This is not a problem if your UI elements are static. But as soon as any of them move... oh boy.
    Same problem with TextMeshPro UGUI component.
     
  13. antoinel_unity

    antoinel_unity

    Unity Technologies

    Joined:
    Jan 7, 2019
    Posts:
    265
    Hello,

    FYI, we'll add an option in Unity 6 to output motion vectors from the UI, it's only available for UI created through the canvas ShaderGraph though but it should solve the ghosting issues you're experiencing with UI
     
    olavrv and Gooren like this.
  14. Gooren

    Gooren

    Joined:
    Nov 20, 2015
    Posts:
    332
    Nice! Thanks for intel.

    This will possibly be useful for our next project then, since the current project is way too big to migrate from Unity 2021 to 6.

    No chance of backporting this to 2022?
     
    olavrv likes this.
  15. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    515
    We did a temp fix which works really well, use a unlit transparent shadergraph and plug in the font atlas in alpha (see ref. image). Then enable transparent write motions vectors on corresponding materla. Use this material in your text mesh pro component. Don't know if this suit your case, but if so - fantastic!
     

    Attached Files:

    Gooren and antoinel_unity like this.
  16. antoinel_unity

    antoinel_unity

    Unity Technologies

    Joined:
    Jan 7, 2019
    Posts:
    265
    ShaderGraph for Canvas doesn't exist in Unity 2022 so we'll not backport this fix