Corners Don't Look Like That: Regarding Screenspace Ambient Occlusion (2012)

11 years ago (nothings.org)

Having more of the history of SSAO, and measuring some rendered images in the same way, would help this article..

Several corrections here:

1) Historically, SSAO was never intended solve wall corners. That was already being done with baked textures, in games like Doom and Quake. It was first used in CryEngine to show deep crevices in fabric folds, and plants. Objects that capture light.

2) The examples of 'ugly' artifacts are just that, incorrect implementations. There should be no halo or shadow around objects, which is caused by not implementing a smart-blur, which is required for SSAO.

3) Even in scenes containing walls, SSAO is often better because - other than baked lighting - the alternative was just straight Phong illumination, which gives essentially a straight line profile using the technique the author describes. Analyze corners for regular Phong and SSAO in the same way, and you'll find Phong is the worse of them. For example, regarding the images where the author says "And sure enough, the darkening is way less prominent here than I think it is visually.." What is not realized is that, with basic phong rendering, those gradual curves >would be flat lines< since the surface normals are constant. So yes, the effect is quite subtle, but we are still seeing a profile curve which has a 'curve' to it, and we notice (feel/see) that.

4) SSAO is now replaced by HBAO, and even further by VXGI (Voxel cone tracing) and other GI methods that truly solve wall corners in the correct way. Most of what the author is measuring here is multi-bounce lighting, which is correctly simulated by these new techniques.

Each method has its particular uses, and SSAO fits into that history for specific needs.

(Full disclosure: I work for NVIDIA, but the thoughts expressed here are my own.)

You can criticize SSAO/SAO as much as you want, but it can add spectacular details.

Here is a Viking Shield that I setup shading on:

https://clara.io/view/01529814-3164-449a-8765-61a77cf780e0

Then I added this SAO/SSAO pass:

https://clara.io/view/966d2196-8573-47df-b9c2-bd6e1ad65a73

And the result is this, which I think is dramatically better than what I began with:

https://clara.io/view/d59d26ab-c26e-4fa0-8907-d52c0c8acc1a

I find the end result has significantly more detail and feeling of depth than what I started out with.

  • SSAO is IMO the wrong tool for a cool effect. If you 3D printed your shield and put it in real lighting conditions you would not see shadows that look anything like what you have in your SSAO pass.

    Like the other poster said, what you've simulated instead is the accumulation of dirt. It looks better not because it's more realistically lit, but because it's more realistically dirty.

    If you want to achieve dirt accumulation, there have always been many tools that were able to generate "dirt" textures by analyzing geometry, they achieve very much the same results, without the runtime performance hit - and without the negative scenario where the SSAO is "dirtying" up literally every edge and crevice being rendered.

    I think SSAO is largely a fad, and not a particularly great one at that, but it's less visually offensive than the current trend of injecting a massive amount of chromatic aberration into every game, like you're playing the game through the bottom of a Coke bottle.

  • I'd say it looks better because it's mimicking accumulation of dirt in the cracks moreso than mimicking the light/shadow.

    SSAO a perfectly useful tool for that, but it's definitely more applicable to a shield than to an interior corner of a room.

  • The "after" version just looks like a bunch of crude drop shadow added at various spots. At close distance the original looks much better with finer texture and more believable details, but the version with the shading might be better for a prop to be seen from very far away / at small size, similar to exaggerated stage make-up on actors that looks gross up close.

If you run a real radiosity renderer, you get proper darkening at corners. Here's a Blender rendering with a good radiosity renderer. Note that some inside corners have darkening, and some don't, depending on how they're lighted.[1][2]

Full radiosity renderers are slow. The image is rendered over and over again, each pass using the previous result, with all surfaces now being light sources. Each pass thus shows the result of light being reflected one more time. The corner-darkening effect comes from indirect lighting from the opposite face, an effect which gets smaller as you approach the corner. With some renderers, you can watch the passes, as the image changes from starkly lit to very realistic. Render farms for movie production spend most of their time doing just this.

Game hardware cannot yet do true radiosity in real time, so there are many ways to fake it. Some better than others.

[1] http://s10.photobucket.com/user/RCRuiz/media/3dTest/Illumina... [2] http://wiki.blender.org/index.php/Doc:2.4/Manual/Lighting/Ra...

  • I'm not sure you are right in saying that movies are typically rendered with radiosity. Global illumination, yes. Radiosity only deals with diffuse surfaces, not specular reflection or arbitrary BRDFs, right?

A common abuse of SSAO I see among early users: using it everywhere. SSAO is technically only supposed to occur where there is a lack of lighting (where there is only ambient lighting). That said I think it is still fine to apply it unrealistically if the results look "good" -- maybe even preferable for some people as I tend to enjoy stylized rendering over totally realistic rendering.

  • > A common abuse of SSAO I see among early users: using it everywhere.

    See also: every other graphic trick ever. HDR, bloom, lens flares, bump maps, normal maps, etc.

    Basically, when a new rendering trick comes on the scene, everyone cranks it to 11 to show off that their engine can do it and to stand out from the older ones that don't. Then, eventually, they dial it down to something more reasonable.

    It's fashion, plain and simple. The masses want to mimic high end fashion, so styles "flow downhill" from the avant garde to the rest. Meanwhile, the avant garde want to distinguish themselves from the masses, so they have to constantly come up with new things (or repurpose old things that have fallen out of use: see, pixel art). It's not about looking good as much as it is about looking uncommon.

These graphs make things look more official, but the fact that he's judging luminosity in sRGB (a non-linear space) makes me think they're basically rubbish.

I mean, yeah, SSAO is a gimmicky trick... but so what?

  • Sean Barrett is a long-time expert and well-known developer in the area of computer graphics.

    If you had bothered to read the article, the author attempts to address that concern:

    But we can at least understand how we're perceiving the pictures, since they're being displayed as (hopefully) sRGB. They may not reflect reality that well, but we can at least determine the degree to which the numbers in the pictures actually are darkening, and the degree to which it's a perceptual effect we get.

    • I know who he is. Hey we can disagree with experts on the Internet. Neat huh.

      I did read that part. Just because he acknowledged it doesn't make the data any better. He mentions that you can get a relative idea of the darkening, but the reason gamma correction is done in the first place is because the perception is different between screens -- and browsers don't really properly gamma correct images.

      I don't even disagree with him - Ssao is unrealistic. I just don't get what all this "data" is meant to prove. Nobody is claiming it's realistic, it's just aesthetically nicer than just plain direct lighting (in some people's opinion)

I think HDR photography has some influence too. "Normal" photo-realism isn't necessarily the benchmark for renders anymore. Not when HDR looks so good when done right (subtle).

Take this photo of a room. The HDR is subtle, and reveals shadows in the corners that wouldn't be there without HDR.

http://www.vangviet.com/wp-content/uploads/lovely-separation...

Game graphics aren't known for subtlety. So the cheesy overdone HDR photography that burns our eyes, has found its way into gaming graphics. GTA5 generally looks great, but I noticed the overcooked corner shadows.

If I were a neural net learning to tell real light vs ambient occlusion, I'd immediately learn to look for the spider webs. I was fascinated by this article and loved the author's approach of graphing real photos. But I got a giggle when I started seeing the prominent spider webs.