Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: 1 [2] 3 4 ... 6
  Print  
Author Topic: Screen-Space Ambient Occlusion( SSAO )  (Read 6282 times)
Lenn
Customers
Community Member
*****
Posts: 381

Ivan Miskelic


« Reply #20 on: June 10, 2008, 08:40:34 PM »

See, I told you you should bug the ppl on gamedev just a LITTLE bit more. Glad that helped, if it did. Tongue

really nice work, man! Smiley
Logged

AriusEso
Customers
Community Member
*****
Posts: 375

Esoteric


« Reply #21 on: June 11, 2008, 01:25:34 AM »

Lenn <3. Tongue

Ok, I have the compositing shader written. The blurring still needs to be done. But here is where I'm at.

[click for big]

[no SSAO]


[SSAO pass]


[composite]


I left it subtle because, personally, I think SSAO is a pretty nasty, hacky, looking effect. So, the more subtle the better Wink. As I said, I still need to do the blurring and also that additional depth checking sybixsus described.

Logged

Toaster
Community Member
*
Posts: 141


WWW
« Reply #22 on: June 11, 2008, 07:38:25 AM »

Looks awesome arius. Cheesy I cant wait to see the final shader with blur! I know this took alot of time so maybe we should through arius a party. Tongue

-Toaster
Logged

Visit my site at: Unknown Abstraction
Lenn
Customers
Community Member
*****
Posts: 381

Ivan Miskelic


« Reply #23 on: June 11, 2008, 08:36:46 AM »

Yeah. Now the blur shader can be a simple one, but it would be better if you could get it so that the bright areas on SSAO pass stay bright so when you blur it, the shadow like the one behind the actor on the wall in your example doesnt bleed into the actor which is in front (and brighter) and the brighter one doesnt bleed onto the darker one. How you're going to achieve that is beyond me. Tongue But I read it can be a problem.

If you do the composite of your two screenshots in photoshop by adding the SSAO pass as multiply, then blurring it (and i also darkened it a little to emphasise the effect) you can see the tiny white outlines that are bound to happen.

(view the image in a separate window as you need to see it full size)


A blur with a depth pass would, probably, be way to0 expensive Wink so my suggestion is to use a simple blur because this looks good enough. Like you say it's a hacky technique anyway and isnt likely to get any better than this.
Logged

AriusEso
Customers
Community Member
*****
Posts: 375

Esoteric


« Reply #24 on: June 11, 2008, 10:02:48 AM »

A blur with a depth pass would, probably, be way to0 expensive Wink so my suggestion is to use a simple blur because this looks good enough. Like you say it's a hacky technique anyway and isnt likely to get any better than this.

Aha, but see, I already have a depth map with normals generated. Smiley

*is not just a pretty face*
Logged

Lenn
Customers
Community Member
*****
Posts: 381

Ivan Miskelic


« Reply #25 on: June 11, 2008, 10:59:21 AM »

Oh, yeah that is right. But I think I read somewhere, sometime ago, that even with that you still need to blur per-depth from front to back, and then blend or overwrite the depths based on a certain threshold. Something like that. Tongue Well, see how you do, will be interesting.
Logged

Aion
Customers
Community Member
*****
Posts: 108


WWW
« Reply #26 on: June 11, 2008, 11:23:29 AM »

Spectacular!  Grin
Logged

Aion - god of Neverdaunt
Raine
Customers
Community Member
*****
Posts: 1139


« Reply #27 on: June 11, 2008, 11:55:10 AM »

gief me moar naw
Logged

AriusEso
Customers
Community Member
*****
Posts: 375

Esoteric


« Reply #28 on: June 11, 2008, 12:32:24 PM »

gief me moar naw

You were interested in SM2 version. Here is a comparison between SM2(8x) and SM3(16x) versions.

[SM2]


[SM3]


Naturally the scene is darkened with SSAO, but the SM2 version is particularly dark. So it may be needed to brighten the final composite.
Logged

Raine
Customers
Community Member
*****
Posts: 1139


