Re: [osg-users] light through walls

2010-07-06 Thread Jose Rincon
Hi,

Before all, I thank Nick and Jean-Sebastian for your pieces of advices.

What I try to do now, it's to apply ShadowMap to the SpotLight.

I use Delta3D for my initial program, and I have a shader for Spotlight in that 
program. I've included the ShadowedScene of OpenSceneGraph and my goal now is 
syncronize my SpotLight with ShadowMaps.

If I try to compile the two things, I don't have an unwanted effect. However, 
If I deactive the shader for the spotlight, I get a shader effect more or less 
wanted.

Thank you!

Cheers,
Jose

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=29725#29725





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] light through walls

2010-07-05 Thread Jose Rincon
Hi,

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?

Thank you!

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=28747#28747





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] light through walls

2010-07-05 Thread Trajce (Nick) Nikolov
do a search in the archive for light lobes. There is a code posted that do
what you ask for

-Nick


On Wed, Jun 9, 2010 at 7:01 PM, Jose Rincon jm.rincon.pe...@gmail.comwrote:

 Hi,

 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?

 Thank you!

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=28747#28747





 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] light through walls

2010-07-05 Thread Jean-Sébastien Guay

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 Guayjean-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