From 553408949af813d7716d07bcdf443328d8f44815 Mon Sep 17 00:00:00 2001 From: scrawl Date: Wed, 17 Feb 2016 01:56:47 +0100 Subject: [PATCH] Fix character preview --- apps/openmw/mwrender/characterpreview.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/openmw/mwrender/characterpreview.cpp b/apps/openmw/mwrender/characterpreview.cpp index 1c9c3be4b..b9f20f4ea 100644 --- a/apps/openmw/mwrender/characterpreview.cpp +++ b/apps/openmw/mwrender/characterpreview.cpp @@ -99,7 +99,7 @@ namespace MWRender osg::ref_ptr lightManager = new SceneUtil::LightManager; lightManager->setStartLight(1); - osg::ref_ptr stateset = new osg::StateSet; + osg::ref_ptr stateset = lightManager->getOrCreateStateSet(); stateset->setMode(GL_LIGHTING, osg::StateAttribute::ON); stateset->setMode(GL_NORMALIZE, osg::StateAttribute::ON); stateset->setMode(GL_CULL_FACE, osg::StateAttribute::ON); @@ -130,7 +130,6 @@ namespace MWRender lightSource->setStateSetModes(*stateset, osg::StateAttribute::ON); - lightManager->setStateSet(stateset); lightManager->addChild(lightSource); mCamera->addChild(lightManager);