Search Unity

SSAO Pro - High Quality Screen-Space Ambient Occlusion

Discussion in 'Assets and Asset Store' started by Chman, Oct 14, 2014.

  1. Chman

    Chman

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    721

    SSAO Pro offers a high-quality, stable and fast version of SSAO for Unity with added features like lighting contribution, distance cutoff with smooth falloff and occlusion color.


    SSAO (short for Screen-space ambient occlusion) approximates ambient occlusion in realtime. It relies on the depth and normals buffers to darkens creases, holes and surfaces that are close to each other. In real life, such areas tend to block out or occlude ambient light, hence they appear darker.

    High Quality
    Adds a whole new visual dimension to your scenes using a stable and powerful algorithm.

    Optimized
    Quality settings, downsampling levels, variable blur quality... Fine-tune the effect to your needs !

    Customizable
    Wide or sharp radius, intensity, occlusion distance and color, distance falloff... Plenty of settings to tweak !

    Full source code included.




    Regarding performances compared to Unity's SSAO using the highest possible quality (LC = Lighting Contribution, DC = Distance Cutoff) :
    • SSAO Pro (High, LC & DC enabled, Downsampling: 1, No Blur) : 0.998ms
    • SSAO Pro (High, LC & DC enabled, Downsampling: 1, Bilateral Blur) : 1.290ms
    • SSAO Pro (High, LC & DC enabled, Downsampling: 2, Bilateral Blur) : 0.507ms
    • Unity SSAO (High, Downsampling: 1, Blur: 0) : 1.130ms
    • Unity SSAO (High, Downsampling: 1, Blur: 1) : 1.692ms
    • Unity SSAO (High, Downsampling: 2, Blur: 1) : 0.990ms
    Lower is better. Please note that these numbers will vary from computer to computer depending on their specs.

    I also made a quick speed/quality comparison using a variety of setting combinations. You can find it in this post.

    Unity 4.5+ Pro or Unity 5.0+ (Personal or Pro) is required. Tested on desktop platforms (DirectX 9, DirectX 11, OpenGL). Although it could potentially work with OpenGL ES 2.0 and 3.0, I wouldn't recommend using this on mobile devices. It's a high-end effect, the performance cost would be too expensive for these platforms to handle at a smooth framerate. Even though the shader used in this asset is quite optimized, SSAO in itself still is an expensive effect and requires a powerful computer to run at very high settings.

    Models & Textures in screenshots and video by Manufactura K4 and Unity Technologies (not included in the package).
     
    Last edited: Sep 10, 2015
    John3D, srmojuze and Luckymouse like this.
  2. Chman

    Chman

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    721
    Version 1.0.2 is available !

    Changelog (1.0.2) :
    • Added a new quickstart launcher when you import or update SSAO Pro.
    • Added "About SSAO Pro" and "SSAO Pro Manual" in the Help menu.
    • Fixed : The effect wasn't working properly in DirectX mode using the forward rendering path and MSAA.
    • Misc : Various documentation fixes & additions.
    Don't forget to rate it on the Asset Store ;)
     
  3. adventurefan

    adventurefan

    Joined:
    Jan 17, 2014
    Posts:
    230
    I'd be interested if I had pro yet, unfortunately I don't.

    But SSAO is a pretty good effect that can help build scene depth a lot. It's hard to see in still shots sometimes but just imagine any protruding geometry at all in your scene getting more shadow data... I personally like the feature a lot in games so good on you for developing this.
     
  4. OneShotGG

    OneShotGG

    Joined:
    Nov 16, 2012
    Posts:
    225
    very nice, any future plans to do HBAO plugin?
     
  5. Chman

    Chman

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    721
    HBAO, no, because it's a fair bit slower than SSAO (which is already quite expensive) so not really worth it.

    HBAO+... Maybe, I need to look into it but can't promise anything. I'm actually quite happy with the results I'm getting with SSAO Pro. But yeah, maybe in the future I'll dig into HBAO+.

    Edit: btw, if anyone is able to find a paper about HBAO+ I'd love to see it because at the moment it's nowhere to be seen. I hope it won't be another secret driver-only implementation, like TXAA...
     
  6. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,338
    Is there a comparisson with pics to Unity SSAO ?
     
  7. Chman

    Chman

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    721
    No, I will try to post some tomorrow so you can see the difference in quality (speed is in the first post) !
     
  8. macdude2

    macdude2

    Joined:
    Sep 22, 2010
    Posts:
    686
    Could you post a web player perhaps?
     
  9. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,338
    Nice, thanks
     
  10. OnePxl

    OnePxl

    Joined:
    Aug 6, 2012
    Posts:
    307
    It looks great. Is there anyway to bake the results for use on mobile?
     
  11. duke

    duke

    Joined:
    Jan 10, 2007
    Posts:
    763
    I doubt it, thats like asking if you can bake DOF.
     
  12. OnePxl

    OnePxl

    Joined:
    Aug 6, 2012
    Posts:
    307
    I was afraid it was a silly question. I get the part where the SS in the name prevents it from baking. But I also can't come up with a good reason for it to be dynamic? It's not clear to me from the video and the copy what the use-case is of this?
     
  13. Chman

    Chman

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    721
    Animated objects and characters ? Moving lights (this SSAO effect takes lighting into consideration) ? :p

    If you only want static AO, you can of course bake it using 3dsmax, Maya or anything else but that's not what this asset is about.

    So, I tried to get the highest quality I could from the default SSAO to do a comparison, but as the algorithms used aren't the same it wasn't easy. Here you go :

    (left) SSAO Pro | Unity SSAO (right)


    As you can see, SSAO Pro is better at finding small creases, details in normal and parallax maps. It's more precise in general. It's also faster, as shown the first post. And, in this case, the SSAO Pro screenshots don't even have the blur pass activated (less GPU stress, two draw calls saved, almost twice as fast as the screenshots with the default SSAO) and it looks good already :)
     
    srmojuze likes this.
  14. kurylo3d

    kurylo3d

    Joined:
    Nov 7, 2009
    Posts:
    1,123
    very nice, cant wait to try it out.
     
  15. Pulov

    Pulov

    Joined:
    Feb 20, 2010
    Posts:
    824
    It looks super fine, and its very nicely priced. Bookmarked and watching.
     
  16. OnePxl

    OnePxl

    Joined:
    Aug 6, 2012
    Posts:
    307
    Of course, but the examples you've shown so far have been static; no moving lights either. That's why I asked.
     
  17. Chman

    Chman

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    721
    Indeed, my fault, because it's the best way to showcase SSAO :) Some actually have animations and moving lights but it's a bit hard to see in such a short time with a moving camera.

    I'll try to post a demo using an animated character when I get the chance !
     
  18. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,338
    Thanks a lot for the comparissons, your system seems godly :)

    Do you plan to increase on price later ? Just to know when to buy :), which is already in the asap region with such amazing results.

    Another thing, i saw you mention a parameter about distance cut off, is this something Unity Pro SSAO provides as well or os unique to your system ?
     
  19. Chman

    Chman

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    721
    No price increase planned at the moment. I have a small list of features I'd like to add or improve to make it more complete, but nothing that would justify a price bump.
     
  20. kurylo3d

    kurylo3d

    Joined:
    Nov 7, 2009
    Posts:
    1,123
    what kind of features?
     
  21. Chman

    Chman

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    721
    I'd like to add a way to exclude some layers from the SSAO pass that doesn't require the use of two cameras :)

    Edit : see this.
     
    Last edited: Mar 23, 2015
  22. kurylo3d

    kurylo3d

    Joined:
    Nov 7, 2009
    Posts:
    1,123
    Your SSAO requires 2 cameras? Does it work with the occulus rift? You can download the unity package at oculus website in the dev section.
     
  23. Chman

    Chman

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    721
    No it doesn't require two cameras. I said I'd like to add a feature to exclude layers from the SSAO pass, which can already be done by using two cameras but would be easier if it was just a layers dropdown in the SSAO Pro UI. The effect itself only require one camera.

    It "works" with the Oculus Rift, but from what I understand it has issues with large radius (ghosting effect), like the default SSAO. I'm not sure how to fix it at the moment. Not having an Oculus Rift to test it myself isn't helping. Handling depth-based effects with VR can be quite complicated, especially when you don't have the hardware to experiment on :/
     
  24. kurylo3d

    kurylo3d

    Joined:
    Nov 7, 2009
    Posts:
    1,123
    I think if you make a build using the occulus rift package, you can actually run it on your monitor so u can at least both camera angles on your monitor.
     
  25. Chman

    Chman

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    721
    Yes but it doesn't in any way help me experience the ghosting effect. Looking at a single flat screen with my two eyes and having a separate render isolated for each eye is quite different.
     
  26. kurylo3d

    kurylo3d

    Joined:
    Nov 7, 2009
    Posts:
    1,123
    I guess im just not sure what you mean by ghosting effect.
     
  27. kurylo3d

    kurylo3d

    Joined:
    Nov 7, 2009
    Posts:
    1,123
    In either case I will give it a test when i get around to purchasing. Still need to make more art assets first for my scene anyway.
     
  28. Pulov

    Pulov

    Joined:
    Feb 20, 2010
    Posts:
    824
    I've the dk2, if you upload a demo I can test it and see how it goes.
     
  29. chiapet1021

    chiapet1021

    Joined:
    Jun 5, 2013
    Posts:
    605
    Hi Chman,

    The comparisons between your asset and Unity SSAO are very impressive! Have you had any exposure to the Unity 5 beta, by chance? I don't know if ambient occlusion/obscurance is improved in 5.0 vs 4.x.

    Thanks!
     
  30. Genjin

    Genjin

    Joined:
    Oct 17, 2014
    Posts:
    11
    Does SSAO Pro run in Unity 5? I'm asking because we're currently using it productively, so that would be good to know.
     
  31. Chman

    Chman

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    721
    Thanks, I'll try to build a small OR demo.
    AFAIK they haven't done anything to the SSAO and SAO shaders in Unity 5. But it's still in beta so it's hard to say if they will be improved in the final version.
    Probably, it's a standard post processing effect so I see no reason why it wouldn't work with Unity 5. As a matter of fact it should be faster than in Unity 4 with the new full-deferred rendering path (direct access to the normal & depth buffers) :)
     
  32. kurylo3d

    kurylo3d

    Joined:
    Nov 7, 2009
    Posts:
    1,123
    Yea, I have the DK2 as well, will you post a link to this forum when u make a build?
     
  33. Chman

    Chman

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    721
    Yes !
     
  34. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    Far better than the Unity build-in with a procedural planet. A very good job (as usual). :cool:
     
  35. Chman

    Chman

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    721
    Version 1.1 is available !

    Changelog (1.1) :
    • Added : Downsampling. You can choose to downsample the AO pass only or AO + Blur, so you can better control the speed-quality ratio depending on your scene.
    • Removed : Useless Bilateral Threshold parameter. This is now hardcoded into the shader.
    • Misc : Documentation update. The Performances section has been rewritten and populated with more useful data.
    I also made a quick speed/quality comparison using a variety of setting combinations (warning, massive picture) :

     
  36. janpec

    janpec

    Joined:
    Jul 16, 2010
    Posts:
    3,520
    Finally! Someone made SSAO for Unity as it should have been done. One question though does it work normally with DoF and fog, or does it have artifacts like Unity SSAO?
     
  37. Chman

    Chman

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    721
    It works fine with DoF, at least it did in my tests. Regarding fog, you can play with the Distance Cutoff & Falloff settings to gently fade the SSAO as it enters the fog :)
     
  38. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    So, the best compromise is :
    - Sample : Low
    - Downsampling : 2
    - Blur : Bilateral
    - Blur Down : yes
    Result in 0.321ms. I will try this. ;)
     
  39. Chman

    Chman

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    721
    Well, it also depends on the AO radius and the general look you're going for :) It's pretty much scene dependent, there's unfortunately no way to come up with an universal set of settings that would work for every scene.
     
    Last edited: Nov 3, 2014
  40. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    I will try with another parameters, but the revious seem good. Thanks for the reply. :cool:
     
  41. Stormbreaker

    Stormbreaker

    Joined:
    Aug 15, 2012
    Posts:
    161
    Looks awesome! You should work on a decent post processing AA effect next. It's in high demand from the community.
     
    jcarpay likes this.
  42. Chman

    Chman

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    721
    I actually have one in the work, but my time is quite limited these days. It's already working but it's missing a few features at the moment. If I don't find the time to finish it I'll probably release it for free and let the community improve it.
     
    shkar-noori and Stormbreaker like this.
  43. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    How about SSDO, any plan to adding it??
     
  44. Chman

    Chman

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    721
    Ultimately I'd like to add a few different AO algorithms so the user can choose one that fits his game better than the others. I haven't decided on which ones yet.
     
  45. jcarpay

    jcarpay

    Joined:
    Aug 15, 2008
    Posts:
    561
    That would be awesome!
     
  46. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Now that would be cool.... check your PM btw :)
     
  47. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Bought it yesterday, but didn't try it yet with oculus, because I know that it wont work. The effect is great, but there is one thing that unfortunately makes it useless for VR applications (and first person usage):
    It requires a camera near plane set to high values, starting from 0.3. This is too much, as the first thing to do in general VR is to put a clipping plane from a default value of 0.1 to something smaller. I always use at least values small as 0.03. Going from 0.03 to 0.3 would mean excluding rendering of objects that are 30 cm from a head position. For now, i can immagine using it in some top-down games or architectural flight simulations, but for me that's not the way to go as it limits it's application. And scalling a whole scene can't be a way to go as it would mess with physics, oculus cameras, tracking devices, 3th party plugins, models, etc. More or less with everything. :(
     
  48. shkar-noori

    shkar-noori

    Joined:
    Jun 10, 2013
    Posts:
    833
    Great effect on my to-buy list, could you possibly do a good AA after this effect ?
     
    Stormbreaker likes this.
  49. Chman

    Chman

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    721
    I had a few people test it with the OR and it worked fine with low and medium radius at znear = 0.3 but being able to drop this to 0.1 or 0.05 would indeed be better for VR in general.

    But yes, this limitation is bothering me as well and I'm looking into it (it has to do with the non-linear depth buffer precision), I need to find a way around it.

    Read my last post in this topic ;)
     
    shkar-noori likes this.
  50. cowtrix

    cowtrix

    Joined:
    Oct 23, 2012
    Posts:
    322
    Hey Chman. I'm getting these errors when I try and add the effect to my camera:



    I'm in deferred rendering, and linear lighting. Any idea what it could be?

    EDIT: Ah okay, did some reading. Guess I've just got to try and find some room somewhere...
     
    Last edited: Nov 12, 2014