Scalable Ambient Obscurance and Other algorithms

Started by
8 comments, last by neoragex 7 years, 11 months ago

Hi there,

I am trying to implement Scalable Ambient Obscurance into Unity but I am facing some issues. I choosed this algorithm because of seems to be today one of the most optimized method according to the quality. HBAO is also very appreciated as it gives great and accurate results but it requires also more performances.

Edit : As the issue has been solved, I would like to know more about other Ambient Obscurance algorithm. It seems that there are a lot available today : http://frederikaalund.com/a-comparative-study-of-screen-space-ambient-occlusion-methods/

It seems that SAO is a good balance between performance and quality, HBAO seems to be really accurate but also costs a lot of resources.

I also discovered Unreal Distance Field Ambient Occlusion which gives nice results.

But as the above paper is from 2013, there might be today some new algorithms with better results.

What do you think ? Any advice ?

Thank you !

Old :

As I said, I am facing some issues but I don't know where they might come from. I tried to port the code from the demo into Unity but without any interesting result. Here is multiple outputs.

[attachment=31804:screen.jpg]

And here is my implementation. I don't know if this comes from bad normals, bad matrices or anything else... :(


// Old code available in post history.

Any help, explanation or clue is welcome !

Thank you very much.

Advertisement
Sao don't use normals, it computes them from the linear depth buffer.

It looks like your sampling depth from the same uv.
You need to sample at pixel location and at each of the samples.

Thanks for your answer @vlj !

Problem solved, I also edited the question.

I didn't see newer ssao algorithm so far. However it looks like there is some works going into voxel based solution, for instance in the latest tomb raider

I'm integrating AOFX at the moment -- an SSAO/HBAO/etc variant that's been optimized specifically for modern AMD GPU's (and should run well on NVidia too).

For fine details, pre-baked AO textures and SSAO are still a good choice.

For large scale AO, nothing beats being able to bake lightmaps for your scenes, if they're static :wink:

There's surface transfer stuff, like: http://http.developer.nvidia.com/GPUGems2/gpugems2_chapter14.html

Voxel AO and Distance Field AO as mentioned are good for mid-range AO that can't be baked or captured from screen-space data.

There's also 3D AO "decals" -- pre-baking AO fields into a 3D texture, and then splatting them into the scene -- which is good for non-animating props that can be moved dynamically (or when you don't want to bake your whole scenes).

BTW how do you store result of backing calculation? Objects texture's uv can't be reused since an object can appear at different location with different lighting condition, and some texel can be used for several surface.
On the other hand flattening polygon in a 2d plane is though due discontinuity at polygon edge, having to optimize texture space while keeping surface size equivalent...

BTW how do you store result of backing calculation? Objects texture's uv can't be reused since an object can appear at different location with different lighting condition, and some texel can be used for several surface.
On the other hand flattening polygon in a 2d plane is though due discontinuity at polygon edge, having to optimize texture space while keeping surface size equivalent...

Typically with a separate UV set for lightmap UVs (to support having a different texel density, and also to avoid issues where UV regions are reused for texturing) and then a scale/bias to look the individual object up within a larger atlas passed in as either a per-instance attribute or a shader constant.

SAO is a good solution for near-middle scale AO. But the implementation of its original paper will only give some very low AO qualities by using a simple random sampling strategy. Here is my favourite modified solution: a proper SAO implementation + IGN dithering will be good enough for middle-scale AO :). worth to have a try!

Cd2Gy1pUEAEN0N6.jpg

Hey @neoragex, this is a nice ao with a great contact shadow (even if it's a bit to strong :D) Can you tell more about your implementation ?

Would it be possible to include some kind of color bleeding ?

Nothing magic but common dithering tricks to optimize the distribution of random sampling. :) There are so many feasible ways to get some kinda of color bleeding, such as SE-SSAO,SSDO,S3HO etc. Most of them are screen-space based and can be easily intergrated with a proper SSAO solution.

This topic is closed to new replies.

Advertisement