Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable light sources directly to avoid virtual calls #2274

Merged
merged 1 commit into from
Mar 21, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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