Search Unity

Question Refraction + Smoothness + TAA = too much flickering

Discussion in 'High Definition Render Pipeline' started by Passeridae, Apr 13, 2021.

  1. Passeridae

    Passeridae

    Joined:
    Jun 16, 2019
    Posts:
    395
    Hi!
    I have a flickering problem when I combine refraction and smoothness on the glass material of the window:

    Window geometry has relatively small hard-surface details with bright edges which makes it a hard case for TAA already, but without refraction enabled there's almost no flickering with TAA on high settings.
    Also, without refraction, any smoothness value has no impact. But once I enable any type of refraction with basically any settings related to it (IOR, distance, thickness) this flickering of window planks is drastically exacerbated and TAA can no longer fight it, even with the anti-flickering option maxed out. Any transparency-related option of the material has no impact on this situation.

    I thought, maybe I can add this blur-ish look through the custom pass which will be set to "after post-process" so I could exclude this from TAA affecting it, but I can't get it working correctly. If someone knows the workaround for this type of problem, I would really appreciate your help.
     
    GoGoGadget and Lex4art like this.
  2. pierred_unity

    pierred_unity

    Unity Technologies

    Joined:
    May 25, 2018
    Posts:
    433
    Hey, you're using the scene view to review the TAA: it is not using the same TAA settings as your camera object's. I'd really suggest you review the TAA in playmode through an actual camera, not the scene view.
     
  3. Passeridae

    Passeridae

    Joined:
    Jun 16, 2019
    Posts:
    395
    I understand, and this is the first thing I've checked. Unfortunately, the playmode version of TAA (with anti-flickering maxed out, as I've said) can't handle this as well. The effect is a bit less noticeable, yes, but is still there and quite distracting in comparison to the rest of the scene which is anti-aliased really great. Moreover, when you move further away from this window (and it takes less and less portion of your frame) the flickering gets worse and becomes more aggressive and there's no way you won't notice it.

    Also, it seems like it flickers more when it's in the center of the frame and less (or not at all) when it's closer to the frames' border.
     
  4. francescoc_unity

    francescoc_unity

    Unity Technologies

    Joined:
    Sep 19, 2018
    Posts:
    193
    It might be something related to how the refraction samples previous frame data which is not de-jittered/anti-aliased. Not sure if we can do something about it, but I guess if you can please file a bug we can at least investigate this properly.

    To confirm, if you don't have refraction but a similar looking thing, it is all fine, right?

    Thank you!
     
  5. Passeridae

    Passeridae

    Joined:
    Jun 16, 2019
    Posts:
    395
    Yes, if I disable refraction everything is fine. But, as I've mentioned, smoothness value has no impact without refraction. If I make all objects behind and in front of the glass dark it goes away too.
    And it's not specifically my case. For example here's some random tutorial that uses refraction + smoothness values as well:

    You can notice the same flickering effect on the specular highlights of the ball behind the glass plane.

    So, you basically can't place anything bright on any side of the objects with refraction enabled unless you want to get this flickering effect.

    I've filed the bug report.
     
    Last edited: Apr 14, 2021
    ebaender, nehvaleem and Lex4art like this.
  6. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932
    2023.1.5f1 seeing the same issue. Fireflies and flickering for refractive glass that has light colored materials visible behind the glass. I'm noticing the effect when using the HDRP sample materials from the Package Manager. This seems to happen with TAA enabled on the camera, but not with SMAA enabled.
     
    Gooren likes this.