Search Unity

"Trails" when using temporal anti-aliasing

Discussion in 'Image Effects' started by Logopolis, May 26, 2022.

  1. Logopolis

    Logopolis

    Joined:
    Feb 18, 2015
    Posts:
    27
    I'm using the post-processing stack (v2) version 3.2.2 in my jigsaw puzzle game. I've found that its temporal anti-aliasing produces much better results than FXAA or SMAA, except for one major problem.

    When I move an object around in front of a medium-dark background, a "trail" of that object is left behind. See in the below screenshot, the green puzzle piece toward the top-left has just been moved up, and has left behind a trail of dim "stamps" of itself.


    Each "stamp" that makes up the trail does gradually fade away over a fraction of a second, but stops fading before it has disappeared completely. The trail effect can be eliminated by setting "stationary blending" to 0, but doing so is impractical because it causes all stationary objects to have jittery edges.

    Also, in the tests I've run, the trail only seems to appear over objects with a material that uses a normal map.

    Does anyone know how to eliminate this "trail" effect?
     
    Last edited: May 26, 2022
  2. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Have you actually tried FXAA/SMAA and played it at your games' intended resolution, as opposed to just in-editor?

    TAA is a very hacky (and unfortunately, very popular) method of AA, and Unity's default implementation is lacking. Not to say you should get this artifact, but it's not surprising as TAA, by its very nature, uses previous frame data.
     
  3. Logopolis

    Logopolis

    Joined:
    Feb 18, 2015
    Posts:
    27
    Yes, my game has been using SMAA since launch. The results are generally good except for the case of the small gaps between puzzle pieces viewed from a distance. With FXAA and SMAA (since they are just post-processing the image) these thin gaps pop in and out of existence as the view moves, while TAA (being a form of multi-sampling) blends them nicely into barely visible lines:



    Yes -- the previous frames' data appears to be gradually replaced with new data, causing 'trails' to disappear over the course of several frames as they should, *except* when the movement is over a normal mapped surface. This one strange flaw is keeping it from being an ideal solution for my game.