Horde3D

Next-Generation Graphics Engine
It is currently 27.11.2024, 14:57

All times are UTC + 1 hour




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: 21.01.2009, 04:08 
Offline

Joined: 16.01.2008, 00:24
Posts: 73
Location: Canada/Quebec
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


Top
 Profile  
Reply with quote  
PostPosted: 21.01.2009, 09:09 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
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! :)


Top
 Profile  
Reply with quote  
PostPosted: 23.01.2009, 04:48 
Offline

Joined: 16.01.2008, 00:24
Posts: 73
Location: Canada/Quebec
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


Top
 Profile  
Reply with quote  
PostPosted: 23.01.2009, 20:39 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
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.


Top
 Profile  
Reply with quote  
PostPosted: 24.01.2009, 10:32 
Offline

Joined: 11.06.2008, 10:34
Posts: 119
very impressive, looking forward to the next demo.

_________________

Let's bring 'em out! Any old iron! Any old iron!
A door opens and a homewife brings out a rather sophisticated-looking ground-to-air missile system, and dumps it on the cart.
Thank you.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group