Horde3D
http://horde3d.org/forums/

Screen Space Ambient Occlusion (SSAO)
http://horde3d.org/forums/viewtopic.php?f=4&t=618
Page 1 of 1

Author:  Mikmacer [ 21.01.2009, 04:08 ]
Post subject:  Screen Space Ambient Occlusion (SSAO)

I have been working on SSAO for horde3D again since the last week, and I have finally got some great results!

To make this effect, I had to add an another buffer to the render target in the deferred pipeline and this render target contain each pixels position in screen space. The biggest problem Ive got, is that I need to have access to the normal in view space within the SSAO shader and since we don't ahave access to the transformation matrix in this context, I had to replace the GBUffer world space normal by the GBuffer view space normal. At the end it is not a big problem, since the lighting can be done ine view space, but for this demo I don't have any lighting.

You can donwload the demo here : http://www.mediafire.com/download.php?uwmkt2zynhy

BTW, SSAO is a very expensive effect, but some optimisation can be done. The best one is to reduce the buffer size by half. In this demo, the occlusion isn't blurred, so it can look a little bit wrong, but I will try to make a blur shader next week since a simple Gaussian Blur don't do well...

Some screenshots :

Image

Image

With/Without SSAO:

Image

Author:  marciano [ 21.01.2009, 09:09 ]
Post subject:  Re: Screen Space Ambient Occlusion (SSAO)

Great work so far, your implementation does not look like an outline shader as many other ones which is good! I think with bluring the overall look will still improve a lot. By the way, I recently found this SSAO implementation which looks awesome. It includes GLSL code, so maybe it can be an inspiration:

http://www.gamerendering.com/category/lighting/ssao-lighting/

Also the Starcraft 2 paper seems to be helpful for many guys, probably you know it:

http://ati.amd.com/developer/SIGGRAPH08/Chapter05-Filion-StarCraftII.pdf

Mikmacer wrote:
The biggest problem Ive got, is that I need to have access to the normal in view space within the SSAO shader and since we don't have access to the transformation matrix in this context, I had to replace the GBUffer world space normal by the GBuffer view space normal.

In the svn version you have access to the camera matrix in fullscreen quad passes: http://www.horde3d.org/forums/viewtopic.php?f=1&t=569
In general, if you find some limitations in the pipeline which you think can be overcome don't hesitate to tell us, so we can try to fix it. I'm thinking of depth buffers shared between render targets and such things.

Once your SSAO is finished, a nice extension could be SSGI (screen space gloabal illumination) like here:

http://www.ogre3d.org/forums/viewtopic.php?f=11&t=46794
http://diaryofagraphicsprogrammer.blogspot.com/2008/06/screen-space-global-illumination.html

Keep up the good work, it is always motivating to see some nice effects! :)

Author:  Mikmacer [ 23.01.2009, 04:48 ]
Post subject:  Re: Screen Space Ambient Occlusion (SSAO)

Hi!

Thanks for your links! I must admit, I was already using those article as a reference for my SSAO implementation. The main SSAO equation is taken from the first link, and I'm using some tricks from the starcraft 2 paper.

The SSGI implementation seems interesting, I think that I will try this soon! Due to the limitation of the screen space, I wonder if it will look great when the camera is moving.

BTW, I finally managed to add some blur to the SSAO, but Ive got some problems about bleeding edge so I need to upgrade my blur shader to handle a system in wich the normal and the Depth determine if a sample should be blurred, but for now it seems that it will looks great at the end!

A screenshot (With/Without SSAO with blur):

Image

Image

Author:  marciano [ 23.01.2009, 20:39 ]
Post subject:  Re: Screen Space Ambient Occlusion (SSAO)

The new screenshots are a clear improvement.

Mikmacer wrote:
BTW, I finally managed to add some blur to the SSAO, but Ive got some problems about bleeding edge so I need to upgrade my blur shader to handle a system in wich the normal and the Depth determine if a sample should be blurred, but for now it seems that it will looks great at the end!

Several people use bilateral filtering for ssao (and other upsampling). It is a blurring technique which preserves edges. You could do some research in that direction to fight the bleeding.

Author:  PuG [ 24.01.2009, 10:32 ]
Post subject:  Re: Screen Space Ambient Occlusion (SSAO)

very impressive, looking forward to the next demo.

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/