Attached is a patch for osgUtil::Optimizer. If you run the SpatializeGroupsVisitor on a scene graph containing Geodes, StateSets attached to Geodes can be lost.
The problem is in SpatializeGroupsVisitor::divide(osg::Geode*, unsigned int) where the code creates a new Group and divides up the input Geode into one Geode per Drawable.
I fixed the problem by assigning the Geode's stateset to the new parent group.
To replicate the bug, see attached osg/dds files:
osgviewer b.osg -- model renders correctly
osgviewer b.osg -- textures are missing.
Glenn Waldron : Pelican Mapping : http://pelicanmapping.com
Post generated by Mail2Forum