[Deprecated]SSAO with XEffects (Reloaded)
No problem Nate_D, that screenshot looks great! It's not done yet though. 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.
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
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
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
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:
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.
Code: Select all
vec4(1.0-ao)
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
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
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
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
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.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
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
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
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
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
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.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?
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
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.
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