Super-fast high-quality SSAO

Hey, everyone.

I’d love to get your opinion on an image effect I’ve been working on for Unity. Like many users, I’ve never been satisfied with Unity’s built-in SSAO functionality. I set out to see if I could come up with something that looks better and runs faster. I’ve made a lot of progress and I’d like to share what I’ve come up with so far.

Here’s a test scene rendered at some arbitrary high resolution over 1080p (2372x1335 to be exact). I’ll be comparing Unity’s built-in SSAO image effect with mine.


Here’s Unity’s SSAO being rendered in 9.2 ms at the highest quality settings I could manage. There’s a lot of noise, despite filtering, and high-frequency details are pretty much non-existent due to the large radius. Why can’t we have a large SSAO radius and high-frequency details?


Here’s my SSAO effect in its current state being rendered in 4.3 ms. Because I take a simplified approach to gathering AO samples, many samples can be taken for a low cost. I’ve also written a more robust calculation that reduces under-occlusion and over-occlusion at a heavier performance cost. There may still be room for further optimization and there is definitely still room for further polish and image-quality improvement.

I’m pretty happy with the results so far. In my opinion, it looks much better, and renders at more than twice the speed that Unity’s built-in solution does.

Let me know what you think! If enough people are interested, I’ll consider putting it on the Asset Store. If there’s any additional information you’d like about my implementation, feel free to ask me.

27 Likes

claps Bravo, Bravo!

Looks nice i would love if i ever did any thing needing this to be able to use it yours look a lot better then there default.

I like it. More performance is always welcome. It always seems to me that ambient occlusion, lighting, shadows, and radiosity, all really belong to the same single system and should have all those features working as one, ie global illumination, but I know that’s really a challenge.

whoa … looks soooo much better than the default one :sunglasses:

Web player? Will this be released?

Nice

Wil this work in Unity Free by any chance ? Also will it have a cut off parameter to control the depth it is applied to ?

He says it’s an image effect, so unfortunately for free users, no use.

yeah, I doubt you even could make ssao that would work in Unity free :wink:

There are ways to make it happen i guess, but are usually much slower.

I don’t think there are … are there? how else would you do it if not as an image effect?

That looks much nicer than the built-in effects! One huge problem I’ve always had with ssao is that it breaks functionality for many succeeding image effects… as if the depth buffer get’s overwritten. If you could solve this issue it would be seriously worth the upgrade :slight_smile:

You have to grab the backbuffer into a texture which is relatively slow and then you can re-draw that texture with an image-effect-like shader.

that sounds like it would be incredibly expensive performance-wise

I love your Sonic Ether plugin, that SSAO looks awesome.

Can you post some comparison renders with colours, textures, etc. with Unity 5 Global Illumination?

Let’s see some AAA eye candy :slight_smile:

Seem a SSAO ‘War’ is coming. :stuck_out_tongue:
https://www.assetstore.unity3d.com/en/#!/content/24445 ($20)
https://www.assetstore.unity3d.com/en/#!/content/22369 ($25)

So, what are the benefits compared to your concurrents. Because like the others yours is better than the integrated Unity SSAO.

well … can’t say anything about the speed … but from all those screenshots - his SSAO looks WAAAAAY better than either one of those 2 :slight_smile:

and yeah - no wonder everything is better than the built-in Unity ssao … there could literally be nothing worse than the default one :wink: so that’s not exactly difficult to achieve :stuck_out_tongue:

Awesome, i’m always looking for a big radius AO. Also have you tried to modified the specular buffer in unity 5, it could be awesome if this also work as specular occlusion.

Hello sonicether, it is great to see you work on something again!

  • Does your SSAO work well in combination with your bloom asset?
  • Is it possible to draw your SSAO more intensely? What I like about SSAO Pro ( Unity Asset Store - The Best Assets for Game Making ) is the intensity of the black in all the crevices and details. I don’t see that in quiet the same way on your example screenshot, though it sure is better than the inbuilt SSAO.
  • The main reason I did not buy SSAO Pro is the near clip requirement on your camera. SSAO Pro requires you to set your Camera’s near clip plane to at least 0.3, better yet 0.5 or 0.6… and that is unacceptable for my project. How about your asset, does it have the same restriction or does the lowest near clip setting work well too?
  • Does it work well in Unity 5?

Thanks for answering my questions.