Search Unity

HQ Bloom and Lens Dirt, Physically Based Shading and Light Attenuation WIP

Discussion in 'Works In Progress - Archive' started by sonicether, Apr 13, 2014.

  1. sonicether

    sonicether

    Joined:
    Jan 12, 2013
    Posts:
    265
    Hey, guys. I just wanted to share some screenshots of things I have been working on regarding graphics in Unity. I'm not satisfied with the way Unity calculates most of its lighting by default, but since Unity is so very easy to modify in this regard, I've been having a lot of fun doing so!

    Firstly, I've been working on a bloom/lens effects shader. It's a simple post process effect that simulates the airy disk (http://en.wikipedia.org/wiki/Airy_disk) of a camera lens. It correctly does not use threshold, and is energy-conserving. It also has a texture input that is used as a "lens dirt" effect. The texture adjusts scattering of light on the lens, but again, obeys conservation of energy to eliminate false highlights. The texture itself is something I whipped up just as a test.



    These bright objecs are just simple emissive objects. Also, I'm using a custom tonemapping algorithm with a slightly more exaggerated toe and shoulder. You can also see very subtle screen-space reflections (on the left side of the cube).



    I'd also like to show some comparisons of Unity's built-in light attenuation and shaders vs my physically correct light attenuation and physically based shaders. The specular highlights are energy-conserving and also exhibit the fresnel effect for more true-to-life highlights. Light attenuation is calculated based on how light attenuates in real-life instead of Unity's falloff. I decided to use a wet concrete material to show off the effects.



     
  2. chrisso

    chrisso

    Joined:
    Sep 4, 2012
    Posts:
    139
    Cool!
     
  3. Kaldorei

    Kaldorei

    Joined:
    Aug 12, 2010
    Posts:
    112
    Just one word : Amazing
     
  4. jameos

    jameos

    Joined:
    Sep 22, 2013
    Posts:
    111
    amazing does it eat up framerate by any chance?
     
  5. RB_lashman

    RB_lashman

    Joined:
    Aug 15, 2013
    Posts:
    92
    from what I've seen so far - he's getting around 350fps in those scenes :p and no, not on a Titan ;)
     
  6. Glader

    Glader

    Joined:
    Aug 19, 2013
    Posts:
    456
    What necromancy is this!? Superb.
     
  7. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    Wooooo!!!
     
  8. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,373
    Very impressive. I'll be following this :)
     
  9. JamesLeeNZ

    JamesLeeNZ

    Joined:
    Nov 15, 2011
    Posts:
    5,616
    JJ Abrams would be proud
     
  10. RB_lashman

    RB_lashman

    Joined:
    Aug 15, 2013
    Posts:
    92
    lol :p
     
  11. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    Please tell me you're planning on putting this on the asset store. :)
     
  12. sonicether

    sonicether

    Joined:
    Jan 12, 2013
    Posts:
    265
    Performance is very good so far on my system. I'm running a GTX 560 TI and getting ~300 fps in these scenes (of course, they're quite simple). The bloom/dirty lens effect only takes about the cost of running two stacked default Unity bloom shaders, which is what I had been using previously to try to get a nice looking bloom (sometimes it would take three or four). The light attenuation and physically based shading probably isn't even worth measuring since it's basically already using available systems, just slightly differently. Of course, I am not aiming these effects for mobile, so no word on that.

    Just another shot here with a dry concrete material applied instead.


    Here's an example of the dynamic range capable with this effect. Objects that are not many times brighter than the surrounding objects will not cause false bloom. So, you can go JJ Abrams style if you'd like, but you're not bound to it.
     
  13. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    Once again, looks great. Would love to be able to use these myself. :)
    Is it just a custom shader + bloom + tonemapping, or are there other stuff thrown in as well? Is the reflection mentioned in the OP part of the shader, or is it something else? I'm also curious: why does stacking default bloom effects have a better look?
     
  14. FreakForFreedom

    FreakForFreedom

    Joined:
    Jan 22, 2013
    Posts:
    156
    Love it, can't wait to see more of it. Or use it in my own projects, for that matter. :D
     
  15. sonicether

    sonicether

    Joined:
    Jan 12, 2013
    Posts:
    265
    Last edited: Apr 19, 2014
  16. Deleted User

    Deleted User

    Guest

    God, this is amazing.
    Are you a wizard by any chance?
     
  17. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    INSANE... Love it... I wonder if these lights will work with Alloy... It looks INSANELY real
     
  18. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,373
    this looks gorgeous. Really love the lighting.
     
  19. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348
    Stunning is not even the right word for this :)

    Is this coming to the asset store or is for internal use only ? It would be an instant buy if it did for sure.

    Amazing work
     
  20. RB_lashman

    RB_lashman

    Joined:
    Aug 15, 2013
    Posts:
    92
    good news - it will be on the asset store :) and soon too :D
     
  21. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    and....sonicEther....are you the wizard from minecraft???
     
  22. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348
    :), that is some even more stunning news :)

    Will this require Unity pro btw ? I use Unity free for now, but would buy it anyway since i do plan to get Pro, hopefully soon
     
  23. RB_lashman

    RB_lashman

    Joined:
    Aug 15, 2013
    Posts:
    92
    yes ... yes, he is :)
     
  24. RB_lashman

    RB_lashman

    Joined:
    Aug 15, 2013
    Posts:
    92
    yeah, it does - it's an image effect
     
  25. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    http://www.troll.me/images/astonished-face/S***-just-got-real-thumb.jpg
     
  26. Kaldorei

    Kaldorei

    Joined:
    Aug 12, 2010
    Posts:
    112
    BTW Unity really needed some high quality PostFX since the embedded ones are from another time. You look like someone who can bring a lot of awesomeness to Unity (and a lot of money for you since many people like me are fighting with embedded PostFX and are ready to spend money in high quality PostFX)

    I would be really happy to be one of your first customers for our game "Edge Of Eternity"
    http://forum.unity3d.com/threads/239936-JRPG-Edge-Of-Eternity-an-old-school-JRPG

    Good luck !
     
  27. e_Glyde

    e_Glyde

    Joined:
    Apr 20, 2013
    Posts:
    42
    This is some amazing PostFX work and the physically based lighting is just eye candy.
     
  28. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    Jaw, meet floor.
     
  29. sonicether

    sonicether

    Joined:
    Jan 12, 2013
    Posts:
    265
    Hey guys, thanks for the comments! To answer those wondering if I am putting this on the Asset Store I've decided that, yes, I will be submitting this to the Asset Store. I want to get a general opinion on what would be a fair price, however.

    More information is in this thread here: http://forum.unity3d.com/threads/241440-Natural-Bloom-and-Dirty-Lens-Live-Demo?p=1599231#post1599231

    Please post there and give me your opinion on what you'd be willing to pay. More information on what is included is also in the thread I've linked above.
     
  30. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    @sonicether: I have to say... nothing! It is simply too amazing for words.

    All I can say is, this is the AMAZING minecraft mod enhanced to infinity, and ported to unity! :) :D ;) :p
     
  31. FBTH

    FBTH

    Joined:
    Jul 25, 2012
    Posts:
    272
    This is incredible! This is definitely going on one of my projects, in the future! :)
     
  32. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    @FBTH: I am guessing you don't have pro, do you? :p
    Don't worry, this one's in the same boat! :)
     
  33. FBTH

    FBTH

    Joined:
    Jul 25, 2012
    Posts:
    272
    @FuzzyQuills Lol yup xD

    So from that, I'm guessing this is already inside of Unity pro? Or this is pro only?
     
  34. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    @FTBH: This would be a Unity pro package, judging by framerate and visual quality. no indie solution, not even my own, could manage this... :D
     
  35. FBTH

    FBTH

    Joined:
    Jul 25, 2012
    Posts:
    272
    @FuzzyQuills Looks like I'm getting pro!! :p
     
  36. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    Good luck! :)
     
    FBTH likes this.
  37. alexander11

    alexander11

    Joined:
    Aug 11, 2014
    Posts:
    94
    Is the wet/dry concrete shader made with GLSL or HLSL, i would really like to know. Keep up the good work. @sonicether
     
  38. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    I'd imagine it would be HLSL, as practically everything in unity uses a modified HLSL compiler toolchain.

    GLSL can be used though, would be interesting if @sonicether did that, I've often considered trying GLSL for mobile android games...