Skip to main content
gamedev.net
🔒 Locked

Image Space Ambient Occlusion

Started by vfetch 11 replies 9k views
Original Post
vfetch
vfetch
This paper presents 2 methods of ambient occlusion (low frequency and high). The image-space solution is really interesting. It runs as a "post process", and looks promising (given the cost) I think - but I'm not sure - that Crysis is using a similar technique (called "realtime ambient maps" in their video) http://www.cs.utexas.edu/~perumaal/FINAL-paper121.pdf -- ryan
remigius
remigius
I'm going through the paper now, but I doubt the "realtime ambient maps" in that video use the post-process approach to ambient occlusion. We ran some similar experiments to image-space postprocessing as well, but getting any level of acceptable detail proved to be too big a drain on performance, for our implementation at least. This seems to be confirmed by the results mentioned in the paper:

GeForce 6800 3-5 fpsGeForce 7800 GT 3-8 fpsGeForce 7950 GX2 3-13 fpsGeForce 8800 GTX 17-30 fps


Unfortunately I haven't talked to Perumaal himself, but I came across his site during our experiments and compared our own (informal) results with his. He had a good headstart and implemented various optimizations and improvements our tests lacked, but at first glance it seems he's still constrained by the problem we faced. For dynamic local occlusions image space AO by itself works out ok (and fits in well with a deferred shading setup), but we found there's just too much data to process to get good results for both local and global occlusion at acceptable framerates. So you're kinda stuck with a tradeoff between good local results vs. a good global illumination approximation.

His hybrid approach is new to me (we experimented in Q3/Q4 2006), but it looks like a confirmation of that tradeoff.
vfetch
vfetch
Quote:
Original post by remigius
I'm going through the paper now, but I doubt the "realtime ambient maps" in that video use the post-process approach to ambient occlusion.


It is, actually. I talked to Martin - the lead graphics programmer on crysis, and this is what they are doing. It isn't "the same" as the utexas research, but it is a post-process, and it is screen-space.

Crysis does a z-pre-pass on everything at the head of the render, then extracts depth and uses it for the AO. They sample on a sphere "around" pixels in the depth buffer, and they either z-pass or z-fail. The ratio is an approximation of AO. Martin is presenting this at SIGGRAPH during his talk:

http://www.siggraph.org/s2007/attendees/courses/28.html

vfetch
vfetch
it's a course - not a paper, so it isn't "published" work by the ACM

i'll re-post from siggraph when i hear the details

(btw, anyone else going? if so - see ya in san diego)
Ashkan
Ashkan
Keep us informed on this one. :)
jerm
jerm
The real-time ambient maps in the video is not the same thing as the screen-space AO discussed above. The screens-space techniques are similar but the Crysis technique is a little more ad hoc and light-weight. I won't go into details since it will be presented at SIGGRAPH in less than a week.

I'll be in San Diego :)
vfetch
vfetch
from the crysis course notes

One of our creative programmers had the idea to use the z buffer data we already had in
a texture to compute some kind of ambient occlusion. The idea was tempting because
all opaque objects could be handled without special cases in constant time and constant
memory. We also could remove a lot of complexity in many areas. Our existing solutions
worked but it we had issues to handle all kind of dynamic situations.
The approach was based on sampling the surrounding of a pixel and with some simple
depth comparisons it was possible to compute a darkening factor to get silhouettes
around objects. To get the ambient occlusion look this effect was limited to only nearby
receivers. After several iterations and optimizations we finally had an unexpected new
feature and we called it “Screen-Space Ambient Occlusion” (SSAO).
We compute the screen-space ambient occlusion in a full screen pass. We
experimented by applying it on ambient, diffuse and specular shading but we found it
works best on ambient only. That was mostly because it changed the look away from
being realistic and that was one of our goals.
To reduce the sample count we vary the sample position for nearby pixels. The initial
sample positions are distributed around the origin in a sphere and the variation is
achieved by reflecting the sample positions on a random 3D plane through the origin.
n: the normalized random per pixel vector from the texture
i: one of the 3D sample positions in a sphere
float3 reflect( float3 i, float3 n ) { return i - 2 * dot(i, n) * n;
The reflection is simple to compute and it’s enough to store the normalized plane normal
in a texture.
vfetch
vfetch
and, real-time ambient maps (RAM)

As an alternative we chose a much simpler solution which only required storing one
scalar ambient occlusion value per texel. Ambient occlusion ([ZIK98, Landis02]) can be
computed by shooting rays in all directions – something that was reusable from the
photon mapper. The reconstruction in the shader was using what was available: the texel with the occlusion value, the light position relative to the surface, the light color and
the surface normal. The result was a crude approximation of indirect lighting but the
human eye is very forgiving for indirect lighting so it worked out very well.
To support normal maps some average light direction is needed and because of the lack
of something better the light direction blended with the surface normal was used. This
way the normal maps still can be seen and shading appear to have some light angle
dependency. Having ambient brightness, color and attenuation curve adjustable allowed
designers to tweak the final look.
The technique was greater extended to take portals into account, to combine multiple
lights and to support the sun. For huge outdoor areas computing the RAM data for every
surface wouldn’t be feasible so we approached that differently.
billy_zelsnack
billy_zelsnack
Damn ACM crap! Alright.. Whose a lamb and can mail this to me?
very unhelpful and/or unfriendly

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.