Page 1 of 1

Screen Space Ambient Occlusion (SSAO) widget

Posted: 28 Apr 2019, 13:09
by ivand
Hi.

I've decided to make a public release of SSAO widget.

If you don't know what SSAO is, please refer to https://en.wikipedia.org/wiki/Screen_sp ... _occlusion

You can also notice how it works on this side-to-side pic:
Image

The main difference to some other SSAO spring implementations, you can find in the wilds, that it doesn't freak out on the zoom out (due to g-buffer undersampling) and should handle subtle differences between different GPUs and drivers better.

The widget requires:
1) enabled deferred rendering for both models and map (AllowDeferredMapRendering = 1 and AllowDeferredModelRendering = 1)
2) /advmapshading /advmodelshading turned on
3) More or less recent maintenance branch of the engine (aka 104+). It might work on the older engines, but I give no warranty nor give any estimates whether it will or not.

Should you have any questions or encounter bugs, let me know here or open up the issue on github repo:
https://github.com/lhog/spring-ssao

Re: Screen Space Ambient Occlusion (SSAO) widget

Posted: 04 May 2019, 16:50
by Google_Frog
It's cool that this sort of stuff can be done in screen space.

Re: Screen Space Ambient Occlusion (SSAO) widget

Posted: 08 May 2019, 21:57
by raaar
what's the performance impact of that?

Re: Screen Space Ambient Occlusion (SSAO) widget

Posted: 09 May 2019, 02:32
by ivand
There are a number of configuration parameters that affect the performance and quality to some degree. The default settings are tunned for quality (although artistic appearance might need some adjustments).

Generally it is certainly not free. Last time I checked the impact was around 10 out of 130 FPS for me. You need to test it yourself though as different resolutions, drivers and GPU might perform vastly different.

Re: Screen Space Ambient Occlusion (SSAO) widget

Posted: 10 May 2019, 01:00
by Forboding Angel

Re: Screen Space Ambient Occlusion (SSAO) widget

Posted: 10 May 2019, 07:48
by ivand
Hi. Thanks for reporting.

I'll be on vacation for several days. In the meantime can you do me a favor:
1) Can you tell if other deferred widgets like lights, bloom work for you?
2) Did you change anything in my source code?
3) Can you make screenshots on some brighter map and upload them as attachments to the forum? Imgur is hard to use on my smartphone.
4) Can you change BLUR_PASSES to 0 and after SSAO_KERNEL_SIZE to say 8 and report whether these two steps changed anything. If not I'll find you on discord when I'm back.

Re: Screen Space Ambient Occlusion (SSAO) widget

Posted: 10 May 2019, 09:20
by Forboding Angel
So far, this only happened on that specific map. Haven't been able to reproduce on any other map
1. All is working and so is SSAO
2. Nope
3. Sure, but any screenshots I take wouldn't help as it's working on other maps just fine as far as I can tell
4. Will test when i get a chance

I was mainly showing this so that perhaps it might help you find a potential oops that might cause it to mess up on specific maps (dark ones?)

Re: Screen Space Ambient Occlusion (SSAO) widget

Posted: 10 May 2019, 09:30
by ivand
Makes sense. I never tested on Onyx. Thanks again.

Perhaps the normal maps from DNTS are such that they make already dark maps, look even darker. Maybe I can add additional checks in the SSAO pass so dark areas are not getting even darker or limit the SSAO to models only.

Re: Screen Space Ambient Occlusion (SSAO) widget

Posted: 12 May 2019, 12:30
by very_bad_soldier
Has someone screenshots at hand that show how this looks in a regular game (in a regular distance)?

Re: Screen Space Ambient Occlusion (SSAO) widget

Posted: 12 May 2019, 19:11
by ivand
There were several screenshots posted in the BAR discord channel. Unsure if you have an invitation to be there, alternatively you might want to have a look yourself. It usually takes around 5 minutes to set up a widget.

Re: Screen Space Ambient Occlusion (SSAO) widget

Posted: 15 May 2019, 18:17
by very_bad_soldier
Ok, I understand, thanks anyway.

Re: Screen Space Ambient Occlusion (SSAO) widget

Posted: 15 May 2019, 19:19
by ivand
I'll also post some pics here when I'm back from vacation.

Re: Screen Space Ambient Occlusion (SSAO) widget

Posted: 21 May 2019, 03:38
by Forboding Angel
I can't tell that this has any effect at all on my s3o units. It definitely effects features:
Off
https://i.imgur.com/R0kE87r.jpg

On
https://i.imgur.com/1lH7cWD.jpg

Am I missing something?

Re: Screen Space Ambient Occlusion (SSAO) widget

Posted: 21 May 2019, 07:31
by ivand
This is easy to explain.

Looking at your CUS materials I can see, that deferred definitions are missing in https://github.com/EvolutionRTS/Evoluti ... apping.lua , which is responsible for rendering units with normal maps. CUS is structured such, that if you don't specify deferred shader and respective definitions, then deferred rendering path is disabled for such materials. This issue is easy to miss, because deferred is mostly used for dynamic lights system and if model's g-buffer information is missing, then light is effectively calculated based on the terrain g-buffer data.

ZK had similar issue, so I put a small widget that highlights what models have deferred path. You can witness how things look under the hood yourself: https://github.com/ZeroK-RTS/Zero-K/blo ... d_test.lua
The fix is also rather simple, you need to specify deferred shader and definitions, so models are indeed rendered into respective g-buffer. Something like this should work: https://github.com/ZeroK-RTS/Zero-K/com ... d6ab1791b2

P.S. I updated the widget slightly for another game and will put changes to the common repository soon.

Re: Screen Space Ambient Occlusion (SSAO) widget

Posted: 21 May 2019, 17:02
by ivand
As promised before, here are some pics.

I changed widget such that only bottom part of the screen is SSAO enabled (another words you should compare top part of the screen to the bottom one).

Image
Image
Image

Re: Screen Space Ambient Occlusion (SSAO) widget

Posted: 25 May 2019, 16:50
by PicassoCT
Seems to only affect the chili menue in Journeywar.
Image

Image

PS: Deactivated all the chilli widgetry - even then no Unit-AO. Sad Panda.

Re: Screen Space Ambient Occlusion (SSAO) widget

Posted: 26 May 2019, 11:08
by ivand
Do you have deferred shading enabled ?
AdvMap/AdvModel shading ?

Are you seeing normal map if you use test widget I suggested https://github.com/ZeroK-RTS/Zero-K/blo ... d_test.lua ?

Please follow the check-up steps I described here:
viewtopic.php?f=23&t=39443#p591153