« Reply #29 on: June 11, 2008, 01:22:01 PM »

Thanks for the comparison, it's pretty interesting to see the different behaviour across different shader models.

Keep it up Arius! Cheesy
Logged

AriusEso
Customers
Community Member
*****
Posts: 375

Esoteric


« Reply #30 on: June 11, 2008, 02:05:15 PM »

Blur is done. I think I should make it stronger though.. ?

[click for big]

[SSAO]


[Blur]


[Composite]
Logged

Omnicrash
Community Member
*
Posts: 53


WWW
« Reply #31 on: June 11, 2008, 02:07:11 PM »

Awesomeness! Good job Arius, King of Post Processing!
Logged

Raine
Customers
Community Member
*****
Posts: 1139


« Reply #32 on: June 11, 2008, 02:56:30 PM »

I think there's shouldn't be any noise after the blur... that's what I've seen in the gamedev thread at least.

It's just too cool nonetheless...
Logged

AriusEso
Customers
Community Member
*****
Posts: 375

Esoteric


« Reply #33 on: June 11, 2008, 04:16:56 PM »

XVID, 11mb: http://azazeldev.org/ssao/ssao.avi

RaineC, if you look at the vid, you can see me switch to the blur pass. It looks better now I think Smiley.
Logged

Happy
Customers
Community Member
*****
Posts: 78


« Reply #34 on: June 11, 2008, 06:05:10 PM »

WOW  Cheesy

Very Intense...
Logged
AriusEso
Customers
Community Member
*****
Posts: 375

Esoteric


« Reply #35 on: June 12, 2008, 07:29:04 AM »

Ok, I've added in a depth check. Now far away objects don't get occluded, as sybixsus mentioned earlier. So for example, when that man-model is in the centre of the box room, he does not occlude on the wall. The occlusion only occurs when an object is close enough. I've basically hacked a check in, but the result seems to work well.

Code:
                        if(length(Deep - sDeep) > OccludeDist)
                        {
                                fColour++;
                        }
                        else
                        {
                                float Occlude = DistanceScale * max(Deep - sDeep, 0);
                                fColour      += 1 / (1 + (Occlude * Occlude) * 0.1);
                        }

You'll notice he almost has to be clipping the wall in order to cause occlusion. This distance value can be increased or decreased to ones liking to fit whatever scene.

XVID, 3.8mb: http://azazeldev.org/ssao/depth.avi
Logged

Lenn
Customers
Community Member
*****
Posts: 381

Ivan Miskelic


« Reply #36 on: June 12, 2008, 09:24:24 AM »

one thing i dont get is how come the blur looks noisy in the blur pass alone and smooth in the composite?

if you blurred just based on a 3x3 field or something, that would be too weak anyway, but it looks ok in composite (and in video). now all we're gonna need is that new 10800gtx SLI setup and we're off Wink
Logged

vbCrLf
Community Member
*
Posts: 310


WWW
« Reply #37 on: June 12, 2008, 10:52:07 AM »

Awesomeness! Good job Arius, King of Post Processing!
Absolutely Wink
Great job Arius!

vbCrLf.
Logged

TVProjects
AriusEso
Customers
Community Member
*****
Posts: 375

Esoteric


« Reply #38 on: June 13, 2008, 06:23:53 PM »

Here( 5.87mb ): http://azazeldev.org/ssao.rar

It needs some work etc, as usual, but there it is. I was unable to keep an SM2 version going as I had to add additional depth checks and things. I will keep trying to squeeze an SM2 version, but for the moment this is SM3 only.
Logged

AriusEso
Customers
Community Member
*****
Posts: 375

Esoteric


« Reply #39 on: June 14, 2008, 10:13:35 AM »

Could people please post their FPS rate and hardware settings. A friend of mine gets a low rate and using a 7700 NC chipset. We think it is because he's on AGP, but any information would be appreciated. Thank you.
Logged

Pages: 1 [2] 3 4 ... 6
  Print  
 
Jump to:  

Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks