Skip to content

Commit

Permalink
Merge pull request #2274 from akortunov/terrain
Browse files Browse the repository at this point in the history
Enable light sources directly to avoid virtual calls
  • Loading branch information
psi29a committed Mar 21, 2019
2 parents e14682e + b466bfe commit 0c11f90
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion components/sceneutil/lightmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,8 @@ namespace SceneUtil
osg::ref_ptr<LightStateAttribute> attr = new LightStateAttribute(mStartLight, lights);
// don't use setAttributeAndModes, that does not support light indices!
stateset->setAttribute(attr, osg::StateAttribute::ON);
stateset->setAssociatedModes(attr, osg::StateAttribute::ON);
for (unsigned int i=0; i<lightList.size(); ++i)
stateset->setMode(GL_LIGHT0 + mStartLight + i, osg::StateAttribute::ON);

// need to push some dummy attributes to ensure proper state tracking
// lights need to reset to their default when the StateSet is popped
Expand Down

0 comments on commit 0c11f90

Please sign in to comment.