Daemon icon indicating copy to clipboard operation
Daemon copied to clipboard

SSAO displayed above fog from behind wall

Open illwieckz opened this issue 4 years ago • 9 comments

On this screenshot (hangar28 map), there is a fog between the player's eyes and the wall, though, the SSAO dark corner is visible.

ssao above fog from behind wall

I noticed SSAO is not done on skybox textures, so maybe we can exclude such surface as well.

For a start, we must check if SSAO is drawn on surfaces with nolightmap, I guess it must not.

illwieckz avatar Oct 13 '21 02:10 illwieckz

We may think about doing SSAO before fogging, but maybe just making sure SSAO is not drawn on nolightmap surfaces if such surfaces are using nolightmap may be enough.

illwieckz avatar Oct 13 '21 02:10 illwieckz

I confirm this surface has nolightmap, so SSAO should not be painted. I've verified the SSAO GLSL code has exception for skyboxes, but not for nolightmap surfaces.

illwieckz avatar Oct 13 '21 02:10 illwieckz

In GLSL code, the skybox check is done by reading the depth map and testing if the depth is at its maximum, the same method can't be done for nolightmap.

illwieckz avatar Oct 13 '21 02:10 illwieckz

I think "screen-space" means that it is a post-processing effect operating on the entire screen at once, so there is no operation on individual textures.

slipher avatar Oct 13 '21 02:10 slipher

Yes, and it looks like skybox pixels are detected by testing if current pixel in depth map has maximum, so to exclude nolightmap surface from SSAO we would have to do a special map, that looks uselessly costly, or maybe there is a way to hack the depth map, but I'm not sure there is some remaining channel to store extra data in.

illwieckz avatar Oct 18 '21 03:10 illwieckz

I was wondering if SSAO even makes sense in a game with pre-computed lightmaps. Probably most of the recessed areas it detects would be the interaction map geometry with itself, which could be found at light-mapping time. Or areas within models themselves, which the modeler should account for himself to make sure it looks good with naive lighting.

https://vr.arvilab.com/blog/ambient-occlusion suggests that it is still useful because lightmaps may be too low-resolution compared to the map geometry.

slipher avatar Oct 31 '21 08:10 slipher

What SSAO is useful for is for angles between models and the map, even if SSAO like dirtmapping is physically wrong (or not that right), it can really help the mind to not falsely believe the model is floating above the floor by clearly showing there is an angle between the world surface and the model surface and that those two surfaces make a contact.

illwieckz avatar Jan 03 '23 11:01 illwieckz