PDA

View Full Version : SSAO Demo (Screen Space Ambient Occlusion)



Luuk van Venrooij
03-06-2010, 08:55 AM
He all,

I have been playing arround with some SSAO shaders I found in this thread over at GameDev:

http://www.gamedev.net/community/forums/topic.asp?topic_id=556187&PageSize=25&WhichPage=9

I created 2 versions of the shaders. One using a linear depth buffer which is stored in an RGBA texture and one using the conventional depth buffer. This because I was having some problems on older hardware with the normal depth buffer.

There is some room for improvement like using a noise texture instead of calculating it in the shader. The same goes for the sin and cos functions in the sample gathering.

Controls:
-Mouse+WSDA to look arround
-F1 to switch SSAO on an off
-F2 to switch between linear RGGA depth buffer or normal depth buffer
-F3 swith mouse capture on and off

Screenshots:
Here are 2 screenshots with the SSAO turned on and off. No other lighting calculations are done here. These where made on a Geforce 7300 LE 128 mb so don`t take the FPS to serious:).
SSAO on:
http://img195.imageshack.us/img195/9818/ssaoon.th.jpg (http://img195.imageshack.us/i/ssaoon.jpg/)

SSAO OFF:
http://img693.imageshack.us/img693/295/ssaooff.th.jpg (http://img693.imageshack.us/i/ssaooff.jpg/)

Download:
Sourcecode like always is under LGPL.
www.genesisdevice.net/ssao.zip (http://www.genesisdevice.net/ssao.zip)

Chears

Luuk

jdarling
03-06-2010, 12:43 PM
Hey, that's a very noticeable difference. I got the best results with RGBA and SSAO turned ON (of course). The controls are VERY touchy, but I can understand for a demo/sample that was the least of your concerns :).

chronozphere
03-06-2010, 10:24 PM
It runs great on my machine. Thanks for this. :D I'm glad there are still members in this community who know how to accomplish advanced graphical effects like these.

I did notice that when changing the camera orientation, the light intensity on some areas suddenly changed. There seems to be some kind of popping effect going on. Also, objects have a "dark glow" around them. I'm not sure whether this is a problem. It could be that about any SSAO implementation has this. :)

dazappa
04-06-2010, 03:43 AM
10 FPS on my 5+ year old system. I absolutely LOVE the effect though, and turning RGBA on was necessary to make the effect look right.

virtual
04-06-2010, 01:37 PM
in the picture the SSAO looks nice



it doesn't work in my machin CPU : P4 3Ghz ;
RAM : 512Mb ;
GPU : GF5200Fx (256Mb of VRAM);

its weake now days , i know

chronozphere
04-06-2010, 04:27 PM
@Virtual: To run this, you'd need a Geforce 8xxx series card. The rest of your system specs are indeed not that good anymore, but they would be good enough to run the demo.

Galfar
08-06-2010, 01:19 PM
Nice work,
runs at 80 fps (FLOAT SSAO) on Radeon 4850.

farcodev
15-06-2010, 11:24 PM
thanks for sharing ! :)

farcodev
21-06-2010, 12:20 AM
Great tech job !

sorry i can't test it, i don't have a 8xxx , only a 7900gtx ???

Georgy
12-07-2010, 04:54 AM
can you post screen-shot and shader source code again?
i have only i945gm video (no glsl support), but it is interesting to me
thanks