Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question What is the correct threshold for bloom?

Discussion in 'General Graphics' started by Magnesium, Mar 13, 2022.

  1. Magnesium

    Magnesium

    Joined:
    Sep 14, 2014
    Posts:
    178
    Hello,

    I'm a little confused about how the threshold parameter of the volume bloom parameter. What is the correct value that i put so that only materials using HDR will react with the volume?

    Thanks
     
  2. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Threshold is really a tweak value not where you properly control it. To properly control it relies on your emissive value in shaders and of course how strong your lights are in the scene and so on. Basically, it's a soft cut off for final tweaking, so there isn't a correct value.

    I recommend building an experiment scene with boxes of varying emission, lights etc to get a proper handle on your look.

    In the old days, pre HDR buffers and linear engines, threshold was simply a measure of how bright the pixel had to be, and with non HDR ranges of before it was much more effective in deciding what would bloom and what would not.

    It still is a threshold value but now the buffer has a lot more information and is directly controlled in your shaders and so on.
     
  3. Magnesium

    Magnesium

    Joined:
    Sep 14, 2014
    Posts:
    178
    What would be the correct way to make that it applies only to materials to using hdr then? Only trial and error?
     
  4. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Which pipeline and so on? If it's HDRP then the template scene will likely have decent defaults. I'm not sure about the URP scene.

    You control it using the emissive output in the master node on shadergraph, or in emission slot.
     
  5. Magnesium

    Magnesium

    Joined:
    Sep 14, 2014
    Posts:
    178
    I'm using URP in a 2d project.
     
  6. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    In that case just still - control it via the material.
     
  7. Magnesium

    Magnesium

    Joined:
    Sep 14, 2014
    Posts:
    178
    I'm sorry i'm not sure what you mean? Here i have a material that uses a color node with HDR to boost the output. It works well, however some bloom also applies on standard sprite lit shader even tough i set the threshold at two.

    upload_2022-3-13_17-26-7.png
     
  8. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Usually boosting the colour value in base color will do it, or if you use a lit variant you can control it with masks. See https://forum.unity.com/threads/how-to-make-a-sprite-glow.840010/#post-5549209 for example.

    I don't work in 2D any more but the principles are the same. The bigger the number in the HDR buffer, the more bloom has to work with, particularly if that value is over 1, although that also brings you into exposure territory and other lit shenanigans you can probably just avoid.
     
  9. Magnesium

    Magnesium

    Joined:
    Sep 14, 2014
    Posts:
    178
    But how do i make it NOT react with bloom? :)
     
  10. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    The mask on the 2D lit shader allows you to make it not react, or react.