Show
Ignore:
Timestamp:
03/10/09 15:15:59 (5 years ago)
Author:
robert
Message:

From Roland Smeenk, "While working on the Collada plugin I noticed that all geometry created by the dae reader result in slow path geometry.
Because there already exists the option to convert slow path geometry to the fast path by computing an internal fast path alternative, I added a new optimizer option that automatically does this. To check the results I also made some changes to the statistics gathering and rendering.

Somewhat unrelated, but also part of the optimizer I disabled removal of CameraView? nodes during RemoveRedundantNodes? optimization.
As discussed on the ML, CameraViews? were removed from the scenegraph. This solves that issue.

Summary:
-Geometry::areFastPathsUsed now also looks at internalOptimizedGeometry
-Added Optimize option to make all slow path geometry compute their internal fast path alternative
-Added fast geometry counter to the statistics
-Disabled removel of CameraViews? in optimizer
"

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/include/osgUtil/Optimizer

    r9245 r9886  
    7575            MERGE_GEOMETRY =            (1 << 5), 
    7676            CHECK_GEOMETRY =            (1 << 6), 
    77             SPATIALIZE_GROUPS =         (1 << 7), 
    78             COPY_SHARED_NODES =         (1 << 8), 
    79             TRISTRIP_GEOMETRY =         (1 << 9), 
    80             TESSELLATE_GEOMETRY =       (1 << 10), 
    81             OPTIMIZE_TEXTURE_SETTINGS = (1 << 11), 
    82             MERGE_GEODES =              (1 << 12), 
    83             FLATTEN_BILLBOARDS =        (1 << 13), 
    84             TEXTURE_ATLAS_BUILDER =     (1 << 14), 
    85             STATIC_OBJECT_DETECTION =   (1 << 15), 
    86             FLATTEN_STATIC_TRANSFORMS_DUPLICATING_SHARED_SUBGRAPHS = (1 << 16), 
     77            MAKE_FAST_GEOMETRY =        (1 << 7), 
     78            SPATIALIZE_GROUPS =         (1 << 8), 
     79            COPY_SHARED_NODES =         (1 << 9), 
     80            TRISTRIP_GEOMETRY =         (1 << 10), 
     81            TESSELLATE_GEOMETRY =       (1 << 11), 
     82            OPTIMIZE_TEXTURE_SETTINGS = (1 << 12), 
     83            MERGE_GEODES =              (1 << 13), 
     84            FLATTEN_BILLBOARDS =        (1 << 14), 
     85            TEXTURE_ATLAS_BUILDER =     (1 << 15), 
     86            STATIC_OBJECT_DETECTION =   (1 << 16), 
     87            FLATTEN_STATIC_TRANSFORMS_DUPLICATING_SHARED_SUBGRAPHS = (1 << 17), 
    8788            DEFAULT_OPTIMIZATIONS = FLATTEN_STATIC_TRANSFORMS | 
    8889                                REMOVE_REDUNDANT_NODES | 
     
    9192                                SHARE_DUPLICATE_STATE | 
    9293                                MERGE_GEOMETRY | 
     94                                MAKE_FAST_GEOMETRY | 
    9395                                CHECK_GEOMETRY | 
    9496                                OPTIMIZE_TEXTURE_SETTINGS | 
     
    101103                                MERGE_GEODES | 
    102104                                MERGE_GEOMETRY | 
     105                                MAKE_FAST_GEOMETRY | 
    103106                                CHECK_GEOMETRY | 
    104107                                SPATIALIZE_GROUPS | 
     
    507510        }; 
    508511         
     512        class OSGUTIL_EXPORT MakeFastGeometryVisitor : public BaseOptimizerVisitor 
     513        { 
     514            public: 
     515 
     516                /// default to traversing all children. 
     517                MakeFastGeometryVisitor(Optimizer* optimizer=0): 
     518                    BaseOptimizerVisitor(optimizer, MAKE_FAST_GEOMETRY) {} 
     519 
     520                virtual void apply(osg::Geode& geode) { checkGeode(geode); } 
     521 
     522                void checkGeode(osg::Geode& geode); 
     523                 
     524        };         
     525         
    509526        class OSGUTIL_EXPORT MergeGeometryVisitor : public BaseOptimizerVisitor 
    510527        {