Jump to content
  • Advertisement
Sign in to follow this  
aashish24

ssao_crytek

This topic is 2592 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

[font=arial, verdana, tahoma, sans-serif][size=2]Folks,

I have been trying to implement various ssao and now I am trying to implement crytek ssao and applying some form of bilateral blur. The images looks convincing but I see lot of bands and some halos (though I think thats expected with crytek ssao)..

Attached are some screenshots any comment or help is appreciated.

Thanks[/font]

Share this post


Link to post
Share on other sites
Advertisement
The effect looks too dark, even large,plane surfaces have a high occlusion value. This could also explain the banding effect because you seem to use mostly a small portion of the available value range.

Share this post


Link to post
Share on other sites

The effect looks too dark, even large,plane surfaces have a high occlusion value. This could also explain the banding effect because you seem to use mostly a small portion of the available value range.


Well yes, according to the shader in ShaderX7 I was doing this..

calculateSSAO(...)
{
...
..
ao[color=#9f4f00] =[color=#9f4f00] (ao[color=#9f4f00] /[color=#9f4f00] actualNumberOfSamples);[color=#006400]//[color=#9f4f00] [color=#006400]ao[color=#9f4f00] [color=#006400]=[color=#9f4f00] [color=#006400](ao[color=#9f4f00] [color=#006400]*[color=#9f4f00] [color=#006400]ao[color=#9f4f00] [color=#006400]+[color=#9f4f00] [color=#006400]ao); --> Saturation.. ao[color=#9f4f00] =[color=#9f4f00] clamp(ao,[color=#9f4f00] [color=#000080]0.0,[color=#9f4f00] [color=#000080]1.0);[color=#2b5f01]return[color=#9f4f00] ao;}
If I don't do that that.. I still bet banding but now not noticeable as much.. (attached is updated screenshost)

Share this post


Link to post
Share on other sites
I dont know if you remember, but when this year Crysis 2 was about to hit the shelves, someone (probably a Russian) stole an early build of the game. Now what's interesting is that it contained the shader source codes.
I haven't seen the source code, but it might be interesting and might help you with what you're missing. Note that it will probably be written in DX HLSL language.

Share this post


Link to post
Share on other sites

[quote name='Ashaman73' timestamp='1305784430' post='4812887']
The effect looks too dark, even large,plane surfaces have a high occlusion value. This could also explain the banding effect because you seem to use mostly a small portion of the available value range.


Well yes, according to the shader in ShaderX7 I was doing this..

calculateSSAO(...)
{
...
..
ao = (ao / actualNumberOfSamples);[color="#006400"]// [color="#006400"]ao [color="#006400"]= [color="#006400"](ao [color="#006400"]* [color="#006400"]ao [color="#006400"]+ [color="#006400"]ao); --> Saturation.. ao = clamp(ao, [color="#000080"]0.0, [color="#000080"]1.0);[color="#2b5f01"]return ao;}
If I don't do that that.. I still bet banding but now not noticeable as much.. (attached is updated screenshost)
[/quote]
I think you still got lot of self-occlussion (i.e. a plane surface like the floor is shaded by itself). But this seems to be a problem of the initial crytek SSAO shader. To get rid of it you need to restrict the test rays only to the hemisphere which is pointing away from the surface. This could be done by using the surface normal and mirror all rays which are pointing "inside" the surface.

Gamedev.net has a good article about SSAO over here.

Share this post


Link to post
Share on other sites

[quote name='aashish24' timestamp='1305813762' post='4812994']
[quote name='Ashaman73' timestamp='1305784430' post='4812887']
The effect looks too dark, even large,plane surfaces have a high occlusion value. This could also explain the banding effect because you seem to use mostly a small portion of the available value range.


Well yes, according to the shader in ShaderX7 I was doing this..

calculateSSAO(...)
{
...
..
ao = (ao / actualNumberOfSamples);[color="#006400"]// [color="#006400"]ao [color="#006400"]= [color="#006400"](ao [color="#006400"]* [color="#006400"]ao [color="#006400"]+ [color="#006400"]ao); --> Saturation.. ao = clamp(ao, [color="#000080"]0.0, [color="#000080"]1.0);[color="#2b5f01"]return ao;}
If I don't do that that.. I still bet banding but now not noticeable as much.. (attached is updated screenshost)
[/quote]
I think you still got lot of self-occlussion (i.e. a plane surface like the floor is shaded by itself). But this seems to be a problem of the initial crytek SSAO shader. To get rid of it you need to restrict the test rays only to the hemisphere which is pointing away from the surface. This could be done by using the surface normal and mirror all rays which are pointing "inside" the surface.



Yes like I said crytek implementation has that issue. I am not trying to make any improvements (other than clamping texture fetch). I just wanted to make sure that I can implement the algorithm using my framework and in OpenGL..

Gamedev.net has a good article about SSAO over here.

Yes, I have implemented this algorithm too. Actually I had to tweak 1-2 things to get it to work on OpenGL. Thanks for your feedback..




[/quote]


Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!