Search Unity

SE Natural Bloom Dirty Lens

Discussion in 'Assets and Asset Store' started by sonicether, Apr 29, 2014.

  1. Binary42

    Binary42

    Joined:
    Aug 15, 2013
    Posts:
    207
  2. rosevelt

    rosevelt

    Joined:
    Oct 23, 2012
    Posts:
    47
    Hello,

    My camera has a solid black color as background. adding the SENBDL effect; as higher the intensity is brought I can see that the final render is not smooth, in terms of the brightness around brighter object it seems that bloom is not falling off smoothly thus not achieving a perfect gradient image but has noticeable edges, resulting in something similar to a topographic height map.

    Any idea what I might be doing wrong in setting up things?

    Thanks
     
    Last edited: May 25, 2014
  3. PureSpider

    PureSpider

    Joined:
    Oct 25, 2013
    Posts:
    3
    rosevelt, are you working in linear color space?
     
  4. rosevelt

    rosevelt

    Joined:
    Oct 23, 2012
    Posts:
    47
    I am working in linear color space.
    Switching to gamma color space I was able to see these artifacts as well though less apparent.
     
  5. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @rosevelt I've had this issue as well. What you're seeing actually is the limitation of 8-bit color, or 'color banding'. There's no easy solution, other than using other forms of image processing to lessen the effect (either using color grading to clamp out the outer couple bands of nearly-black, or having a noise post effect after the bloom). In general I tend to run an image effect sequence of SEBloom->ToneMapping->AmplifyColor->Noise(super subtle), and have been able to get pleasing results.
     
  6. rosevelt

    rosevelt

    Joined:
    Oct 23, 2012
    Posts:
    47
    Thanks xenius,

    What part in the render chain is limiting to 8 bit color?
    In SEBloom demo, if I remember correctly I don't see any noticeable color banding at all.
    Also Unity Bloom effect is not suffering from this color banding too, I guess it works differently.
     
  7. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    The entire render chain/engine is limited by it. We use: http://en.wikipedia.org/wiki/True_Color#True_color_.2824-bit.29 in basically every game engine. You only have 256 luminance levels to work with. The banding you're seeing is the result of colors being represented by this limited amount of steps.

    The banding is even there in the demo (turn the lens dirt, essentially noise that masks it, off with the down arrow key).

    $Banding2xZoom.jpg

    Its harder to see there, because we have color transition, noise, and a lot more fill from the bloom. Basically truecolor friggin blows for subtle gradients, whether its games, photos, movies, animation, whatever. The solution is always to try to compose an image that masks/hides this problem, by having the transition occur either over a shorter distance, or having other image elements mask this via noise, content etc.

    The Unity bloom doesn't tend to cause this problem _as much_ because:
    1. By default its blur radius is fairly tight, so it has a much less prominent halo. If you set it to have 4-8 blur steps, the banding becomes evident.
    2. It blows goats for quarters, so it usually has visual problems that are louder than its banding

    Anywho, hope this was in some way helpful for you.
     
  8. rosevelt

    rosevelt

    Joined:
    Oct 23, 2012
    Posts:
    47
    Thanks it been very helpful.
    I'll try adding those other image effects to lessen the harshness of the bands.
     
  9. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    Oh wow, as I'm doing a space game with VR (Oculus Rift) support, that would be sick. Having a dirty effect on cockpit glass would be perfect.
     
  10. VenomUnity

    VenomUnity

    Joined:
    Apr 6, 2013
    Posts:
    29
    What do you guys think?



     
  11. NeatWolf

    NeatWolf

    Joined:
    Sep 27, 2013
    Posts:
    924
    I think you should probably tone down the reflection on the wood crates (better specularity/reflection map) and tweak the shadow bias, change the default UFPS sky shader with a HDR ready one to improve the bloom on the sky, ramp up the sunlight.
     
    Last edited: Jun 1, 2014
  12. noanoa

    noanoa

    Joined:
    Apr 17, 2014
    Posts:
    225
    Does SNBDL have any advantage over Unity one when it comes to fill rate? I'm using bloom effects to make entire screen blurry and soft by setting its threshold very low, not really for emitting lights. But I needed to increase blur iterations to make it look nice and fillrate has been problem lately. I'm wondering if SNBDL can be the solution.
     
  13. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    Sorry if this is too far off topic, but I was wondering if it's possible to create fictional HDR skyboxes that interact well with this bloom effect. Specifically, I want space skyboxes that have bright suns and possibly semi-bright galaxies and things in ideally. Currently I have LDR skyboxes.

    Now for a sun, it looks like instead I can just put a sphere in a scene and put the emitter shader that comes with this on it and get a pretty great "this is super bright" effect without even doing anything else. But for something like a bright galaxy, it'd be cool to have it more image-based.

    Are there any tools out there to let you define super bright areas in an HDR skybox manually? My space ship is broken, so I can't take my camera into space to take photos. :)
     
  14. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    676
    Has anyone gotten this to work properly on the UFPS weaponcamera? The bloom effect works, but it vertically inverts my camera so that I'm upside down. Am I doing something wrong?
     
  15. HanSol0

    HanSol0

    Joined:
    Aug 16, 2012
    Posts:
    3
    Just looking for a status update on the vertical flip issue. Any ETA for when we can expect a fix to this issue?
     
  16. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    676
    Ah, wasn't aware others had posted about this. Looking forward to a fix!

     
  17. hsr38

    hsr38

    Joined:
    Aug 15, 2012
    Posts:
    3
    Please Sonic Ether, add mobile support to this marvelous shader effect! The Pc looks great, but on my Windows Phone my entire scene it`s just a pink image
     
  18. Binary42

    Binary42

    Joined:
    Aug 15, 2013
    Posts:
    207
    This is a real dealbreaker for me, so here's another pleeeeeeeeeeeeeeas fix it. ;)
     
  19. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    So you have planned to spend here every two or three weeks. :(
     
  20. Play_Edu

    Play_Edu

    Joined:
    Jun 10, 2012
    Posts:
    722
    I create my own shader with shader forge but how can it work with my custom shader please help ?
     
  21. sonicether

    sonicether

    Joined:
    Jan 12, 2013
    Posts:
    265
    I'm sorry that I've been away, everyone!

    I am only able to replicate the vertical flipping issue when I have two scene cameras, the topmost clear flags set to "depth only" and SENBDL on the top camera, along with using forward rendering. Is there another condition under which this occurs?

    This is not the only issue I see with this setup. It seems as though the pow(color, 1.0 / 2.2) for linear-space lighting that happens behind the scenes in Unity is occurring twice, because all colors within the scene become very pale.

    Things are finally settling down in my personal life allowing me the time to work on these issues. Please accept my sincere apology for not fixing this sooner.

    EDIT: I've come across another problem. For some reason, with this setup, HDR doesn't seem to be working on the second camera. I'm wondering if this is simply a limitation of forward rendering in Unity and if there would be nothing I could do about this... I'll look into it. It seems as though I'm not the only one with this issue. http://answers.unity3d.com/questions/630833/hdr-and-depth-only-clearflags-problem-forward-rend.html
     
    ZJP and RB_lashman like this.
  22. SpectralRook

    SpectralRook

    Joined:
    Feb 9, 2014
    Posts:
    112
    This sounds familiar. Check this post for a possible solution:
    deferred-renderer-multiple-cameras-posts-ssao-bugged-ufps-onrenderimage
     
  23. sonicether

    sonicether

    Joined:
    Jan 12, 2013
    Posts:
    265
    I've looked into the link you shared, and this doesn't fix the issues I mentioned. It seems that the render textures are being truncated to LDR... This isn't just with SENBDL, but with anything.

    So... pale colors and truncation from HDR to LDR on additional cameras set to "depth only" with forward rendering occurs with any image effects. This is a Unity problem...
     
  24. wheelbarrow

    wheelbarrow

    Joined:
    Sep 12, 2011
    Posts:
    177
    Glad you picked up on all the colours in the scene getting pale, I was about to ask about that. I have another question though: when I put your shader on an fps camera that has nothing else on it, just your shader, I still get a warning telling me that either the camera does not have HDR enabled (which it does), or there is something else further up the line on the camera preventing it from using HDR; any idea why that is, when yours is the only additional thing on the camera? And yes, I have 'colour space' set to linear in the player settings.
    Cheers.
     
  25. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,349
    Bought :), too good an offer to pass by and looks amazing

    Now hopefully will have Pro soon and use it :)
     
    Last edited: Jun 13, 2014
  26. nukeD

    nukeD

    Joined:
    Feb 12, 2009
    Posts:
    411
    very easy to use, looks much better than the unity bloom, but its a little heavier.

    Thanks for the great work!

     
    sonicether likes this.
  27. RB_lashman

    RB_lashman

    Joined:
    Aug 15, 2013
    Posts:
    92
    WOW!! this looks REALLY good!! :)
     
    sonicether likes this.
  28. Weltista

    Weltista

    Joined:
    May 6, 2014
    Posts:
    9
    Hi. I'm not an expert, but this seems to be an odd behavior in cases when both cameras are set to HDR mode. Do you think it should be filed as bug, or maybe as a suggestion/petition to fix in future unity releases (Unity 5 maybe)?

    And I would also like to thank you for this great tool! (Looking forward to vertical flipping issue fix like other ppl here-).
     
  29. sonicether

    sonicether

    Joined:
    Jan 12, 2013
    Posts:
    265
    Are any of you guys getting the vertical flipping issue without the other issues? If so, please let me know how I can recreate this problem so I can work on solving it.
     
  30. Weltista

    Weltista

    Joined:
    May 6, 2014
    Posts:
    9
    For my project, I have the exact setup you described above. One camera (depth -2) renders 'deep sky' layer and sends results up to main camera (depth -1, clear flags: depth only) which renders the rest of the scene. Eventually if you switch 'clear flags' on main camera to 'skybox' the flipping is gone. (But I thought you know that already.)
     

    Attached Files:

  31. Weltista

    Weltista

    Joined:
    May 6, 2014
    Posts:
    9

    Attached Files:

  32. DrewMedina

    DrewMedina

    Joined:
    Apr 1, 2013
    Posts:
    418
    Bump for VR support ( the dirty lens part, bloom works great)
    Thanks!
     
  33. movra

    movra

    Joined:
    Feb 16, 2013
    Posts:
    566
    Weltista likes this.
  34. movra

    movra

    Joined:
    Feb 16, 2013
    Posts:
    566
  35. JayG81

    JayG81

    Joined:
    Sep 4, 2012
    Posts:
    72
    I would love to see that as well. I was hoping that the asset had the ability to do that when I purchased it. Regardless, it's still a great asset you made. Good stuff!
     
  36. Play_Edu

    Play_Edu

    Joined:
    Jun 10, 2012
    Posts:
    722
    +1
     
    Last edited: Jul 22, 2014
  37. Ghosthowl

    Ghosthowl

    Joined:
    Feb 2, 2014
    Posts:
    228
    Been watching this one for a while, saw the sale and bought. Looks like it could really come in handy for my project. Thanks a ton!
     
  38. Weltista

    Weltista

    Joined:
    May 6, 2014
    Posts:
    9
  39. rushbier

    rushbier

    Joined:
    May 29, 2013
    Posts:
    7
    Will the Scale vs Distance and Emission Gain vs Distance scripts be in future updates for sonic ether bloom?
     
    jaijai76 likes this.
  40. superawesomecliff

    superawesomecliff

    Joined:
    Jun 20, 2014
    Posts:
    1
    has anybody figured out how to get this to work with shader forge?
    I put a value node and cranked it up.. and it makes it glow.. but i need to put custom maps in for the glows.. and if i use value it cranks the blacks up to white.
     
  41. Fabian Schempp

    Fabian Schempp

    Joined:
    Jun 1, 2013
    Posts:
    17
    I'm trying to add the SENaturalBloomAndDirtyLens component to my generated camera by script.(camera.AddComponent<SENaturalBloomAndDirtyLens>()) but I'm getting Nullreference exceptions because the shader variable
    of the component is not set.
    And I don't have any idea where it would be set when you adding the component in the Editor.

    can anybody help me?
     
  42. Chman

    Chman

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    721
    The shader for SENaturalBloomAndDirtyLens is set a default reference in the editor which doesn't reflect at runtime (no way around it as far as I can say, the same thing happens with default image effects). So you have to set the shader variable yourself.

    Something like :
    Code (csharp):
    1. var comp = camera.AddComponent<SENaturalBloomAndDirtyLens>();
    2. comp.shader = Shader.Find("Hidden/SENaturalBloomAndDirtyLens");
    3. comp.enabled = true;
    Unless you use this shader somewhere else in the scene, it won't be added to the final build so don't forget to move the shader file in a */Resources folder.

    That should do it !
     
  43. sgoodrow

    sgoodrow

    Joined:
    Sep 28, 2012
    Posts:
    150
    sonicether -

    Great asset, it truly does an awesome job.

    One thing I was curious about is (and you can excuse this question if it doesn't "make sense" with this form of bloom): is it possible to bloom different sources at different intensities? I think the first three images in this post explains what I mean clearly enough: http://forum.unity3d.com/threads/hdr-the-bungie-way-featuring-bloom-flares-and-lighting.213768/.

    I think I understand how this shader works -- by analyzing the rgb results of a render pass -- however if we were to setup our scene to specify the bloom intensity in the alpha channel, would it be possible to use this intensity to control the bloom intensity for different objects?

    Thank you.
     
    Last edited: Jun 28, 2014
  44. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,373
    Feature request:
    Reduce the brightness of the image a bit before applying HDR lights and bloom. This way the lights and bloom should appear even more bright.
     
  45. Chman

    Chman

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    721
    I'm facing the exact same issue and the only fix is apparently to switch to deferred rendering which isn't an option for me :/ I posted a thread about it a few days ago but it looks like no one knows why it does that...
     
  46. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,373
    SE, I noticed that with the latest version, the dirt texture works now in VR. However, the dirt texture is applied to a space helmet. Can it be applied to a vehicle windscreen as well, with an option to choose from?
     
  47. srmojuze

    srmojuze

    Joined:
    Mar 18, 2013
    Posts:
    127
    Thanks, getting the look I want for my visualiser project :)

     

    Attached Files:

    Last edited: Jul 11, 2014
  48. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,373
    SE, while you are working on that lens dirt shader in world space, can you make it support an animated texture (UV offset) as well? I would love to get an animated rain-on-window effect working.

    Edit:
    Here is a video of my project

     
    Last edited: Jul 16, 2014
  49. jaijai76

    jaijai76

    Joined:
    Aug 5, 2013
    Posts:
    21
    It would be good if the attenuation features and other features were in this bloom by default.
     
  50. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    I just bought Natural Bloom... works perfectly and as advertised... :)