Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Bloom "pop" under hdr

Discussion in 'Unity 5 Pre-order Beta' started by wetcircuit, Nov 22, 2014.

  1. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    Hi, back again with another (newbie) issue.

    I am getting bloom "pops" frame-to-frame, where individual pixels seem to blow out to the maximum value(?) when using the Bloom script with hdr. The pops are (mostly) all the same size, suggesting they are peeking at a maximum value (looks like a faded circle).

    I am deliberately pushing hdr and tonemapping to see how far it can go, but this seems like some sort of clipping issue. Figured I would show&tell here. Ask if I should report it.

    Unity5b13
    Standard Shader (Specular Setup)
    Camera hdr ON
    Bloom (script) hdr ON

    Individual threshold settings don't seem to matter. Turning hdr on the camera or the Bloom OFF stops it.





     
  2. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    This is a known issue with the built-in bloom effect AFAIK, the sort of "sparkling" effect.
    You should look into picking up Sonic Ether's Natural Bloom from the asset store, it doesn't have any sparkling at all and it's pretty much made for HDR.
     
    shkar-noori and wetcircuit like this.
  3. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    Ok... move along... nothing to see here...:rolleyes:
     
  4. melkior

    melkior

    Joined:
    Jul 20, 2013
    Posts:
    199
    I'm using Sonic Ether's Natural bloom and have the same problem FYI.
     
    Ony and wetcircuit like this.
  5. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    Well, that ^ changes things... (and saves me $20)

    My guess is that the Standard Specular Shader is delivering pixel spikes to the camera. If the issue is in the shader BEFORE the bloom filter, there is nothing the bloom can do about it. Bloom is working correctly as far as it knows.... The shader should not be spiking on-and-off at a single pixel.

    Adjusting the Directional Light effects the size and color of the bloom, which I assume is what the bloom is intended to do, but it means it is related specifically to the Directional Light highlight (being multiplied?) under hdr....

    Whatever the cause, I feel I am against it so I am reporting it as a bug. ;)
    Thanks for feedback....:cool:
     
    Ony likes this.
  6. juliobds

    juliobds

    Joined:
    Dec 27, 2011
    Posts:
    25
    I could be wrong but I believe you are using a shader called fast bloom, look for the one that isn't "fast", I don't think it should be used on mobile devices but it's more than appropriate for desktops. I also should come with unity so if it ends up not working you just lost a few minutes of your time.
     
    wetcircuit likes this.
  7. melkior

    melkior

    Joined:
    Jul 20, 2013
    Posts:
    199
    I'm doing a desktop title using linear color space, forward rendering, HDR, tonemapping and sonic ether's natural bloom and I get this kind of "glitter" all over the place.



    When I turn off bloom it does not happen though.

    I'm not a wizard enough in Unity to know the cause or if its a defect. I am coming over from using a different engine using 2D projects so a lot of this is new to me. I can just report what I see.
     
  8. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    Thank you for suggestions Juliobds and PhobicGunner

    Melkior, I think I figured it out, let us know if this helps:

    After more experiments it is not Bloom at all..., it is the Standard Shader's Specular alpha channel (the gloss/roughness setting). No alpha channel is the same as 100% (white) which focuses the highlight smaller than individual pixels in my imagemap. There is no "spread" of the highlight, hence the sudden spike from frame-to-frame as individual pixels suddenly shoot to maximum intensity, meanwhile adjacent pixels remain too low to trigger the bloom effect.... Using Bloom with HDR simply reveals the spike, it is not the cause.

    I'm guessing this is "working as intended", and one of the pitfalls of using a specular-based shader rather than a metallic shader (which in another U5beta thread some have called easier but more limited in range). It will probably occur with other shaders too. It still takes HDR to make it go to the moon....

    Anyhoo, by taking my specularity map into Photoshop I can set a precise alpha channel value, and get the gloss to spread a little more so it doesn't "drop out" between pixels. The actual gloss value required is probably dependent on the resolution of the map, so ymmv.

    On the Standard Specularity Shader (in Unity5b13 at least), before we use a specular map we have a colorchip (3-channel highlight) and a slider (1-channel gloss/roughness)



    After we add the map we lose those controls. It's completely up to the image map now RGB for highlight, alpha for gloss/roughness



    It would be awesome if we could keep that color chip WITH the map (like Albedo does) and also keep the slider (like Normal does) because going back and forth between Photoshop and Unity guessing at levels is just tedious. :confused: There's got to be a better way to finetune settings.
     
  9. Per

    Per

    Joined:
    Jun 25, 2009
    Posts:
    460
    It's a natural result of the higher dynamic range, to solve this the filter must either use a high sub sampling level or it should simply use a clamped value range/SDR image for the source.
     
  10. melkior

    melkior

    Joined:
    Jul 20, 2013
    Posts:
    199
    Tweaking values in photoshop is how i was getting around it. You'll notice in the pic I posted the sword has all the sparkles but the other items behind it do not .. that is because I had tweaked those other items just not the sword yet.

    The thing that gets a little tiring is each beta things change a lot as far as texturing and lighting and specularity and so forth so once you figure you've got things "right" you realize they weren't done and you have to start tweaking again.

    Thanks for the confirmation that this was essentially the right approach though.

    I do agree .. the sliders would add additional value even when a map is present ; most particuarly because there are hundreds of legacy assets that aren't designed with the new system in mind. I can drop a legacy map in and have it look horrible but if I had a slider I could tweak it to a 98% happy spot and not need Photoshop skills. Not everyone is fortunate enough to be able to handle the art end, and my guess is most assets will not get updated for PBR ... potentially for either a very long time or possibly ever.
     
    wetcircuit likes this.
  11. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    Err..., so I won't get comfortable with my solution. LOL :rolleyes:

    Something like Substance Designer that can handle this mapping shuffle is looking necessary. I could have bought a pony for what Unity and Friends are costing me. :confused:
     
  12. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Here, try to replace Blend for Bloom, this is my first try though.
    I'm tying to average the buffer while also removing the bloom glitter.

    EDIT: nvm, for some case it work and sometimes the glitter still exist, need to find a way to average the hdr buffer :/
     

    Attached Files:

    Last edited: Nov 24, 2014
    wetcircuit likes this.
  13. mittense

    mittense

    Joined:
    Jul 25, 2013
    Posts:
    168
    Has there been any update to this? I'm reminded of the issue now on a recent project and am getting the same behavior.
     
    Ony likes this.
  14. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    I'm also wondering if there's a way to avoid this. I'm going to take a wild guess and say that pretty much no one has ever got Unity's bloom to look ok with HDR specular highlights. Is there an easy way to either clamp the input to the bloom effect or (better) clamp the output of the specular shader?
     
  15. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    I want to add that while decreasing the "Shininess" slider or adding a darker alpha channel works fine for things that aren't supposed to be shiny, this is still a problem for things that are supposed to be shiny, like metal. All of the sample metals in the Unity Shader Calibration scene have this problem. It only goes away if you lower the shininess of the metal below .7 or so, but then it stops looking like metal and no longer shows reflections. There really should be a fix for this... it doesn't look particularly terrible unless you turn on bloom, but it is still an issue overall having pixels with insanely high white values for anyone working with image effects and shaders.
     
  16. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    Rather than wait around, I decided to see if I could work around it. Here's an image effect and shader that just clamps pixels to a max luminance. Put the image effect on your camera BEFORE the Bloom filter, make sure the "Shader" is set to this shader, and it will cutoff the bright pixels to whatever you choose for the Cutoff value. I'd recommend around 3 or so.
     

    Attached Files:

    id0, nous, HenryChinaski and 14 others like this.