Hello Fred,

In few words I'd like to know how I can retrieve the depth texture 
corresponding to a spot light so I could implement light occlusion and light 
focusing.

Of course you can, that's how shadow mapping techniques work. You place a camera at the position of the light, set it up so it matches the light's parameters (directional light --> ortho projection, spotlight --> perspective projection, point light --> 6 perspective cameras in a cube map texture) and then render to a depth texture so you can use that result afterwards in your main pass.

I suggest you have a look at the shadow techniques in the osgShadow namespace. I guess osgShadow::ShadowMap might be the easiest to understand. Most shadow techniques make assumptions though, so they might limit what light source types you can use them with etc.

Hope this helps,

K-S
--
______________________________________________________
Jean-Sebastien Guay    jean-sebastien.g...@cm-labs.com
                               http://www.cm-labs.com/
                    http://whitestar02.dyndns-web.com/
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to