Search Unity

Question URP bloom post-processing is flickering

Discussion in 'Universal Render Pipeline' started by Long2904, Aug 3, 2022.

  1. Long2904

    Long2904

    Joined:
    May 13, 2019
    Posts:
    81
    I'm using Unity 2020.3.12f1 and URP 10.5.1. I've experienced flickering in bloom post-processing effect.

    Here's a Full HD video. The top sprites are just standard sprite renderers with the same sprite, the right one uses a sub-pixel shader to make it less flickering. The two bottom windows have a shader that generates random pixels while the right one has an additional sub-pixel part in the shader graph but still flickering as much as the other one. If you look closely, you will see when the camera slows down and stop (I'm using SmoothDamp), it will get flickery.

    I've tried so many different solutions on the internet: toggling the "Stop NaN" on the camera; changing the Anti Aliasing (MSAA), HDR, Render Scale, and Grading Mode in the URP asset; updating to the latest Unity and URP version (2020.3.37f1 and 10.10.0) but nothing worked. The only thing that works so far is increasing the game view's resolution. Here's it at 4K. Rendering the game at 4K isn't ideal so does anyone know any way to fix this?
     
  2. Stepan_33

    Stepan_33

    Joined:
    Nov 21, 2022
    Posts:
    26
    Perhaps you have already found a solution can you share it?
     
  3. Long2904

    Long2904

    Joined:
    May 13, 2019
    Posts:
    81
    The flickering bloom bug happens because Unity URP's bloom effect works on a half resolution. Increasing it to full-res by changing these 2 lines to
    Code (CSharp):
    1. int tw = m_Descriptor.width;
    2. int th = m_Descriptor.height;
    and changing the UniversalRenderPipelineAsset.renderScale to 1.5 fixes the problem.
     

    Attached Files:

    Last edited: Aug 18, 2023
    Aletuno likes this.
  4. mat108

    mat108

    Joined:
    Aug 24, 2018
    Posts:
    131
    Would you mind sharing where I have to edit those two lines? Isn't that kind of an important detail? I also don't have those options in URP 10.0.0
     
  5. Long2904

    Long2904

    Joined:
    May 13, 2019
    Posts:
    81
    There's a link embedded in the "changing these 2 lines" in my post. It's the Renderer2D.cs file in your package cache (you might want a local copy of the package cache since you want the changes to be permanent).
     
    Last edited: Oct 30, 2023
  6. Aletuno

    Aletuno

    Joined:
    Jan 25, 2021
    Posts:
    1
    Thanks, this works! Didnt knew the render scale was half for PostProcessing Effects. makes sense to make it more smooth, but really screws you over when your effect sources are only one pixel size. My pixel art lights now look crisp!