Hello Sebastian,

> I'm quite confused regarding the osgShadow implementation.
> My scene and my light-positions are static. My idea was to capture the 
> shadow-map only once
> and apply it consecutively in all frames. I'm a bit lost where to start. 
> Neither update nor cull seems to be the right place.
> Any hints?

As you have seen, it was not designed to do that. It's designed to 
recalculate the shadow map each frame. I guess you could add a boolean 
to it to say that it has been calculated, and then not redo it again... 
Maybe just something like:

class myShadowMap : public osgShadow::ShadowMap
{
     public:
         myShadowMap() : _done(false) {}

         virtual void update(osg::NodeVisitor& nv)
         {
             if (!_done)
                 osgShadow::ShadowMap::update(nv);
         }

         virtual void cull(osgUtil::CullVisitor& cv)
         {
             if (!_done)
             {
                 osgShadow::ShadowMap::cull(cv);
                 _done = true;
             }
         }

     private:
         bool _done;
};

Note that I didn't try this, but it might give you something to start 
with? Let us know how it goes.

Hope this helps,

J-S
-- 
______________________________________________________
Jean-Sebastien Guay    [EMAIL PROTECTED]
                                http://www.cm-labs.com/
                         http://whitestar02.webhop.org/
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to