Search Unity

Problem with making 2D sprites glow with Bloom

Discussion in 'Shaders' started by MrDasix, Jan 27, 2020.

  1. MrDasix

    MrDasix

    Joined:
    Feb 15, 2015
    Posts:
    64
    Hi, as the title says i'm having problems to make the sprites glow with the bloom post processing effect. The main problem that i'm having is that i have a 2D white sprite with the Sprites Default Material that when i add bloom to the scene it starts glowing. And what i want is to make others sprites glow (like the bullets) and the player stay without glow.

    upload_2020-1-27_18-6-18.png without bloom
    upload_2020-1-27_18-6-10.png with bloom (intensity 5)

    Can you help me? Thanks !! :)
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,352
    You'll want to use HDR rendering, use a custom shader on the objects you want to bloom with an HDR color multiplier, and set the bloom's threshold 1.0 or above.
     
  3. MrDasix

    MrDasix

    Joined:
    Feb 15, 2015
    Posts:
    64
    The threshold is already on 1.0 and the Sprite with Sprite-Default material is already glowing. And do you know where can i find a suitable shader? I already tried tons of shaders that are suposed to work, but was never able to make them work. :C

    Thanks!
     
  4. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,352
    Push it above 1.0, and/or play with the "soft knee" setting. Set the soft knee to 0.0 and the threshold to 1.1 and your white sprites should stop glowing.

    To make an HDR capable sprite shader, make a copy of the built in sprite shader:
    https://github.com/TwoTailsGames/Un.../DefaultResourcesExtra/Sprites-Default.shader

    Rename it to something else (like "Sprites/Default HDR"), and add
    [HDR]
    in front of the
    _Color ("Tint", Color) = (1,1,1,1)
    line ... and you're done. After that it's just a matter of making sure you have HDR enabled for your project and you're using a material on those sprites with the tint color set to something that's actually bright.
     
    Hollow_Spy and MrDasix like this.
  5. MrDasix

    MrDasix

    Joined:
    Feb 15, 2015
    Posts:
    64
    I did all that, and still not working. The camera HDR is set to Use Quality Settings. But i can't find nothing in Quality Settings :/
     
  6. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,352
    It's under Graphic settings rather than Quality settings.
     
    MrDasix likes this.
  7. MrDasix

    MrDasix

    Joined:
    Feb 15, 2015
    Posts:
    64
    WOW! thanks! The shader that i made with your instruction it's not working. Im using a shader that i found online. Where you canc change the emission value. But that with now using HDR and soft knee to 0. Everything works, only that things that i want Glow !!!

    Thank you!!
     
  8. MrSynce

    MrSynce

    Joined:
    Nov 25, 2018
    Posts:
    5
    Can u give a link to working shader?
     
  9. Hollow_Spy

    Hollow_Spy

    Joined:
    Dec 11, 2019
    Posts:
    3
    a decade later and still works, actual genius