diff --git a/src/osgPlugins/osg/LightSource.cpp b/src/osgPlugins/osg/LightSource.cpp index d7b8e51b7..d54fe4973 100644 --- a/src/osgPlugins/osg/LightSource.cpp +++ b/src/osgPlugins/osg/LightSource.cpp @@ -29,6 +29,8 @@ bool LightSource_readLocalData(Object& obj, Input& fr) if (fr[0].matchWord("referenceFrame")) { + bool cullingActiveBefore = lightsource.getCullingActive(); + if (fr[1].matchWord("RELATIVE_TO_ABSOLUTE") || fr[1].matchWord("ABSOLUTE")) { lightsource.setReferenceFrame(LightSource::ABSOLUTE_RF); @@ -41,6 +43,12 @@ bool LightSource_readLocalData(Object& obj, Input& fr) fr += 2; iteratorAdvanced = true; } + + // if culling wasn't before reset it to off. + if (!cullingActiveBefore && lightsource.getCullingActive()) + { + lightsource.setCullingActive(cullingActiveBefore); + } } osg::ref_ptr sa=fr.readStateAttribute();