Announcement

Collapse
No announcement yet.

Sharp Temporal AA

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

    Sharp Temporal AA

    I tempered with TAA code and managed to make it sharp at the cost of some aliasing. Artefacts (overall blurriness, smearing, ghosting) are reduced, temporal stability kind of looks like with 8xMSAA and specular aliasing is still taken care of. (And all this by only changing one number in code.)

    ...(installation path)/Epic Games/4.14/Engine/Shaders/PostProcessTemporalCommon.usf
    under the 'COMPUTE BLEND AMOUNT' section I changed "BlendFinal = 0.04" to "BlendFinal = 0.25"
    and run the console command "r.TemporalAASamples 2"

    Moving foliage looks a lot better this way and everything is sharper.
    What I still can't find out is how to change the number of frames TAA blends together.
    Last edited by helluvamesh; 01-16-2017, 08:21 AM.

    #2
    Definitely needs some comparison images.

    Comment


      #3
      Originally posted by ZacD View Post
      Definitely needs some comparison images.
      TAA's artefacts are best seen in motion images can't show them.

      Edit: OK, ghosting can be seen in images.
      Last edited by helluvamesh; 01-16-2017, 08:30 AM.

      Comment


        #4
        UE4 TAA use exponential blending so basically number of frame is infinite.(but older frames have infinite small weight.). So there are no simple number of frames control.
        https://de45xmedrsdbp.cloudfront.net...l-59732822.pdf

        Comment


          #5
          Originally posted by helluvamesh View Post
          I tempered with TAA code and managed to make it sharp at the cost of some aliasing. Artefacts (overall blurriness, smearing, ghosting) are reduced, temporal stability kind of looks like with 8xMSAA and specular aliasing is still taken care of. (And all this by only changing one number in code.)

          Moving foliage looks a lot better this way and everything is sharper.
          It sounds awesome, but if you could show some comparison images it would definitely be great! Still images work great for showing how the overall bluriness is reduced. Here I made a comparison between TAA and MSAA:

          TAA: https://puu.sh/rQ6aR/2b88ba58a1.png
          MSAA: https://puu.sh/rQ6a3/c7b9f48965.png

          Even with it being a still image you see how superior MSAA is because you can read the text. So if you could take some images showing the comparison between TAA default and TAA with your change that would be awesome!
          Easy to use UMG Mini Map on the UE4 Marketplace.
          Forum thread: https://forums.unrealengine.com/show...-Plug-and-Play

          Comment


            #6
            Comparison of blurring:
            original:
            Click image for larger version

Name:	TAA_original_3.png
Views:	1
Size:	181.0 KB
ID:	1121585

            edited:
            Click image for larger version

Name:	TAA_edited_3.png
Views:	1
Size:	173.1 KB
ID:	1121586

            Comment


              #7
              EDIT: Certainly looks sharper, but be interesting to see how it behaves with SSR / SSAO etc. I suspect sharper TAA is likely to introduce more AO / SSR artefacts.

              Reducing ghosting is probably the biggest way to improve TAA. Just reading through that presentation, and maybe scaling pixel samples by their scene depth vs current pixel scene depth would be a good way to circumvent that.

              Beyond my expertise though and probably pretty expensive..

              Comment


                #8
                SSAO seems to be fine. As for SSR, well, it doesn't like it. SSR vibrates a bit even when the camera is still, but it depends on resolution. It's not that noticable.
                Last edited by helluvamesh; 01-16-2017, 11:07 AM.

                Comment


                  #9
                  I have tested it now.

                  I noticed that without the change, switching between r.PostProcessAAQuality 3 and 6 did not change anything, so it looked same.
                  With the change, switching between r.PostProcessAAQuality 3 and 6 is a big difference, I think r.PostProcessAAQuality 3 equals how it looks like without the change, so only r.PostProcessAAQuality 6 is affected. Thats a good way to see the difference on-the-fly while being in the game without recompiling that shader.

                  I do not see a difference between r.TemporalAASamples 8 (thats the default I think) and the r.TemporalAASamples 2 you said that should be used.

                  With the change, the TAA is definitely making it less blurry. But there is visible aliasing, and SSAO also becomes a lot more noisy. Still, modifying the BlendFinal allows for fine tuning this quite well. I think with a value of 0.15 I am quite happy. I have tested this in VR, and regarding the blurriness it looks like 10-20% more screen percentage I think. SSAO becomes noisy, but still acceptable with 0.15.

                  So, definitely a very nice change, thanks [MENTION=90958]helluvamesh[/MENTION] for finding that
                  Easy to use UMG Mini Map on the UE4 Marketplace.
                  Forum thread: https://forums.unrealengine.com/show...-Plug-and-Play

                  Comment


                    #10
                    Originally posted by John Alcatraz View Post
                    I have tested it now.


                    I do not see a difference between r.TemporalAASamples 8 (thats the default I think) and the r.TemporalAASamples 2 you said that should be used.
                    With 'r.TemporalAASAmples 8' I can see heavy vibration (when the camera is still) on lengthy thin geometry (window frame) and some on masked materials (foliage), r.TemporalAASamles 2' solves this for me.

                    Comment


                      #11
                      I've just seen that Epic added 3 new console commands for tweaking TAA in 4.15 preview 1 and one of them modifies the BlendFinal: r.TemporalAACurrentFrameWeight. So, now it can be set from within the editor without having to manually change PostProcessTemporalCommon.usf

                      Comment


                        #12
                        Originally posted by helluvamesh View Post
                        I've just seen that Epic added 3 new console commands for tweaking TAA in 4.15 preview 1 and one of them modifies the BlendFinal: r.TemporalAACurrentFrameWeight. So, now it can be set from within the editor without having to manually change PostProcessTemporalCommon.usf
                        Interesting, thanks! So setting r.TemporalAACurrentFrameWeight to 0.25 equals the change you did in the source?
                        Easy to use UMG Mini Map on the UE4 Marketplace.
                        Forum thread: https://forums.unrealengine.com/show...-Plug-and-Play

                        Comment


                          #13
                          Originally posted by John Alcatraz View Post
                          Interesting, thanks! So setting r.TemporalAACurrentFrameWeight to 0.25 equals the change you did in the source?
                          It should. They changed the line "BlendFinal = 0.04" to "BlendFinal = CurrentFrameWeight".

                          There's also 2 more new console commands r.TemporalAAFilterSize and r.TemporalAACatmullRom that I don't know what they do yet.

                          Comment


                            #14
                            Just using r.Tonemapper.Sharpen 1 or 2 also does a surprisingly good job reducing the blurriness without adding any sparkling. We shipped Ripcoil for Oculus using that.
                            Last edited by OwenWP; 01-20-2017, 03:25 PM.

                            Comment


                              #15
                              Originally posted by OwenWP View Post
                              Just using r.Tonemapper.Sharpen 1 or 2 also does a surprisingly good job reducing the blurriness without adding any sparkling. We shipped Ripcoil for Oculus using that.
                              Thanks for mentioning that. I've tested it now and it seems to have roughly the same impact like modifying the BlendFinal variable.

                              In my opinion modifying the BlendFinal variable looks a bit better because it introduces a less noticeable noisiness to the SSAO than the r.Tonemapper.Sharpen.
                              Easy to use UMG Mini Map on the UE4 Marketplace.
                              Forum thread: https://forums.unrealengine.com/show...-Plug-and-Play

                              Comment

                              Working...
                              X