Changeset 9988

Show
Ignore:
Timestamp:
04/08/09 12:50:30 (5 years ago)
Author:
robert
Message:

From Glen Waldron, "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
set OSG_OPTIMIZER="SPATIALIZE_GROUPS"
osgviewer b.osg -- textures are missing."

Merged from svn/trunk using:

svn merge -r 9986:9987 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk/src/osgUtil/Optimizer.cpp

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/branches/OpenSceneGraph-2.8/src/osgUtil/Optimizer.cpp

    • Property svn:mergeinfo
      •  

        old new  
        11/OpenSceneGraph/trunk/include/osg/src/osgUtil/Optimizer.cpp:9882 
        2 /OpenSceneGraph/trunk/src/osgUtil/Optimizer.cpp:9902,9920 
         2/OpenSceneGraph/trunk/src/osgUtil/Optimizer.cpp:9902,9920,9987 
    r9921 r9988  
    27932793 
    27942794    osg::ref_ptr<osg::Group> group = new osg::Group; 
     2795    group->setName(geode->getName()); 
     2796    group->setStateSet(geode->getStateSet()); 
    27952797    for(i=0; i<geode->getNumDrawables(); ++i) 
    27962798    {