Hi Robert, Community, this will be hard to be described I guess, but I will try. Will make a video as well later.
I am doing something with lights and in a CullCallback I do computation of some light attribs for a shader. This something is splitting the computation between the CPU and the GPU for lighting purposes.. And I am doing sort of my LOD within this CullCallback. so the lights are not active after a distance. And it works great but my cull time is really high so I am about to optimize it with an LOD (just a try). My scenegraph is like: root->MatrixTransform->LightSource and again it works ok as long as I add LOD between the transform and the lightsource. Honestly, I have no clue what is going on. The final result is as I am getting close to the LOD switch out distance the lights are changing position, intensity and they fade away.instead of just switch out on that distance. Since I am using the osgUtil::PositionalStateContainer::AttrMatrixList from the currentRenderStage (snippet bellow) and I am using the matrices from there for the osg::Light attributes something is telling me that these matrices are somewhat wrong when LOD is in the scene path. But again this is only guessing I am aware that based on written above it is hard to give a hint and I had big doubts to post this really, but just in case maybe someone will have an idea. Thanks a bunch as always Nick snippet from the cullcallback: virtual void operator()(osg::Node* node, osg::NodeVisitor* nv) { osgUtil::CullVisitor * cv = dynamic_cast<osgUtil::CullVisitor*>(nv); .... osgUtil::PositionalStateContainer::AttrMatrixList &aml = originalRenderStage->getPositionalStateContainer()->getAttrMatrixList(); .... // here I iterate over the list and after I use the osg::Light attrib with its associated matrix to compute stuff for the shader .... -- trajce nikolov nick
_______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org