• Advertisement
Sign in to follow this  

Screen Space Ambient Occlusion?

This topic is 1679 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

So I have been reading up up SSAO and have been learning how to do it from a depth texture and so far I am stuck. I rendered a depth texture. DepthMap and it is rendered from the camera point of view. Should it be rendered from the camera point of view, or should I put a light source in the sky? Can someone please point me in the right direction here on where to go from making this depth texture. Thanks.

Share this post


Link to post
Share on other sites
Advertisement

Should it be rendered from the camera point of view, or should I put a light source in the sky?

SSAO  is a light independent effect, therefor you don't need to setup any light sources.

Edited by Ashaman73

Share this post


Link to post
Share on other sites

 


Should it be rendered from the camera point of view, or should I put a light source in the sky?

SSAO  is a light independent effect, therefor you don't need to setup any light sources.

 

So the depth map is just rendered from the camera point of view? Then what after that?

Share this post


Link to post
Share on other sites

You draw a full-screen quad, rendering to a colour buffer, using the depth-map as input, and using a shader that computes SSAO...

This shader takes a bunch of depth samples for each pixel, and uses them to calculate occlusion.

 

Is there any particular SSAO tutorial or article that you're using?

Share this post


Link to post
Share on other sites


Is there any particular SSAO tutorial or article that you're using?

 

No I don't really have a tutorial to use. I have taught myself all the graphics knowledge I know to here, I have never accomplished something like this though. Is there a really good tutorial anywhere?

Share this post


Link to post
Share on other sites

 


Is there any particular SSAO tutorial or article that you're using?

 

No I don't really have a tutorial to use. I have taught myself all the graphics knowledge I know to here, I have never accomplished something like this though. Is there a really good tutorial anywhere?

 

 

Yes. Keep in mind that that particular implementation uses both a normal buffer and a depth buffer. It's also possible (and fairly common) to achieve an ambient occlusion-like effect using only a depth buffer, but I think the results are generally unsatisfactory; it highlights sharp changes in depth, but it doesn't necessarily "feel" like real shading, at least to me.

To be honest, I think that SSAO in general is an effect that should be used quite sparingly; in real life, sharp corners only show localized dark areas when they receive only a small amount of light from random directions (which is what ambient light is supposed to be, really). This can be mitigated/improved to some degree by making each "occluder" also act as a light, but this requires another buffer with only direct light, from which the color/brightness of the occluder/light is read, making the effect slower still.

 

In most cases, I think SSAO looks like SSAO, and not really much else.

Share this post


Link to post
Share on other sites

SSAO is only one part in to faking ambient occlusion. Lower frequency big scale ambient occlusion is lot more important but also lot harder and expensive to generate. Voxel engines usually excel at that part.

 

There is nice article how to combine nice ambient occlusion look using three different scales and different method for each. http://www.iquilezles.org/www/articles/multiresaocc/multiresaocc.htm

Share this post


Link to post
Share on other sites

True true, but if you follow a proper, more physically based approach you can get very accurate results. It's all about the implementation. ;)

Share this post


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

  • Advertisement