Announcement

Collapse
No announcement yet.

Sharp Temporal AA

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • #31
    Originally posted by Chosker View Post
    curious to see what you've made but the attachment isn't working
    Fixed it

    Comment


    • #32
      Originally posted by Chosker View Post
      In the project we have at work (top-down city builder) the ghosting it very extreme from fast camera movements. I think even for third person games it's also not enough
      Here is a demo of the settings above. It's not so easy to see on youtube, but I didn't see any ghosting at all on my screen.

      Comment


      • #33
        Tweaked the code some more. Sharpen set to 0.8 is pretty much the same sharpness as with no AA at all.
        I also updated the blueprint attached to the camera. It sets LastFrameWeight to 0.5 and reduces Sharpen to 0.5 (the higher LastFrameWeight, the less Sharpen we need)

        Here are 3 examples where I move the mouse back and forth with motion blur amount set to 0.1. Quite pleased with the result

        Click image for larger version

Name:	ghosting.png
Views:	2
Size:	593.5 KB
ID:	1132343


        Click image for larger version

Name:	ghosting_bp.png
Views:	1
Size:	166.1 KB
ID:	1132344

        Comment


        • #34
          It is all cute, but
          Code:
          r.TemporalAACurrentFrameWeight
          Re-introduces projection matrix jitter into the image, and at values above 0.1 it is highly noticable.

          Something witty has to be done with history clamping. Has anyone actually tried something in that field? Maybe some sort of clamping algo, that is adaptive to velocity ?

          Comment


          • #35
            Originally posted by Deathrey View Post
            It is all cute, but
            Code:
            r.TemporalAACurrentFrameWeight
            Re-introduces projection matrix jitter into the image, and at values above 0.1 it is highly noticable.

            Something witty has to be done with history clamping. Has anyone actually tried something in that field? Maybe some sort of clamping algo, that is adaptive to velocity ?
            I have almost no jitter with the settings above. But if I set r.TemporalAASamples higher than 4 they start to show.
            Setting r.TemporalAACurrentFrameWeight to 0.2 was originally to avoid ghosting. But with the camera tweak you could possibly get away with setting it to something like 0.1.
            Also it seems motion blur and TAA goes hand in hand. You should probably use different based on motion blur on/off.

            Preferably I would set the TemporalAACurrentFrameWeight per pixel based on it's motion vector. But I have no idea how to start playing around with that.

            Comment


            • #36
              Originally posted by Deathrey View Post
              Something witty has to be done with history clamping. Has anyone actually tried something in that field? Maybe some sort of clamping algo, that is adaptive to velocity ?
              This causes quite a bit of console log spam, but it seems to actually work for third person camera.

              Click image for larger version

