SSAO Discussion

User avatar
Vinnie Terranova
Posts: 5101
Joined: 09 Nov 2017 10:24
Location: Netherlands

SSAO Discussion

#1 Post by Vinnie Terranova » 06 Jul 2020 20:23

I decided to start a topic about the new graphical feature SSAO (Screen Space Ambient Occlusion) which will come with the v1.38 updates of ATS and ETS2.
Although in the blog SSAO is explained in great detail, it's also quite a technical story, which led to a number of questions for me.

1) As far as I understand there are two main things that cause shadows: objects blocking light sources (sun, street lights, headlight) and objects blocking the sky (i.e. AO).
As the sun is moving during the day it causes dynamic shadows. Street lights and headlights also cause dynamic shadows.
These two things are causing the shadows. And these two things are both affecting performance. Is it possible to have just one thing that will cause all the shadows? Is that technically possible?

2) What's the difference between GTAO and HBAO? Which one is SCS using, as in the blog SCS speaks of both GTAO and HBAO.

3) In some screenshots it's clearly noticable that there is a problem with shadows in general: all the shadows are hard shadows, while in real life most shadows are soft shadows. Does SCS have any plans to implement soft shadows in the future?

4) SSAO makes use of the sky to calculate the amount of occlusion. What about a clouded sky / a rainy day / the night sky? Will there be less ambient occlusion or even none at all? Or will the ambient occlusion still be calculated, even at night?

5) Till how far will the ambient occlusion effect be visible? I don't think that it has to be visible on the whole screen: both ATS and ETS2 have not a really long drawing distance, and objects that are yet far away are not drawn very detailed or are drawn in a low resolution. Is it necessary to calculate SSAO for those far objects? If not, that would mean better performance?

6) Is it possible to put the part of the game that disappears from screen in a temporarely memory location so that it still can be used by the algorithm for occlusion evaluation?

These are my question for now. I really love that SSAO blog!
Dirk221
Posts: 271
Joined: 28 Apr 2018 18:33

Re: SSAO Discussion

#2 Post by Dirk221 » 06 Jul 2020 20:27

I love SSAO! Gives more depth in the world and in the interiors :)
yozza
Posts: 377
Joined: 18 Apr 2013 16:52

Re: SSAO Discussion

#3 Post by yozza » 06 Jul 2020 20:44

Would SSAO effect game performance in anyway i.e would it cause the game to lag/stutter
User avatar
xXCARL1992Xx
Posts: 16527
Joined: 17 Aug 2016 12:18
Contact:

Re: SSAO Discussion

#4 Post by xXCARL1992Xx » 06 Jul 2020 21:06

1. there is only one thing, any object that blocks the sun (the point SCS choose to emit "light" from) will be occluded

2. GTAO is Ground Truth Ambient Occlusion, HBAO/HDAO is Horizon Based Ambient Occlusion (Nvidia)/Horizon Defined Ambient Occlusion (AMD), SCS uses GTAO, wich is newer

3. soft shadows like in the real world are only really doable via Raytracing, everything else would be just faking it wich could look even worse then hard edges

4. SSAO uses the amount of light to calculate occlusion, is what i understand, no light, no occlusion to calculate

5. it is as far visible as SCS set it, how far i cant say, someone from SCS would have to answer this but i bet it isnt really far because of performance reasons

6. the name says it all Screen Space Ambient Occlusion, it can only use what is currently rendered on the screen to calculate occlusion because it is done "on the fly" after the image is already finished rendering, what isnt rendered, cant be occluded, again, for this you would need raytracing, this would take everything into consideration even if you dont see the object that is behind you in screen space
| !!!NO SUPPORT OR REQUESTS OF ANY SORT VIA PM!!! | Screenshot Thread | Steam Workshop | World of Trucks Profil |
[ external image ]
User avatar
SiSL
SCS Software
Posts: 8686
Joined: 27 Oct 2013 06:23
Contact:

Re: SSAO Discussion

#5 Post by SiSL » 06 Jul 2020 22:07

Ambient Occlussion are not shadows. So it is independent on time of the day, weather or sun position. It is calculation of how much of existing light source will be available to reach object or not because of other objects. So even at night, there is AO.
Some newbie driver
Posts: 7193
Joined: 12 Dec 2018 11:37

Re: SSAO Discussion

