Hi Nick, The osgUtil::CullVisitor has the maintains a stack of ModelViewMatrix that it accumulates through the the scene graph traversal, you should just need to get the top of this stack using cullVisitor->getModelViewMatrix().
Robert. On 2 November 2016 at 22:25, Trajce Nikolov NICK <[email protected]> wrote: > Hi Community, > > I am trying to optimize the rendering. Getting huge update numbers. > > The story is this: > My scene has huge number of lights, some are static (streetlights) some > dynamic (a car). The lighting engine needs the World matrix of a LightSource > and the ViewMatrix (which is the same as the World inverse just with some > extra rotation). In my code after the update before the rendering traversal > I am updating these matrices each frame and I am about to place this code in > my custom CullVisitor (which traverse the scene anyway but only the active > children). > > Here is my approach at the moment: list of light entities and here is how I > am computing these: > http://pastebin.com/0A64sc7Y > Simply getting the NodePath and computing the world matrix from this node > path. This seams to be costly > > I am after wiser optimization, to place this in my CullVistor: Here is the > snippet: > http://pastebin.com/6dQnih8N > > These snippets are simple and I would like to ask if this is more proper > way, which it seams to me since I will gain more performance by updating > only the culled and active nodes. Also the math in the cull visitor. > > Thanks a lot for any hints, ideas. As always :-) > > Cheers, > Nick > > -- > trajce nikolov nick > > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

