Hi Jose,

I'm working with a light (spotlight) concretely. I would like that this light 
didn't go through walls. How can I obtain this effect?

In real life, the fact that a light doesn't go trough walls is a consequence of the fact that solid objects block the light (i.e. cast shadows). The "darkness" behind a wall is the wall's shadow.

Unfortunately the default real-time graphics pipeline doesn't render shadows natively as it's not a raytracing engine (in which shadows come naturally from the algorithm of tracing rays and finding intersections in the scene). In real-time graphics, we must "cheat" shadows.

Have a look at the osgShadow nodekit that's part of OSG, in particular osgShadow::StandardShadowMap and osgShadow::LightSpacePerspectiveShadowMap, and the osgshadow example that ships with OSG's source code. These use a technique called Shadow Mapping which is a good way to render shadows, but has a few gotchas.

I recommend you do a bit of reading about these techniques before you use them so you know what to expect. Google can help you find some on-line articles about real-time rendering of shadows and shadow mapping in particular. I also recommend "Real-Time Rendering" by Tomas Akenine-Moller et al, and Computer Graphics: Principles and Practice by Foley, Van Dam et al. if you want good books about those kinds of things.

Hope this helps,

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

Reply via email to