#6 Post by Some newbie driver » 06 Jul 2020 22:32

Well, under the hood blog explains lots of things, but you still have some details not all clear, Vinnie Terranova. Let's see if I could explain them easier and (cough) shorter (cough)

Hard shadows aren't the ones with a clear line defining it or that are more darker; hard shadows are just the ones created by an object directly blocking a light source (and this includes the Sun!). Hard shadows are NOT the the work that any AO technology care of. So, first thing first, those shadows AO creates aren't hard ones.

Now, try to imagine any scene out in the country in the middle of nowhere with the Sun already rising but still behind a mountain range. There will be no source light that you could directly see, but anyways there will be some degree of light. That's the ambient light; a light that doesn't arrive to you from a punctual well-defined source but that it's the result of light rays being reflected and scattered once and once again thousands of times in every object, every surface, every air atom they hit. That's why it's called "ambient light", it comes from everywhere, it's in the ambient as if it was the air itself that surrounds you and that fills every space.

In any 3D scenario generated by computer, the ambient light is defined with a color and intensity that it's applied uniformly to all the scene at a given moment. That's the light that gives the world its plain basic aspect (with no shadows, no reflections, no shiny points anywhere from the light will come...). The problem with that light is, as I said, that it is applied exactly with the same color and intensity everywhere in the scene. And that's not realistically, because even IRL "ambient light" comes from everywhere, it doesn't do it in the same strength (neither color, but let's that for another day). Fake 3D ambient light causes that "plain" aspect where it's difficult to distinguish the individual objects in a "field" of similar color.

There's a phenomenon that happens always with ambient light IRL and that AO try to mimic. And as our eyes haven't seen never the world without that happening, that's the reason AO is so subtle and so many people says "I don't notice any change with AO" (until they get used to it and, all of a sudden, they disable it). That phenomenon is that closer objects cast shadows in between them or even in their joining points. And that's because those objects are reducing (occluding) the ambient light the other near objects receive. That's the reason of the "ambient occlusion" name. And that's why 3D scenarios can't be realistic with just regular light sources and shadows (no matter how well made) and regular ambient light. Because none of those could mimic the occlusion on near objects present everywhere IRL.

The more realistically way to calculate any light and shadow (occlusions included) would be to use ray tracing. That could sound modern to most people (it's only available for the biggest graphic cards on last years). But ray tracing has been known as a technique for more than 30 years. It's just that it requires such a ridiculously high amount of raw power to calculate the ray tracing of a 3D scene, even the simpler one, that it make impossible to apply it in real time games until recently. It was used since time ago in 3D movies, for example, where each FRAME took several DAYS to be rendered by SEVERAL powerful machines. Go imagine, playing in your computer a game at 1FPM (frame per month :shock: ).

Here's where AO techniques enter into play. They are an extreme simplification of the calculations needed to depict ambient occlusion on a 3D scene. They doesn't use the whole 3D scene with all their objects, source lights and interactions (that would be ray tracing). Instead of that, AO techniques are applied after the 3D scene has been converted into a plain 2D pixelate view to be seen on display. And over that 2D image, they apply some loose calculations and suppositions based on auxiliary 3D information that come from the original scene. The way those calculations are made and the kind of suppositions they do gives you the different specific AO techniques and the levels of application on the scene (the different levels we can select in options menu).

All that I explained means all those techniques' performance is invariant to the complexity of the scene. Because they don't care about the 3D scene, they care only (there's details in some of them) of what you are going to see on your screen in a given frame. That makes the AO techniques a lot more easier to calculate than ray tracing, graphic engine is discarding 99,99999% of the 3D world information and will use just a tiny fraction to calculate some shadows only in the part of that 3D world you are looking at on every moment. That also means that, as so many 3D world information is discarded (and the AO techniques works based on suppositions and simplified calculations), it's impossible that any AO technology gives a 100% accurate and realistic result. There will always be some combinations of objects in dome relative positions, sizes and shapes that will cause fake shadows to appear (like the forklift driver in the images of the blog post). And what is worse, those AO created shadows will change as the FOV where do you look changes too (even if the lights of the scene are all completely static).

Regards
dj212
Posts: 26
Joined: 10 May 2018 13:16

Re: SSAO Discussion

#7 Post by dj212 » 07 Jul 2020 13:38

I'm also really enjoying SSAO, and I've been impressed by how well it performs on my older hardware (I have a GeForce 970).

The blog post was great, and I hope we get similar posts for future graphics improvements. It's fun to get a peek behind the scenes. :-)
User avatar
Vinnie Terranova
Posts: 5101
Joined: 09 Nov 2017 10:24
Location: Netherlands

Re: SSAO Discussion

#8 Post by Vinnie Terranova » 07 Jul 2020 21:07

Big thanks to @xXCARL1992Xx, SiSL and @Some newbie driver for clearifying some stuff. But still I have some questions.

1) How does GTAO work? How does it differ from HBAO?

2) How is the amount of ambient light determined (clear sky, overcast, at night)? If the amount of ambient light is very low, what use would it have to apply SSAO, as the effect would be minimal?

3) About raytracing: there are very few games who uses raytracing: Quake Wars: Ray Traced, Wolfenstein: Ray Traced, The Tomorrow Children and Battlefield V. So I think it is too early to implement it in ATS/ETS2. But what about the future? Is there a realistic chance that it might be implemented in ATS/ETS2 in, lets say, 5 years from now? Ofcourse it will take a lot of processing power. But it is doable as the before mentioned games show. And although it will take a lot of processing power, other graphic effects, like SSAO, won't be necessary anymore.

