Page 1 of 1

Screen space ambient occlusion

Posted: Fri Sep 14, 2007 1:54 am
by Falagard
I don't think this has been discussed here yet.

Crytek published a course paper about the technologies they used in Crysis. One that came up is Screen Space Ambient Occlusion.
Basically it is calculating ambient occlusion in realtime using the z buffer and some fancy tricks, or rendering the scene to a floating point texture and storing depth. No need to precalculate ambient occlusion maps, and works well for large scenes.

http://delivery.acm.org/10.1145/1290000 ... EN=6184618

There's a thread about it here on GameDev.net and some developers have actually started getting results with it:

http://www.gamedev.net/community/forums ... _id=463075

Screenshot below from one of the Gamedev.net posts:

http://www.rgba.org/iq/trastero/ssao6.jpg

I'm guessing within the next couple months some source code will materialize that we can look at and implement in Ogre.

Clay

Posted: Fri Sep 14, 2007 7:36 am
by Alexander
This is the first time I've seen the technique. Very interesting.

Posted: Fri Sep 14, 2007 8:44 am
by Fiesch
yup, nifty bit. Thanks for pointing that out

Posted: Fri Sep 14, 2007 9:02 am
by PolyVox
Cool! The paper is a bit short on details but the results are nice.

Posted: Fri Sep 14, 2007 10:26 am
by beaugard
This is so cool! My heart rate actually sped up when I read this :shock: . One of those ideas that seem so obvious once you hear it - those are always the best ones.

Shouldn't be too hard to implement, no?

Posted: Fri Sep 14, 2007 10:56 am
by jjp
I just wonder how this looks like when the camera is moving around. Because obviously you only get occlusion from things that are visible on the screen.

Posted: Fri Sep 14, 2007 2:48 pm
by Falagard
jjp wrote:I just wonder how this looks like when the camera is moving around. Because obviously you only get occlusion from things that are visible on the screen.
If Crysis is using it, the results have to be pretty decent.
This is so cool! My heart rate actually sped up when I read this Shocked . One of those ideas that seem so obvious once you hear it - those are always the best ones.

Shouldn't be too hard to implement, no?
Me too. If it works as well as I hope, this is THE solution I've been waiting for for large outdoor games where there is a dynamic moving sun.

It doesn't have anything directly to do with casting shadows from a sun, of course, but my problem is that I've been banging my head on how to implement a combination of ambient occlusion + dynamic shadows on a large scene. For example, if I had to baked ambient occlusion textures for all stuff outside it was going to be a nightmare, but if this is just a post process and it works quickly - wow. It's right up there with the invention of parallax mapping as a cool technology.

That's assuming that someone can get it working, and running fast.

There's another paper out there that implements something similar here:

http://www.cs.utexas.edu/~perumaal/FINAL-paper121.pdf

I saw this one quite a while back but the speed was far too slow for real games (15 to 30 fps on an 8800 GTX). However, the Crysis guys got it working, and that GameDev.net has some other developers playing with the technique and getting between 30 and 150 fps.

How easy will it be to implement? It depends if someone releases some source code :-)

Posted: Fri Sep 14, 2007 3:14 pm
by milliams
This technique really does look impressive, it would be a killer feature for OGRE to have. Maybe a SoC project for next year?

Posted: Fri Sep 14, 2007 4:00 pm
by Praetor
It looks slightly difficult to do, but not really hard. There seem to be some quality tweaking issues. The results look better than just local lighting which is the point. We don't need full ambient occlusion, just enough to fool our own brains, and this looks like it does that.

Posted: Fri Sep 14, 2007 4:19 pm
by jjp
Falagard wrote:If Crysis is using it, the results have to be pretty decent.
That's what I thought. I guess as they are using it only for the ambient component artifacts aren't really noticable. Still... I'd be interested if there are scenarios where this technique would not be usable.

Posted: Fri Sep 14, 2007 4:53 pm
by Dom
It's probably not that easy to get it running without too much artifacts as not all the details are disclosed. A buddy of mine tried it and there's also a discussion running on the gamedev list about it.

Posted: Fri Sep 14, 2007 4:58 pm
by Falagard
Dom wrote:and there's also a discussion running on the gamedev list about it.
Linked in my original post.

Posted: Fri Sep 14, 2007 11:39 pm
by milliams
Flavien Brebion (A.K.A. Ysaneya, developer on the Inifinity Engine) managed to get this technique running with framerates at around 150 (http://www.gamedev.net/community/forums ... ?jn=263350). It's not the fastest but it's certainly a good speed tradeoff considering the payback. Given the speed with which people seem to have developed early prototypes, it doesn't seem difficult to get working in a simple fashion.

Posted: Sat Oct 20, 2007 9:30 am
by Vectrex
The guy from the gameDev forums (first post) just released a demo of his own SSAO screenspace ambient occulusion with realtime fractals here in **4**k :D
There's a video of it for lower gfx cards otherwise SM3.0 is needed and it's pretty slow, not for the SSAO but the fractals.
http://rgba.scenesp.org/iq/demoscene/pr ... noiser.zip
from http://rgba.scenesp.org/iq/ demo section

Anyone trying to implement this technique yet?

Image

Posted: Sat Oct 20, 2007 11:51 am
by beaugard
beautiful!
Impossible to say what the performance hit is, but it can't be too bad since he's rendering fractals at the same time on the gpu...

Posted: Wed Oct 24, 2007 8:36 pm
by cybereality
Vectrex wrote: Image
Wow! That demo is amazing. It runs like a dog on my machine, I'm barely getting 1 fps, but man does it look good. I'd be very interested in experimenting with this technique at some point.

Posted: Wed Oct 24, 2007 8:45 pm
by Falagard
Yeah, that demo is great. Runs at a decent clip on my machine, and the dude said that the screen space ambient occlusion is fast but it's the fractal stuff that's slowing things down.

He didn't release any code or shaders so I sneakily tried to use GLIntercept to grab the shaders (out of curiosity only of course) but it wouldn't run - exiting immediately. Darn :-)