Re: [osg-users] Depthmap from light's point of view

2012-12-13 Thread Christian Buchner
if you look at the implementation of osgShadow, in particular the
osg::ShadowMap class you will see how to render the scene from the light's
point of view for the purpose of creating a depth map. The depth map is
then later used when rendering the main view, for superimposing a shadow.

Warning: the default behavior turns on backface culling and only enables
the back faces for rendering. This may not be what you want - but it's easy
enough to change.


2012/12/12 Peterakos hay...@gmail.com

 Hello.

 Lets say there is cessna as a child in LightSource group.
 LightSource has 1 light.

 What i want to do is to get the depth map from light's point of view.
 How can i do this ?

 I am thinking of placing a Camera as a child in LightSource.
 This camera will look at exactly the same direction as the light and
 will also has the same position.
 Is this the right way to do it ?

 ( I know how to make camera render to texture)

 Thank you for your time.
 ___
 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


[osg-users] Depthmap from light's point of view

2012-12-12 Thread Peterakos
Hello.

Lets say there is cessna as a child in LightSource group.
LightSource has 1 light.

What i want to do is to get the depth map from light's point of view.
How can i do this ?

I am thinking of placing a Camera as a child in LightSource.
This camera will look at exactly the same direction as the light and
will also has the same position.
Is this the right way to do it ?

( I know how to make camera render to texture)

Thank you for your time.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org