
Corners Don't Look Like That: Regarding Screenspace Ambient Occlusion (2012) - epsylon
http://nothings.org/gamedev/ssao/
======
rchoetzlein
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.)

------
Animats
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...](http://s10.photobucket.com/user/RCRuiz/media/3dTest/IlluminationInternalRadiosmallAO01.png.html)
[2]
[http://wiki.blender.org/index.php/Doc:2.4/Manual/Lighting/Ra...](http://wiki.blender.org/index.php/Doc:2.4/Manual/Lighting/Radiosity)

~~~
theoh
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?

~~~
bananaboy
Radiosity is a form of global illumination, so I'm not sure what you mean when
you say global illumination.

------
bhouston
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](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](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](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.

~~~
potatolicious
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.

~~~
moron4hire
>it's less visually offensive than the current trend of injecting a massive
amount of chromatic aberration into every game

Are you sure you aren't playing the game in a mode intended for the Oculus
Rift?

~~~
potatolicious
Ahah, I'm pretty sure I'd have noticed the L/R splitscreen ;)

This is deliberate aesthetic chromatic aberration and it's annoying as hell.
Here's an example from Alien Isolation (though in its defense, it might be the
only such game that can justify it):

[http://www.pcinvasion.com/wp-
content/uploads/2014/10/Alien-I...](http://www.pcinvasion.com/wp-
content/uploads/2014/10/Alien-Isolation-impressions-20.jpg)

Here's a bunch more samples, from games that aren't even intended to be retro
(well, Medieval is retro in a way I suppose):
[http://www.neogaf.com/forum/showthread.php?t=1018237](http://www.neogaf.com/forum/showthread.php?t=1018237)

The worst part about this gross slathering of chromatic aberration everywhere
is that it's not even remotely accurate - camera optics were _never that bad_.
Most film/still cameras suffer from CA but the sheer magnitude of it in games
is way beyond anything you can get out of even cheapo equipment.

I just don't get why we have to simulate looking through a really shitty 1950s
camera (that has been hit with a hammer a few times just to make sure all the
glass is nice and loose) when playing games. With the Aliens game at least the
shittiness fits with the retro-80s style, what's everyone else's excuse?

------
overgard
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?

~~~
binarycrusader
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._

~~~
overgard
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)

------
gavanwoolery
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.

~~~
munificent
> 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_.

------
exodust
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...](http://www.vangviet.com/wp-content/uploads/lovely-separation-
house-bedroom-interior-graphy.jpg)

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.

------
unoti
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.

