1. We've introduced thread tags, search within a thread and similar thread search. Read more here.
    Dismiss Notice
  2. Learn how you'll soon be able to publish your games to China in four simple steps with Xiaomi. Sign up now for early access.
    Dismiss Notice
  3. Get further faster with the Unity Plus Accelerator Pack, free for new Unity Plus subscribers for a limited time. Click here for more details.
    Dismiss Notice
  4. We've released our first Timeline Experimental Preview, our new tool for creating cutscenes and more! To check it out click here.
    Dismiss Notice
  5. Unity 5.5 is now released.
    Dismiss Notice
  6. Check out all the fixes for 5.5 in patch releases 1 & 2.
    Dismiss Notice
  7. Unity 5.6 beta is now available for download.
    Dismiss Notice

Temporal Anti-Aliasing

Discussion in 'Image Effects' started by Tim-C, Jun 21, 2016.

  1. Panokani

    Panokani

    Unity Technologies

    Joined:
    Jun 6, 2013
    Posts:
    12
    Hi there!

    I am afraid this is actually the case.

    It's very hard to tell what's going on in this scene from the video and the screenshots you have provided. Would it be possible for you to provide a simple, shaven repro for us to take a look at? Right now we have no idea what's your pipeline like and how is it set up.

    To the contrary, so far our empirical evidence shows that TAA is vastly superior in comparison to SMAA we have had. Your screenshots clearly show artifacts that are not expected behavior of TAA. I am thinking the devil is in the detail. However, without a repro case it's hard to tell what's going on.
     
  2. Panokani

    Panokani

    Unity Technologies

    Joined:
    Jun 6, 2013
    Posts:
    12
    Hey there,

    Unity's TAA is not based off of Playdead's implementation. In fact our current one on the stack is our own original research. That said we did make use of Playdead's AABB intersection function and their projection matrix calculation code, which we are very thankful for.

    Our implementation uses Unity's own motion buffer and doesn't require any sort of velocity buffer tagging. I am afraid your problem is quite irrelevant.
     
  3. jvo3dc

    jvo3dc

    Joined:
    Oct 11, 2013
    Posts:
    729
    Ah, of course, I forgot about that. Then it is indeed not the same issue. (Unless the Unity motion buffer is based on the TAA velocity buffer from Playdead ;-) )

    I actually changed some of the projection matrix calculations to enable VR support. And the velocity shader for moving objects of course. Oh, and I added a simple tonemapper to do the blending more on the final result than on the original linear data.
     
  4. Panokani

    Panokani

    Unity Technologies

    Joined:
    Jun 6, 2013
    Posts:
    12
    It's not.
     
  5. dadude123

    dadude123

    Joined:
    Feb 26, 2014
    Posts:
    126
    Hey, I'll try to prepare a unity project for you guys.
    I'll try to make it as small as possible while still maintaining the problem, I'll report back soon.
     
  6. dadude123

    dadude123

    Joined:
    Feb 26, 2014
    Posts:
    126
  7. Panokani

    Panokani

    Unity Technologies

    Joined:
    Jun 6, 2013
    Posts:
    12
    Hey dadude123,

    I downloaded the scene, and I couldn't reproduce your problem.

    I noticed that the blending factors for TAA are both 1 and tweaked them a little, and dropped the spread quite a lot (we usually keep this one low). The result is that it looks much smoother than SMAA, however the super tiny UI element that moves rather fast loses quite some detail (same with SMAA as well). This happens since all AA algorithms try to smooth out jaggies, and ~1 pixel width text on a contrasting background is the perfect example for a jaggy.

    Usually in games the UI is composited on top of the render after post-processing has been performed, and is not part of the post-processed framebuffer.

    Have you tried tweaking the parameters to see what happens?
     
  8. dadude123

    dadude123

    Joined:
    Feb 26, 2014
    Posts:
    126

    Here's what I get from the demo scene:
    TAA off: http://i.imgur.com/AgSXW5X.png
    TAA on (with settings like in the scene i uploaded): http://i.imgur.com/BgvUaZf.png


    TAA on (spread=0.38, stationary=0.75, motion=0.75, sharpen=0): http://i.imgur.com/Zt1vmTk.png

    That's a more than "a little detail" thats los imho :)
    I changed the settings until the top edge of the wall was almost smooth. But I couldn't get it any smoother than this - which is objectively worse than SMAA.

    Can you please show me some screenshots how this looks for you with different settings? Maybe there's some bug on my computer where it does the inverse (ignoring the edges)
    Since you coulnd't reproduce my problem, could 1. you show me how things look for you? and 2. what TAA settings you'd use for the best possible quality in that demo scene.

    The thing that really surprises me is that in my last screenshot you can clearly see that the text and grass are overly blurred, while the top of the wall (wall - sky edge) isn't antialiased at all. Is that not a problem with your settings?

    Do you at least agree that something in my screenshots seems to be wrong?
    Do you get different results??
     
    Last edited: Jan 26, 2017
  9. Panokani

    Panokani

    Unity Technologies

    Joined:
    Jun 6, 2013
    Posts:
    12
    Hey again!

    Yes, I get completely different results.
    Here's what I get with no antialiasing:
    [​IMG]
    Here's what I get with SMAA:
    [​IMG]
    And here's what I get with TAA:
    [​IMG]

    With SMAA, notice the missing aliased edges on the grass blades. It does a good job of antialiasing at sharp and contrasting edges. This problem isn't there with TAA; however with high frequency and noisy aliasing like with foliage, TAA tends to smudge and ghost things. Unfortunately, it's implicit to the nature of the algorithm. That said, I am not getting anything like your screenshots, and I could up the spread all the way to 1.
     
  10. dadude123

    dadude123

    Joined:
    Feb 26, 2014
    Posts:
    126
    Ok, wow, that is surprising.
    The top edge of the wall is perfectly smooth in your TAA screenshot. Almost indistinguishable from the SMAA.
    Indeed TAA looks completely different for you...


    Now what could possibly be the reason that our results differ so much?
    I mean I have a hard time finding any TAA settings that could even come close to what your screenshots look like.

    Could it be some driver issue? ( GTX970 Driver: 376.33 )
    Maybe I have an outdated version of tha AA shader? This is the right link, isn't it: https://github.com/Unity-Technologies/PostProcessing ?

    And I assume you didn't change any other quality settings, so I honestly have no idea whats going on.
    Any guesses? Should I just use SMAA until the github repo is updated with whatever you guys are working on?
     
  11. Panokani

    Panokani

    Unity Technologies

    Joined:
    Jun 6, 2013
    Posts:
    12
    Try these settings for a change:
    Spread: 0.92
    Stationary blending: 0.88
    Motion blending: 0.58
    Sharpen: 0.3

    Also, I noticed you have MSAA on, please disable that as well.

    I doubt it, I used to develop on a GTX970 myself.

    I checked this and your version isn't that outdated, no major changes to TAA for quite some time. In fact I used your own project to produce the screenshots.

    Nothing changed in quality settings. We're not working on any major changes to TAA, the one in the repository is final. We'll try to figure out what you're experiencing and get back to you. In the meantime can you try again with MSAA disabled?
     
  12. dadude123

    dadude123

    Joined:
    Feb 26, 2014
    Posts:
    126
    I disabled MSAA in the quality options but it didn't make any difference at all. After that I enabled it and then a warning appeared in the TAA settings "taa might not work correctly while msaa is active", which wasn't there before.
    Pretty sure that the camera being set to deferred rendering seems to have disabled it anyway so far...

    The settings you gave still suffer from the same problem: non-edges get too blurry; sharp edges only get smoothed a little bit. (And everything that gets smoothed still isn't as smooth as with SMAA)

    I don't know about you but the difference in the screenshots I made and the ones you made are too big to not be a bug (even when I compare against the ones I just made with your new settings).

    Maybe I can try on another computer today or tomorrow - I'll report back when I have more information.
    Hopefully a completely new/different setup will give better results.

    edit: In your screenshots the moving panel+text is not visible.
    Does TAA give you same terrible "ghosting" on it? (And if not the same, then how much? none at all?)
     
  13. dadude123

    dadude123

    Joined:
    Feb 26, 2014
    Posts:
    126
    Just tested some more and figured something out.
    When you have a solid material, then a worldspace UI + Text the ghosting is not as bad as when you have either the skybox or something transparent (Grass or Tree-Billboards) in the background.

    Something about having transparent things and then UI ontop of it makes the TAA flip out when stationary blending is 0.9 or higher.

    Still doesn't explain the bad quality on the edges, but maybe its a start for you.
     
  14. Panokani

    Panokani

    Unity Technologies

    Joined:
    Jun 6, 2013
    Posts:
    12
    I think we're onto something here. Looks like it's an AO issue caused specifically on 5.5. I myself am running a later version internally from trunk, so that's why I never noticed it.

    Disabling and re-enabling AO should fix it for some weird reason.
    We're looking into the root cause, but it seems to be fixed in 5.6.
     
    elbows likes this.
  15. Chman

    Chman

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    697
    So it turns out it's not related to AO and whatever is causing this isn't fixed in 5.6. In the meantime, disabling/enabling TAA or AO or any object on the scene should fix it until the next run. Note that it only seems to happen in the editor.

    @dadude123 Could you please fill a bug about this issue so we can track it ? Thanks !
     
  16. dadude123

    dadude123

    Joined:
    Feb 26, 2014
    Posts:
    126
    Created #79
     
  17. Flurgle

    Flurgle

    Joined:
    May 16, 2016
    Posts:
    165
    Tested it out, looks promising

    @Tim-C I'd love to see a few TXAA component settings screenshots (or have people share them) with environment label (like outdoors wilderness forest, grassland / mountain, cavernous area, Sci fi corridor, etc).
     
  18. DanTreble

    DanTreble

    Joined:
    Aug 31, 2010
    Posts:
    573
    We just updated to the latest commit (using 5.5.1p4) and are still getting really bad jittering on transparent objects unless removing [ImageEffectOpaque] from the effect. Are there any solutions to this at the moment?
     
  19. topofsteel

    topofsteel

    Joined:
    Dec 2, 2011
    Posts:
    855
    I'm testing this out again for a new project. It's come a long way since it was first released. I'm getting fantastic results at run time, but some odd artifacts in the editor. I have not spent a great deal of time debugging it, starting here. Thanks.

    temporal_01.png temporal_02.png
     
  20. Xel_Naga

    Xel_Naga

    Joined:
    Oct 21, 2015
    Posts:
    25
    For VR it's still not working?
     
  21. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    18,524
    Gonna hazard a guess that the team is busy researching solutions and trying to grow fruit upside down*.





    *you never know what Unity devs get up to really
     
  22. Kalata8662

    Kalata8662

    Joined:
    Feb 7, 2017
    Posts:
    40
    Hey, I tried the temporal antialiasing and it works perfect in the editor. I tried to export to web GL thought, and in the browser it is all black. Is support for Web GL planned at all and when it can be expected? Thank you.