diff --git a/components/resource/scenemanager.cpp b/components/resource/scenemanager.cpp index bb4c57e4c..de4e2bd1c 100644 --- a/components/resource/scenemanager.cpp +++ b/components/resource/scenemanager.cpp @@ -8,6 +8,9 @@ #include +#include +#include + #include #include @@ -103,6 +106,9 @@ namespace Resource NifOsg::Loader loader; osg::ref_ptr loaded = loader.load(Nif::NIFFilePtr(new Nif::NIFFile(file, normalized)), mTextureManager); + osgDB::Registry::instance()->getOrCreateSharedStateManager()->share(loaded.get()); + // TODO: run SharedStateManager::prune on unload + if (mIncrementalCompileOperation) mIncrementalCompileOperation->add(loaded);