4) What about the mirrors? Will there be SSAO visible in the mirrors?

Thanks again for all your explanations. It's really interesting, and SSAO becomes more and more clear for me.
Some newbie driver
Posts: 7193
Joined: 12 Dec 2018 11:37

Re: SSAO Discussion

#9 Post by Some newbie driver » 07 Jul 2020 22:12

Here we go...

1) Different AO techniques are in the mathematics of how they calculate the shadowing and why they chose one or other approach. It's really technical and beyond what I can explain properly. I've find that article with lots of examples and a looong explanation of the different techniques: https://vr.arvilab.com/blog/ambient-occlusion If you have time and patience, probably you find some answers you are looking for

2) The programmers decide the base levels of ambient light that must be in every moment. In the case of ETS2/ATS, three basic parameters are the hour and map coordinates, that indicate how much sun will be visible and then the overall base value for ambient light. Sun is its main source with a BIG difference and others light sources could be easily neglected in open scenarios (but for example, the game has to change that value when we enter a tunnel)

3) I opined already in other thread that I doubt we see RT in SCS games before 10 years. There's lots of other things to do first and RT will keep demanding very high-level hardware for a long time. It's not a feature that suits the kind of average players of SCS games until RT becomes available in a more mainstream hardware. And you are right, with RT the graphic card will be freed of AO workload, but that's just the cherry of the cake. You have to understand that RT workload is MASSIVE, in several orders of magnitude over AO (that's why AO exist). RT alone it's probably heavier in requirements that everything else the graphic card would need to do when being used in those games you mention. Have in mind that RT has been known (and used) for more than 30 years, but it has take all this time to achieve to use it in real-time. 30 years developing it in computer is like something that comes from the medieval era. And even so, the RT used on those games is still "limited" in how they apply it. There's still a lot of years to fully develop it in triple-A games.

4) That's a good question that should be answered by devs. I doubt it will be used in virtual mirrors. The other ones, I suppose it will depend on how they are added to the final render image.

Regards
User avatar
Vinnie Terranova
Posts: 5101
Joined: 09 Nov 2017 10:24
Location: Netherlands

Re: SSAO Discussion

#10 Post by Vinnie Terranova » 08 Jul 2020 19:38

@Some newbie driver, thanks again for your answers. And that article you found was very helpful! So, thanks for that, too!

I think that something is quite wrong with SSAO in ATS... Take a look at this video of the Viewpoint Feature. Especially take a close look to the left side of the screen, as the truck slowly drives to the end of the prefab (from 0:55 till 1:11): You will notice that at the left side of the screen the SSAO effect disappears. It looks like fuel pump, and chairs are disappearing...

I think this has something to do with the fact that SCS uses Screen Space for calculating the amount of ambient occlusion: as there is less 3D information available at the sides (and top and border) of the screen, this will lead to an artifact. In this case the artifact is that ambient occlusion disappears at the sides (and top/border) of the screen, due to miscalculation of the amount of ambient occlusion.
Post Reply

Return to “General discussion about the game”

Who is online

Users browsing this forum: soliver and 11 guests