[Deprecated]SSAO with XEffects (Reloaded)

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
Halifax
Posts: 1424
Joined: Sun Apr 29, 2007 10:40 pm
Location: $9D95

Post by Halifax »

No problem Nate_D, that screenshot looks great! It's not done yet though. :lol: I still have to fix some major problems, and actually already have. I changed my occlusion algorithm (even though it seems to still be erroneous), I reduced the radius and fixed the banding issue cause by the reduced radius, and I reduced some other calculations I can't think of right now that make it run tons faster on my computer.

I might re-work the tone remapping a little bit too though. The main thing I'm messing around with right now though is the occlusion algorithm.

And also, looking at your screenshot, I will probably want to implement some checking based on the dot-product between the sampled depths.
TheQuestion = 2B || !2B
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

Hey how did you fix the banding issue? IIRC you need a half pixel offset.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Halifax
Posts: 1424
Joined: Sun Apr 29, 2007 10:40 pm
Location: $9D95

Post by Halifax »

I can't remember right now, BlindSide, because I'm not at my development computer. But as soon as I can get back to my development computer, probably within the next 2-3 days, I'll be able to let you know.

By the way, what do you mean? A half-pixel offset for the radius?
TheQuestion = 2B || !2B
9YkKsvXM
Posts: 64
Joined: Tue Mar 11, 2008 11:45 pm

Post by 9YkKsvXM »

-
Last edited by 9YkKsvXM on Mon Jun 08, 2020 1:36 am, edited 1 time in total.
Halifax
Posts: 1424
Joined: Sun Apr 29, 2007 10:40 pm
Location: $9D95

Post by Halifax »

When I get home to my development machine, I'll take a look at that algorithm. One thing that really stands out to me is how he calculates the occlusion value for his buffer. He does one key thing that I thought would be necessary with my program:

Code: Select all

vec4(1.0-ao)
Basically he inverts the normalized ambient occlusion value. That's what I had suspected I needed to do with my algorithm, given how the buffer output looks.

But anyways, I digress, I will definitely take a look at his shader, although I don't like at all how he implemented it.

EDIT:
Alright, I implemented that shader directly, and I am getting serious banding issues. I'll have to take a deeper look into the implementation later.
TheQuestion = 2B || !2B
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

I don't wanna admit it but it might be related to the how I'm calculating/storing the depth buffer. I've got to take a look at this sometime and see what's causing all the fuss.

Actually if you read the GameDev.net thread on SSAO (It's in the Image of the Day forum), you'll notice alot of people experienced banding when using 16 bit depth, and Ysaneya points out a way to compress the depth to 32-bit which might be helpful.

Oh yeah heres the link to the thread I'm talking about (It's NOT the on the front page atm):
http://www.gamedev.net/community/forums ... _id=463075

Cheers
Last edited by BlindSide on Mon Feb 23, 2009 11:47 pm, edited 1 time in total.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Halifax
Posts: 1424
Joined: Sun Apr 29, 2007 10:40 pm
Location: $9D95

Post by Halifax »

BlindSide wrote:I don't wanna admit it but it might be related to the how I'm calculating/storing the depth buffer. I've got to take a look at this sometime and see what's causing all the fuss.

Actually if you read the GameDev.net thread on SSAO (It's in the Image of the Day forum), you'll notice alot of people experienced banding when using 16 bit depth, and Ysaneya points out a way to compress the depth to 32-bit which might be helpful.

Cheers
Ah, alright, I'll have to check that out then. And yeh, I just realized, that I didn't actually fix the banding problem with my first SSAO shader, I just reduced the radius to something like 0.215 or something, and didn't normalize the random vectors.

But anyways, I'll take a look at that topic and see what I can do about it with regards to XEffects. If I get anything done, then I'll be sure to notify you about it.

EDIT:

Nope, I implemented 32-bit encoding and decoding, and that doesn't seem to be the problem. :( I don't understand...I implemented the Leadwerks shader exactly the same way, but there are still banding issues. (Mind you, I had to changing the reading of the depth.) So it has to be something with the buffers I'm thinking.
TheQuestion = 2B || !2B
9YkKsvXM
Posts: 64
Joined: Tue Mar 11, 2008 11:45 pm

Post by 9YkKsvXM »

-
Last edited by 9YkKsvXM on Mon Jun 08, 2020 1:36 am, edited 1 time in total.
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

Maybe you need a FP render target? Try the fp render target patch and see how that works out for you.

EDIT: Also using Linear Z-buffer may help: http://www.mvps.org/directx/articles/li ... inearz.htm
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Halifax
Posts: 1424
Joined: Sun Apr 29, 2007 10:40 pm
Location: $9D95

Post by Halifax »

Nate_D wrote:Halifax, in the Leadwerks shader it requests the near and far values of the camera - Did you set these numbers with the same values from irrlicht? such as 60 and 0.1?
Yes I did in fact. It doesn't help any. Also, just so you know, what I'm doing now is using the near and far values of the camera to reconstruct the depth value into eye-space position (in my shader). You probably just didn't notice because I have them hard-coded, since this wasn't a finalized write, I didn't include them as parameters. Once I finish my SSAO implementation I will add a better use API.

Okay, I look into to that when I get a bit more time. I've wanted to work with FP render targets anyways, so it will come as a welcome patch. Thanks for the link too, BlindSide.
TheQuestion = 2B || !2B
9YkKsvXM
Posts: 64
Joined: Tue Mar 11, 2008 11:45 pm

Post by 9YkKsvXM »

-
Last edited by 9YkKsvXM on Mon Jun 08, 2020 1:25 am, edited 1 time in total.
Halifax
Posts: 1424
Joined: Sun Apr 29, 2007 10:40 pm
Location: $9D95

Post by Halifax »

You might be on to something there Nate_D. I never even considered it. :lol: I just did a quick plasma pass in GIMP if I recall correctly. Thanks for the recommendation Nate_D, I'm going to try that tommorow.
TheQuestion = 2B || !2B
9YkKsvXM
Posts: 64
Joined: Tue Mar 11, 2008 11:45 pm

Post by 9YkKsvXM »

-
Last edited by 9YkKsvXM on Mon Jun 08, 2020 1:25 am, edited 1 time in total.
wing64
Competition winner
Posts: 242
Joined: Wed Jul 23, 2008 2:35 am
Location: Thailand
Contact:

Post by wing64 »

Hello BlindSide
I enabled depth map on XEffect for render SSAO and here is result
Image

and i use LightModulate.glsl in XEffect for combine SSAO texture with Color texture here is result

Image

What's i do mistake process BlindSide ? Please suggest me for SSAO.

best regards,
Halifax
Posts: 1424
Joined: Sun Apr 29, 2007 10:40 pm
Location: $9D95

Post by Halifax »

You should put the SSAO buffer composition in the actual SSAO shader. LightModulate will waste time, honestly, because of all the post processing texture swapping that has to occur.

With regards to your algorithm, I can't really help you on that. One thing that looks possible is that you could try inverting the buffer.
TheQuestion = 2B || !2B
Post Reply