[osg-users] SSAO : Screen Space Ambient Occlusion

0 views
Skip to first unread message

Adrian Egli OpenSceneGraph (3D)

unread,
Feb 25, 2008, 3:58:45 AM2/25/08
to OpenSceneGraph Users

Hi all

did someone still implemented this SSAO in OSG, any demo?

http://rgba.scenesp.org/iq/computer/articles/ssao/ssao.htm
--
********************************************
Adrian Egli

Andreas Lindmark

unread,
Feb 25, 2008, 8:57:37 AM2/25/08
to OpenSceneGraph Users
Funny you should ask. :)
Im currently doing a master thesis about ambient occlusion, and I've implemented a type of screen space ambient occlusion in OSG and GLSL. It is similar to the one you linked to but differs in some important areas. My version is slower but I've been able to remove almost all self-shadowing and it considers the distance between the shaded pixel and the sampled pixel in eye space and not the only the difference in depth.
Im in the process of writing the report (in English) and cleaning up the code but when this is done i can make it public if anyone is interested.
I have not tried to implement Iñigo's SSAO-method in OSG but im confident that it should be fairly easy to do and it would be significantly faster than my method.

/Andreas Lindmark

2008/2/25, Adrian Egli OpenSceneGraph (3D) <3dh...@gmail.com>:
_______________________________________________
osg-users mailing list
osg-...@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Adrian Egli OpenSceneGraph (3D)

unread,
Feb 25, 2008, 9:49:57 AM2/25/08
to OpenSceneGraph Users
Hi Andreas,

may you would be able to implement an opensource nodekit for openscenegraph, like osgShadow. This would be greate to get, implementing twice similar things are not so funny. if you would be able to add Inigo algorithm this would be really greate.

/adrian

2008/2/25, Andreas Lindmark <k.andreas...@gmail.com>:



--
********************************************
Adrian Egli

Art Tevs

unread,
Feb 25, 2008, 10:19:18 AM2/25/08
to OpenSceneGraph Users
Hi Adrian,

I do not think that a nodekit just for this purpose is
usefull or needed.

This kind of screen space algorithms can be perfectly
described by the osgPPU. I really like this kind of
effects and it seems that it is very straight forward
to implement. I will try to create a .ppu file which
can be easyly used with osgPPU to apply the SSAO onto
your currently bounded camera (the same way as it is
shown in the example of osgPPU for the blurring or
hdr).

The osgPPU will be released as developer/stable
release soon, since I now get little bit more time to
fight the last bugs away ;-)


Best regards,
Art


--- "Adrian Egli OpenSceneGraph (3D)"
<3dh...@gmail.com> schrieb:

Lesen Sie Ihre E-Mails auf dem Handy.
www.yahoo.de/go

Andreas Lindmark

unread,
Feb 28, 2008, 10:43:48 AM2/28/08
to OpenSceneGraph Users
I did not use osgPPU but it seems like it's ideal for the job! I don't want to think about how much time I've could have saved by using it..

There is however the question of how to apply the result. Ambient occlusion should of course only apply to ambient part of the light model.
Something like (1-AO) * AmbientColour

This is pretty straightforward to do if you use deferred rendering, if you use a forward rendering it is a bit trickier.
I see two possibillities:
1. Use the AO-texture as input to the shader used in forward rendering. In this case you must calculate texture coordinate for each  shaded pixel(calculate per vertex and use the interpolator).

2. Deferr the ambient lighting part of the lighting equation.
    Write the result of diffuse and specular to a render target and ambient color to another RT
    Multiply the ambient-RT with the result of the AO-pass and add this to the Specular-Diffuse-Rendertarget

 If anyone got a another solution I would be very interrested in hearing about it.

Best regards,
Andreas

2008/2/25, Art Tevs <stud_...@yahoo.de>:
Reply all
Reply to author
Forward
0 new messages