Screen space ambient occlusion

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
Post Reply
User avatar
Falagard
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 2060
Joined: Thu Feb 26, 2004 12:11 am
Location: Toronto, Canada
Contact:

Screen space ambient occlusion

Post by Falagard » Fri Sep 14, 2007 1:54 am

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
0 x

User avatar
Alexander
Gremlin
Posts: 175
Joined: Sat Aug 05, 2006 3:55 am

Post by Alexander » Fri Sep 14, 2007 7:36 am

This is the first time I've seen the technique. Very interesting.
0 x

User avatar
Fiesch
Gremlin
Posts: 159
Joined: Mon Oct 10, 2005 11:08 am
Location: Bavaria, Germany
Contact:

Post by Fiesch » Fri Sep 14, 2007 8:44 am

yup, nifty bit. Thanks for pointing that out
0 x
From all the things I've ever lost i miss my mind the most
S.Tyler, Aerosmith

User avatar
PolyVox
OGRE Contributor
OGRE Contributor
Posts: 1316
Joined: Tue Nov 21, 2006 11:28 am
Location: Groningen, The Netherlands
Contact:

Post by PolyVox » Fri Sep 14, 2007 9:02 am

Cool! The paper is a bit short on details but the results are nice.
0 x

beaugard
OGRE Contributor
OGRE Contributor
Posts: 265
Joined: Sun Mar 25, 2007 1:48 pm

Post by beaugard » Fri Sep 14, 2007 10:26 am

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?
0 x

jjp
Silver Sponsor
Silver Sponsor
Posts: 597
Joined: Sun Jan 07, 2007 11:55 pm
Location: Cologne, Germany
Contact:

Post by jjp » Fri Sep 14, 2007 10:56 am

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.
0 x
Enough is never enough.

User avatar
Falagard
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 2060
Joined: Thu Feb 26, 2004 12:11 am
Location: Toronto, Canada
Contact:

Post by Falagard » Fri Sep 14, 2007 2:48 pm

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 :-)
0 x

User avatar
milliams
Gremlin
Posts: 172
Joined: Fri Feb 16, 2007 1:47 am
Location: Portsmouth, UK
Contact:

Post by milliams » Fri Sep 14, 2007 3:14 pm

This technique really does look impressive, it would be a killer feature for OGRE to have. Maybe a SoC project for next year?
0 x

User avatar
Praetor
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 3335
Joined: Tue Jun 21, 2005 8:26 pm
Location: Rochester, New York, US
Contact:

Post by Praetor » Fri Sep 14, 2007 4:00 pm

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.
0 x

jjp
Silver Sponsor
Silver Sponsor
Posts: 597
Joined: Sun Jan 07, 2007 11:55 pm
Location: Cologne, Germany
Contact:

Post by jjp » Fri Sep 14, 2007 4:19 pm

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.
0 x
Enough is never enough.

Dom
Halfling
Posts: 57
Joined: Wed Jul 14, 2004 10:12 am
Location: Berlin

Post by Dom » Fri Sep 14, 2007 4:53 pm

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.
0 x

User avatar
Falagard
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 2060
Joined: Thu Feb 26, 2004 12:11 am
Location: Toronto, Canada
Contact:

Post by Falagard » Fri Sep 14, 2007 4:58 pm

Dom wrote:and there's also a discussion running on the gamedev list about it.
Linked in my original post.
0 x

User avatar
milliams
Gremlin
Posts: 172
Joined: Fri Feb 16, 2007 1:47 am
Location: Portsmouth, UK
Contact:

Post by milliams » Fri Sep 14, 2007 11:39 pm

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.
0 x

Vectrex
Ogre Magi
Posts: 1266
Joined: Tue Aug 12, 2003 1:53 am
Location: Melbourne, Australia
Contact:

Post by Vectrex » Sat Oct 20, 2007 9:30 am

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
Last edited by Vectrex on Sat Oct 20, 2007 1:59 pm, edited 2 times in total.
0 x

beaugard
OGRE Contributor
OGRE Contributor
Posts: 265
Joined: Sun Mar 25, 2007 1:48 pm

Post by beaugard » Sat Oct 20, 2007 11:51 am

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...
0 x

User avatar
cybereality
Hobgoblin
Posts: 563
Joined: Wed Jul 12, 2006 5:40 pm

Post by cybereality » Wed Oct 24, 2007 8:36 pm

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.
0 x

User avatar
Falagard
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 2060
Joined: Thu Feb 26, 2004 12:11 am
Location: Toronto, Canada
Contact:

Post by Falagard » Wed Oct 24, 2007 8:45 pm

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 :-)
0 x

Post Reply