Re: [osg-users] design issues

2016-11-03 Thread Trajce Nikolov NICK
Hi Robert, I am very thankful for every hint, really. These hints are really valuable for optimization. And I found the issue, it was pre/post multiply order of the matrices. I was to avoid the calculus from the nodepath and use the ModelView matrix already available in the CullVisitor. Here is

Re: [osg-users] design issues

2016-11-03 Thread Robert Osfield
I don't have time to dive deeply in user projects, I can do quick scans of email and provide quick replies where possible. In terms of optimization I'd say avoiding the inverse matrix might be useful. Using the Matrix.postMultTrans/preMultTrans would also be another optimization step you could

Re: [osg-users] design issues

2016-11-03 Thread Trajce Nikolov NICK
Thanks Robert, I am aware of it, it is already used in my second snippet. Here it is: (is it done properly?) 1. void MyCullVisitor::apply(osg::LightSource& node) 2. { 3. 4. osg::Matrixd inverseViewMatrix = osg::Matrixd::inverse( getCurrentCamera()->getViewMatrix()); 5.

Re: [osg-users] design issues

2016-11-03 Thread Robert Osfield
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

[osg-users] design issues

2016-11-02 Thread Trajce Nikolov NICK
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