Name:	ghosting_lerp.png
Views:	1
Size:	176.3 KB
ID:	1132347

              Comment


              • #37
                With the camera logic I posted above I have tweaked the settings a bit.

                The biggest difference is that the texture sharpness now is exactly the same as with no AA applied. (Compare NO AA vs. these settings: https://imgsli.com/MDU3NQ)
                Here you can compare the default AA's sharpness vs. these settings: https://imgsli.com/MDU3Ng


                And here you can see the temporal stability is maintained.




                New settings

                Code:
                r.TemporalAACurrentFrameWeight 0.1
                r.TemporalAASamples 4
                r.Tonemapper.Sharpen 0.5

                New camera adjustment logic
                I tweaked the blueprint to adjust the settings based on camera movement. Combined with these settings it seems to work very well.

                Click image for larger version

Name:	ghosting_v2_bp.png
Views:	1
Size:	174.3 KB
ID:	1132348

                You can copy & paste this into your blueprint to get the code: https://gist.github.com/hallatore/ce...423b582ae7d48b
                PS: I've set the max FrameWeight to 0.35. This seems to be a good balance between temporal stability and ghosting.
                Last edited by hallatore; 08-12-2017, 12:58 PM.

                Comment


                • #38
                  Originally posted by Deathrey View Post
                  Maybe some sort of clamping algo, that is adaptive to velocity ?
                  But only if you entertain specular aliasing, and some cheeky noise once you turn your camera around :P
                  Sharp and responsive Temporal Anti-Aliasing tips and tricks
                  Pitch-shift source effect (DSP) over the network (VOIP)

                  Comment


                  • #39
                    Well, I'm not a big fan of using Tonemapper sharpen to solve ghosting issues. It introduces artifacting of its own.
                    Tweaking current frame weight based on world speed of the camera might seem situationally useful for certain games. You can also scale final blend by velocity data in the shader.

                    Problem with using reduced samples for TAA, is that at 4 samples, you are just using typical MSAA jitter offset pattern. It reduces TAA effectiveness to some degree as opposed to Halton sequence at 5 samples and above.

                    Improving TAA ,in my view, should be probably separated into two parts. The first part is coming up with better way of history clamping(I believe that I've read somewhere that orienting and stretching neightbour sampling pattern in direction of velocity helps, but haven't tried it.).
                    The second part would be a better solution to calculating velocity offset based on depth difference. Right now the cross pattern with offset of 2 is used used by default. I've actually had some limited success with using a larger SNN filter for that, which blurs the borders of objects more, but results in less overall smearing of multiple layers of moving objects. This one in particular relates to foliage.

                    Comment


                    • #40
                      Originally posted by Deathrey View Post
                      Well, I'm not a big fan of using Tonemapper sharpen to solve ghosting issues. It introduces artifacting of its own.
                      Tweaking current frame weight based on world speed of the camera might seem situationally useful for certain games. You can also scale final blend by velocity data in the shader.

                      Problem with using reduced samples for TAA, is that at 4 samples, you are just using typical MSAA jitter offset pattern. It reduces TAA effectiveness to some degree as opposed to Halton sequence at 5 samples and above.

                      Improving TAA ,in my view, should be probably separated into two parts. The first part is coming up with better way of history clamping(I believe that I've read somewhere that orienting and stretching neightbour sampling pattern in direction of velocity helps, but haven't tried it.).
                      The second part would be a better solution to calculating velocity offset based on depth difference. Right now the cross pattern with offset of 2 is used used by default. I've actually had some limited success with using a larger SNN filter for that, which blurs the borders of objects more, but results in less overall smearing of multiple layers of moving objects. This one in particular relates to foliage.
                      The sharpen is to "re-sharpen" the image since blur is a side effect of TAA.

                      It seems there are two scenarios. With and without motion blur. And I can only seem to produce ghosting with motion blur enabled.
                      The good thing is that it seems without motion blur higher sample count and lower FrameWeight works nicely.

                      So I see it as two separate problems.
                      1. TAA introduces blur. Using sharpen at 0.5 seems to nullify that. (if you sharpen without TAA you would of course over-sharpen the image)
                      2. Camera Motion blur introduces ghosting.

                      Comment


                      • #41
                        [MENTION=34565]hallatore[/MENTION] How well do your settings work when you have SSAO (on lowest quality setting) set to a high intensity? SSAO needs TAA to smooth it out, and all adjustments that make TAA look less blurry always resulted in worse SSAO look for me I think.
                        Easy to use UMG Mini Map on the UE4 Marketplace.
                        Forum thread: https://forums.unrealengine.com/show...-Plug-and-Play

                        Comment


                        • #42
                          Originally posted by John Alcatraz View Post
                          [MENTION=34565]hallatore[/MENTION] How well do your settings work when you have SSAO (on lowest quality setting) set to a high intensity? SSAO needs TAA to smooth it out, and all adjustments that make TAA look less blurry always resulted in worse SSAO look for me I think.
                          I'm a bit late to the party, but I only just came across this thread. The blurry default AA has been bugging me for a while now, but I couldn't find any way to improve it. Until now! It's definitely a trade-off between SSAO quality and Temporal AA sharpness, but the settings from hallatore are a huge improvement for my game. The grainy AO only really stands out on clean surfaces with little to no detail or texture.

                          Comment


                          • #43
                            Originally posted by Efrye View Post
                            I'm a bit late to the party, but I only just came across this thread. The blurry default AA has been bugging me for a while now.
                            I just posted this. Feel free to try it out https://forums.unrealengine.com/show...-AA-sharpening

                            Comment


                            • #44
                              Originally posted by hallatore View Post
                              I just posted this. Feel free to try it out https://forums.unrealengine.com/show...-AA-sharpening
                              That looks pretty promising! I always wondered how other games, even UE4 games, managed to achieve a clean look with temporal AA. It seems a combination of TAA and FXAA delivers some of the best results, but with your tweaks, TAA is already pretty good on it's own. The ghosting reduction blueprint you posted early is working great for me as well. Thanks for sharing all of this!

                              Comment


                              • #45
                                Originally posted by Efrye View Post
                                That looks pretty promising! I always wondered how other games, even UE4 games, managed to achieve a clean look with temporal AA. It seems a combination of TAA and FXAA delivers some of the best results, but with your tweaks, TAA is already pretty good on it's own. The ghosting reduction blueprint you posted early is working great for me as well. Thanks for sharing all of this!
                                I haven't seen games take this approach. Most do TAA and adjust sharpen to a preferred amount. Some add a SMAA or FXAA step afterwards.
                                Mine uses some tricks to undo the blurriness on textures while trying to not sharpen the anti-aliased edges. It also doesn't change anything else as it happens right after TAA, and only when TAA is enabled.

                                Download and test it out! I think it's much better than using r.TonemapperSharpen.

                                Comment

                                Working...
                                X