Search Unity

Horrible color banding for lighting & fog

Discussion in 'High Definition Render Pipeline' started by bonickhausen, Jun 15, 2020.

  1. bonickhausen

    bonickhausen

    Joined:
    Jan 20, 2014
    Posts:
    115



    Hi there!

    Why am I getting these horrible color banding artifacts with HDRP?

    I'm using the latest HDRP version from the Package Manager.

    I have literally messed with every single parameter available on my HDRP asset to try and remove these artifacts but no success so far.

    How can I fix this?
     
  2. thornebrandt

    thornebrandt

    Joined:
    Mar 22, 2015
    Posts:
    15
  3. pierred_unity

    pierred_unity

    Unity Technologies

    Joined:
    May 25, 2018
    Posts:
    433
    Hey, a few things to try:
    1. On the camera, enable dithering.
    2. In the HDRP asset, enable FP16 for Color Buffer Format, and also enable higher precision buffers for the color grading, that's Grading LUT Format and Grading LUT Size. This will have a memory cost.
    Also, lower-quality monitors can amplify banding. If you see strong banding in this test (http://www.lagom.nl/lcd-test/gradient.php), then one of the root causes is your monitor/its calibration. Run colorcpl.exe, and check that you don't have some odd color profiles loaded.

    With a higher-end, well-calibrated monitor, you should get near-zero banding on the image gradient below.

    gradient-h.png


    If after all these steps, you still encounter banding and you are certain the issue doesn't come from the monitor, please file a bug, with a repro scene.

    As you can see here, it is possible to get zero banding in HDRP with volumetric fog with the settings above (#1 and #2): https://forum.unity.com/threads/vol...ultiplier-caps-out-at-16.916547/#post-6019913
     
    lacas8282, olavrv, marcospgp and 2 others like this.
  4. bonickhausen

    bonickhausen

    Joined:
    Jan 20, 2014
    Posts:
    115
    The Color Buffer format did it for me. Thank you for your help, Pierred!
     
  5. thornebrandt

    thornebrandt

    Joined:
    Mar 22, 2015
    Posts:
    15
    These both worked for me. In my case, dithering was enough to smooth the banding. Thanks!
     
    lacas8282 and marcospgp like this.
  6. SniperED007

    SniperED007

    Joined:
    Sep 29, 2013
    Posts:
    345
    @pierred_unity
    I have the same issue but in the URP (Unity 2021.2) but can't find the "enable FP16 for Color Buffer Format" setting, is it possible in URP?
     
    Last edited: Jan 16, 2022
    GDevTeam, KarlKarl2000 and JamesArndt like this.
  7. theghostronaut

    theghostronaut

    Joined:
    Jul 27, 2018
    Posts:
    41
    GDevTeam and JamesArndt like this.
  8. KarlKarl2000

    KarlKarl2000

    Joined:
    Jan 25, 2016
    Posts:
    606
    @pierred_unity
    @pierred_unity
    I'm also having this banding issue with URP. Do you have any suggestion for us URP users?
    Thanks for your help

    upload_2022-8-29_18-5-5.png
    upload_2022-8-29_18-5-20.png
     
    GDevTeam likes this.
  9. SniperED007

    SniperED007

    Joined:
    Sep 29, 2013
    Posts:
    345
    @KarlKarl2000 it's worth logging this as a bug or re-positing this in the URP forums.
     
    GDevTeam and KarlKarl2000 like this.
  10. Neonage

    Neonage

    Joined:
    May 22, 2020
    Posts:
    287
  11. Zarod

    Zarod

    Joined:
    Jan 20, 2016
    Posts:
    60
    I am sorry to necro-post. but this bug has nothing to do with LUT or postprocessing.

    The banding is simply dictated by the format of the Camera Texture ... i fixed the banding by changing it from UNFRM to SGRB

    ( 8 bit precision is fine in my case, i am targeting hardware that can't tell the difference)

    hope this helps
     
  12. andrew-lukasik

    andrew-lukasik

    Joined:
    Jan 31, 2013
    Posts:
    249
    URP enjoyer here. I fixed both my color texture banding and post-processing - related color banding by following these steps:
    sources:
    https://docs.unity3d.com/Packages/c...l@15.0/manual/post-processing/hdr-output.html
    https://docs.unity3d.com/Manual/HDR.html
    https://catlikecoding.com/unity/tutorials/custom-srp/color-grading/
     
    Last edited: Sep 1, 2023
    abegue, James_Arndt and SniperED007 like this.
  13. SniperED007

    SniperED007

    Joined:
    Sep 29, 2013
    Posts:
    345
    andrew-lukasik likes this.
  14. marcospgp

    marcospgp

    Joined:
    Jun 11, 2018
    Posts:
    194
    I'm using URP, but these did not make a substantial difference for me - and the HDR grading mode did not work (a warning showed up next to it when I checked that option, likely because my monitor does not support HDR rendering).

    The previously mentioned "enable dithering" setting in the camera inspector is what fixed it for me.
     
  15. captain_blah

    captain_blah

    Joined:
    Jul 10, 2013
    Posts:
    2
    @theghostronaut
    @KarlKarl2000
    @SniperED007
    I fixed my banding issue with URP by changing the HDR COLOR BUFFER PRECISION to 64Bits (instead of 32Bits)
    To find this setting you need to be in 'Debug' mode in the inspector.
    To enter Debug mode, click the 3 dots at the top left of the inspector pane (next to the padlock) and click 'Debug'.
    Next, open your URP Asset, and in my version (2022.3.8f1) the HDR Color Buffer Precision is the 16th item in the inspector. Simply change this drop-down value to 64Bits.

    I really think that such an important setting should be Serialized.
    I hope this helps somebody :)

    debug-mode-inspector.png

    hdr-color-buffer-precision.png
     
    lisamanikhina, Kukikuu and Timten like this.
  16. Timten

    Timten

    Joined:
    Nov 11, 2017
    Posts:
    13
    Thanks a lot! This solves the problem.

    I wonder why Unity not public this setting. How do other people solve this issue? Every URP project will meet the color banding problem. Is it just because not obvious enough so nobody cares?
     
  17. mgeorgedeveloper

    mgeorgedeveloper

    Joined:
    Jul 10, 2012
    Posts:
    326
    Not sure but maybe this is a bad idea due to extra memory allocation? Did you check in memory profiler to see how much memory this buffer is eating at high res like running 4K?
     
  18. wwWwwwW1

    wwWwwwW1

    Joined:
    Oct 31, 2021
    Posts:
    769
    Seems that the HDR precision property is already exposed in URP 14.
     
  19. KLGames8207

    KLGames8207

    Joined:
    Nov 13, 2023
    Posts:
    23
    "In the HDRP asset, enable FP16 for Color Buffer Format, and also enable higher precision buffers for the color grading, that's Grading LUT Format and Grading LUT Size. This will have a memory cost."

    Where is this option in HDRP? Cannot find it.
    Only:

    R16G16B16A16 and
    R11G11B10
     
  20. m0nsky

    m0nsky

    Joined:
    Dec 9, 2015
    Posts:
    257
    R16G16B16A16 = FP16, for example, R16G16B16A16_SFloat (64-bit) uses a 16-bit float for every (R + G + B + A) channel. (more info here)
     
    KLGames8207 likes this.