DGL
https://delphigl.com/forum/

Screen Space Ambient Occlusion (SSAO) Tutorial?
https://delphigl.com/forum/viewtopic.php?f=19&t=10876
Seite 1 von 1

Autor:  noeska [ Mo Jun 03, 2013 18:02 ]
Betreff des Beitrags:  Screen Space Ambient Occlusion (SSAO) Tutorial?

Who can point me to an easy to understand tutorial on SSAO (Screen Space Ambient Occlusion)?

I already found some on the internet but somehow thing do not get clearer for me.
http://www.michaelkeutel.de/computer-gr ... sion/ssao-–-implementation-in-opengl-using-glsl/
http://john-chapman-graphics.blogspot.n ... orial.html
http://www.gamerendering.com/2009/01/14/ssao/
http://devmaster.net/posts/3095/shader- ... -occlusion

So far i think i need to:
a) setup a noise texture
b) setup a linear depth buffer
c) render the scene
d) render a quad over the screen with an ssao shader attached to it (include a blurring step?)

Am i thinking in the right direction. Or should i stop thinking and start writing some code?

Autor:  TAK2004 [ Do Jun 06, 2013 22:37 ]
Betreff des Beitrags:  Re: Screen Space Ambient Occlusion (SSAO) Tutorial?

You have to split up step d into 4 steps.
d) render quad with ssao shader into a shadow texture/fbo target
e) render the shadow target into the shadow target with a horizontal blur
f) render the shadow target into the shadow target with a vertical blur
g) render the shadow buffer into the back buffer or color buffer(depending on your render pipeline)

The result of your shadow textures will also be rendert into the shadow buffer combined with the ssao.
The easiest way to implement ssao is to use a deffered renderer, because you get everything you need in the depth and normal render targets.
You also use a shadow target to combine this with the color target into a shaded render image.
The noise map is used to get some samples around the current processed texel.
The shader pick up the normal in the noise texture, add the offset of the normal to the current uv and pick up the normal and depth of the texel at the target position.
You can use more then one sample per texel which improve the quality of the ssao but cost much more time on the gpu.
If the depth nearly the same of the current texel or the normals show nearly in the same direction, then the texel will be shaded bright else it's shaded dark.
The difference between all the ssao algorithm is this calculation.
Depending on the algorithm Halo's or wrong occlusions can happen.

Seite 1 von 1 Alle Zeiten sind UTC + 1 Stunde
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/