diff --git a/components/resource/scenemanager.cpp b/components/resource/scenemanager.cpp index 3112e3c837..b468b430ff 100644 --- a/components/resource/scenemanager.cpp +++ b/components/resource/scenemanager.cpp @@ -251,6 +251,13 @@ namespace Resource node.getOrCreateStateSet()->setAttributeAndModes(depth, osg::StateAttribute::ON); } + else if (node.getOrCreateStateSet()->getRenderingHint() == osg::StateSet::OPAQUE_BIN) + { + osg::ref_ptr depth = SceneUtil::createDepth(); + depth->setWriteMask(true); + + node.getOrCreateStateSet()->setAttributeAndModes(depth, osg::StateAttribute::ON); + } /* Check if the has correct format for OpenMW: alphatest mode value MaterialName