the best ssao ive seen

Started by
237 comments, last by Paksas 12 years, 5 months ago
Hi Rubicon,

Thank you so much for your reply. I tried your method before but didn't get the result like the one here. After your post, I went back and realize I forgot to multiply the depth from depth buffer with far clip. Egg on my face X_X !

So now I got everything working, I want to look for way to improve the speed. I notice that some ppl here said the speed can improve by render the SSAO at half screen, blur it, then scale it back. Can someone point me to the right direction on the rendering at half screen and scale back? I know how to apply blur but I don't really know how to render the SSAO at half screen and scale back. Thanks in advance.

P.S. : Super noob question, but how do you actually apply SSAO to the lighting? Currently I have:

finalColor = (diffuse + ambient) * textureColor + specular;

I guess SSAO only affect ambient, so do we do something like:

ambient = ambient * ssao ?

Thanks.
Advertisement
Just make the rendertargets smaller!

As for applying it, you should use it as a base for your lighting as you suggest.

I just subtract mine (after inverting it) from the whole thing atm as then you still get a bit of contribution even in direct lighting. This is totally wrong, but I like it - it works for the project I'm using it on.
------------------------------Great Little War Game
Quote:Original post by mytre
Agreed with Jason, you should publish your work.
Excellent job.


thank you very much!

Right now i have very little time but when I find myself more idle i will write a paper or article :)

Quote:Original post by Rubicon
Quote:Original post by b_thangvn
- The occlusion shows polygon faces instead of a smooth surface. I faced this problem before and never know the reason behind it.
It's "self occlusion". Some of your samples will be hitting their own faces and incorrectly shadowing themselves. This is a known problem and requires workarounds.


To me it is not a problem itself. Rather, when using a 1:1 resolution (SSAO buffer with the same size of the normal and frame buffer) potentially it a desiderable effect, even if it leades to a 'flickering' SSAO component.

Anyway, practically it is not worth it. It has a convincing look only when using a 1:1 ratio, and with at least 16 samples per pixel. Kinda slow.

I solved this problem computing the SSAO from a normal buffer not affected by the normal maps.

As for the speed, it's acceptable with 8 samples per pixel, with a ratio of 2:1 or 3:1, and avoiding the using of the normals dot product as a weight for the SSAO term.
I think you either quoted the wrong bit or are misunderstanding what he was asking about...
------------------------------Great Little War Game
actually, you're right ^_^

Looking at the floor of the image he posted. I was thinking he was talking about another thing.

Anyway, what I wrote still holds, in the sense that computing SSAO exploiting a normal buffer made from normal maps, with a 1:1 ratio, produces a desiderable effect ;)
Hi,

So I have this question about rendering at half resolution:

- So do I just create a SSAO at half resolution and render to it, then later sample from it?

- Do I have to offset or doing anything to adjust the difference between the size?

Thanks.
Quote:Original post by b_thangvn
Hi,

So I have this question about rendering at half resolution:

- So do I just create a SSAO at half resolution and render to it, then later sample from it?

- Do I have to offset or doing anything to adjust the difference between the size?

Thanks.
Nope, nothing special required. If you think about it, by the time you get to the shader end, everything is already working in 0-1 range already.

------------------------------Great Little War Game
Hi,

I just try it and it didn't work. I thought if we have a, let say, 800x600 g-buffer, how can we sample from a 400x300 SSAO buffer without doing any adjustment? Don't we have to scale the SSAO buffer back to 800x600?
Your UV samples (typically) from 0 to 1. What that scales to in terms of texel addressing is down to what you set in your samplers and rendertargets. It should just work.
------------------------------Great Little War Game

This topic is closed to new replies.

Advertisement