Screen Space Ambient Occlusion?

Started by
8 comments, last by Styves 10 years, 10 months ago

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.

Advertisement

It is from the camera’s point of view and goes well with early-Z.

L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid


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.


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?

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?


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?


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.

-~-The Cow of Darkness-~-

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


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

Amen to that!

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

This topic is closed to new replies.

Advertisement