[osg-users] Getting LigtModel from viewer

Claudio Benghi claudio.benghi at gmail.com
Mon Apr 8 01:39:46 PDT 2019

Hello Robert,

Your solution works very well, the code I'm using to get the LightModel is 


osg::LightModel *lightModel = dynamic_cast<osg::LightModel*> (viewer->getCamera()->getStateSet()->getAttribute(osg::StateAttribute::LIGHTMODEL));

I've already tested that changing its state does affect the render as expected.

It's a good sign that even after years of evolution you have access to nested instances so easily. Keep up the great work.

Thank you!

Read this topic online here:

More information about the osg-users mailing list