mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-20 07:23:51 +00:00
Merge pull request #2274 from akortunov/terrain
Enable light sources directly to avoid virtual calls
This commit is contained in:
commit
0c11f903ab
1 changed files with 2 additions and 1 deletions
|
@ -245,7 +245,8 @@ namespace SceneUtil
|
||||||
osg::ref_ptr<LightStateAttribute> attr = new LightStateAttribute(mStartLight, lights);
|
osg::ref_ptr<LightStateAttribute> attr = new LightStateAttribute(mStartLight, lights);
|
||||||
// don't use setAttributeAndModes, that does not support light indices!
|
// don't use setAttributeAndModes, that does not support light indices!
|
||||||
stateset->setAttribute(attr, osg::StateAttribute::ON);
|
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
|
// need to push some dummy attributes to ensure proper state tracking
|
||||||
// lights need to reset to their default when the StateSet is popped
|
// lights need to reset to their default when the StateSet is popped
|
||||||
|
|
Loading…
Reference in a new issue