Changeset 2360


Ignore:
Timestamp:
05/09/07 10:24:25 (17 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/Lib/Vis
Files:
3 added
7 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreOcclusionCullingSceneManager.h

    r2280 r2360  
    220220        /// if content of the nodes is shown in the visualization 
    221221        bool mRenderNodesContentForViz; 
     222 
     223        bool mRenderPvsForViz; 
    222224 
    223225        /// render transparents after the hierarchical traversal 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionCullingSceneManager.cpp

    r2289 r2360  
    6767mUseFromPointQueries(false), 
    6868mQueryMode(NODE_QUERIES), 
    69 mResetMaterialForQueries(false) 
     69mResetMaterialForQueries(false), 
     70mRenderPvsForViz(false) 
    7071{ 
    7172        Ogre::LogManager::getSingleton(). 
     
    180181                float max_z = mOptions.scale.z * mOptions.pageSize; 
    181182 
    182                 float maxAxis = std::max(max_x, max_y); 
    183                 maxAxis = std::max(maxAxis, max_z); 
    184                 resize(AxisAlignedBox( 0, 0, 0, maxAxis, maxAxis, maxAxis)); 
    185                 //resize(AxisAlignedBox( 0, 0, 0, max_x, max_y, max_z )); 
     183        if (1) 
     184                { 
     185                        // keep octree equal at all sides so nodes adapt better to small objects 
     186                        float maxAxis = std::max(max_x, max_y); 
     187                        maxAxis = std::max(maxAxis, max_z); 
     188                        resize(AxisAlignedBox( 0, 0, 0, maxAxis, maxAxis, maxAxis)); 
     189                } 
     190                else 
     191                { 
     192                        resize(AxisAlignedBox( 0, 0, 0, max_x, max_y, max_z)); 
     193                } 
    186194 
    187195                setupTerrainMaterial(); 
     
    631639    } 
    632640 
    633         // add bounding boxes of rendered objects 
    634         if (0) 
    635         for (BoxList::iterator it = mBoxes.begin(); it != mBoxes.end(); ++it) 
    636         { 
    637                 getRenderQueue()->addRenderable(*it); 
    638         } 
    639  
    640         // show current view cell geometry 
    641     if (mCurrentViewCell)// && mCurrentViewCell->GetMesh()) 
    642         { 
    643                 //const bool showSingleViewCell = true; 
    644                 if (mViewCellsGeometryLoaded) 
    645                 { 
    646                         ShowViewCellsGeometry(); 
    647                 } 
    648                  
    649                 ////////// 
    650                 //-- set PVS of view cell visible 
    651  
    652                 GtpVisibilityPreprocessor::ObjectPvsIterator pit =  
    653                         mCurrentViewCell->GetPvs().GetIterator(); 
    654  
    655                 MailPvsObjects(); 
    656  
    657                 while (pit.HasMoreEntries()) 
    658                 { 
    659                         RenderPvsEntry(pit.Next()); 
    660                 }        
    661         } 
    662 #if 0 
    663    if (mRenderNodesForViz || mRenderNodesContentForViz) 
    664         { 
    665                 // HACK: change node material so it is better suited for visualization 
    666                 MaterialPtr nodeMat = MaterialManager::getSingleton().getByName("Core/NodeMaterial"); 
    667                 nodeMat->setAmbient(1, 1, 0); 
    668                 nodeMat->setLightingEnabled(true); 
    669                 nodeMat->getTechnique(0)->getPass(0)->removeAllTextureUnitStates(); 
    670  
    671                 for (NodeList::iterator it = mVisible.begin(); it != mVisible.end(); ++it) 
    672                 { 
    673                         if (mRenderNodesForViz) 
     641        if (mRenderPvsForViz) 
     642        { 
     643                // show current view cell geometry 
     644                if (mCurrentViewCell)// && mCurrentViewCell->GetMesh()) 
     645                { 
     646                        //const bool showSingleViewCell = true; 
     647                        if (mViewCellsGeometryLoaded) 
    674648                        { 
    675                                 // render the visible leaf nodes 
    676                                 if ((*it)->numAttachedObjects() &&  
    677                                         !(*it)->numChildren() &&  
    678                                         ((*it)->getAttachedObject(0)->getMovableType() == "Entity") && 
    679                                         (*it)->getAttachedObject(0)->isVisible()) 
     649                                ShowViewCellsGeometry(); 
     650                        } 
     651 
     652                        ////////// 
     653                        //-- set PVS of view cell visible 
     654 
     655                        GtpVisibilityPreprocessor::ObjectPvsIterator pit =  
     656                                mCurrentViewCell->GetPvs().GetIterator(); 
     657 
     658                        MailPvsObjects(); 
     659 
     660                        while (pit.HasMoreEntries()) 
     661                        { 
     662                                RenderPvsEntry(pit.Next()); 
     663                        }        
     664                } 
     665        } 
     666        else 
     667        { 
     668                // add bounding boxes of rendered objects 
     669                if (1) 
     670                { 
     671                        for (BoxList::iterator it = mBoxes.begin(); it != mBoxes.end(); ++it) 
     672                        { 
     673                                getRenderQueue()->addRenderable(*it); 
     674                        } 
     675                } 
     676                if (mRenderNodesForViz || mRenderNodesContentForViz) 
     677                { 
     678                        // HACK: change node material so it is better suited for visualization 
     679                        MaterialPtr nodeMat = MaterialManager::getSingleton().getByName("Core/NodeMaterial"); 
     680                        nodeMat->setAmbient(1, 1, 0); 
     681                        nodeMat->setLightingEnabled(true); 
     682                        nodeMat->getTechnique(0)->getPass(0)->removeAllTextureUnitStates(); 
     683 
     684                        for (NodeList::iterator it = mVisible.begin(); it != mVisible.end(); ++it) 
     685                        { 
     686                                if (mRenderNodesForViz) 
    680687                                { 
    681                                         //getRenderQueue()->addRenderable((*it)); 
     688                                        // render the visible leaf nodes 
     689                                        if ((*it)->numAttachedObjects() &&  
     690                                                !(*it)->numChildren() &&  
     691                                                ((*it)->getAttachedObject(0)->getMovableType() == "Entity") && 
     692                                                (*it)->getAttachedObject(0)->isVisible()) 
     693                                        { 
     694                                                getRenderQueue()->addRenderable((*it)); 
     695                                                //(*it)->_addToRenderQueue(cam, getRenderQueue(), false); 
     696                                        } 
     697 
     698                                        // render bounding boxes of nodes 
     699                                        if (0) (*it)->_addBoundingBoxToQueue(getRenderQueue()); 
     700                                } 
     701 
     702                                // add renderables itself 
     703                                if (mRenderNodesContentForViz)  
     704                                { 
    682705                                        (*it)->_addToRenderQueue(cam, getRenderQueue(), false); 
    683706                                } 
    684  
    685                                 // add bounding boxes instead of node itself 
    686                                 if (0) (*it)->_addBoundingBoxToQueue(getRenderQueue()); 
    687707                        } 
    688  
    689                         // add renderables itself 
    690                         if (mRenderNodesContentForViz)  
    691                         { 
    692                                 (*it)->_addToRenderQueue(cam, getRenderQueue(), false); 
    693                         } 
    694                 } 
    695         } 
    696 #endif 
     708                } 
     709        } 
    697710} 
    698711//----------------------------------------------------------------------- 
     
    9941007                return true; 
    9951008        } 
     1009        if (key == "RenderPvsForViz") 
     1010        { 
     1011                mRenderPvsForViz = (*static_cast<const bool *>(val)); 
     1012                return true; 
     1013        } 
    9961014        if (key == "SkyBoxEnabled") 
    9971015        { 
     
    10161034        if (key == "DelayRenderTransparents") 
    10171035        { 
    1018                 //LoadScene(mFilename, mViewCellsFilename); 
    10191036                mDelayRenderTransparents = (*static_cast<const bool *>(val)); 
    10201037                return true; 
     
    19251942                ivReader.setLog(log); 
    19261943        } 
    1927          
    1928         //viennaNode->translate(Vector3(-300, -300, 0)); 
    19291944 
    19301945        if (ivReader.loadFile(filename.c_str())) 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOctreeHierarchyInterface.cpp

    r2332 r2360  
    189189void OctreeHierarchyInterface::DetermineVisibilityRatio(GtpVisibility::HierarchyNode *node) const 
    190190{        
     191#if 0    
    191192        Octree *octant = static_cast<Octree *>(node); 
    192193 
     
    229230        octant->setNumLeaves(numLeaves); 
    230231        octant->setNumVisibleLeaves(numVisibleLeaves); 
     232#endif 
    231233} 
    232234//----------------------------------------------------------------------- 
     
    285287bool OctreeHierarchyInterface::IsNodeFullyVisible(GtpVisibility::HierarchyNode *node) const 
    286288{ 
    287 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 
    288         //return static_cast<Octree *>(node)->getVisibilityRatio() > 0.9f; 
    289289        return static_cast<Octree *>(node)->isOctreeFullyVisible(); 
     290} 
     291//----------------------------------------------------------------------- 
     292float OctreeHierarchyInterface::GetNodeVisibilityRatio(GtpVisibility::HierarchyNode *node) const 
     293{ 
     294#if 0 
     295        return static_cast<Octree *>(node)->getVisibilityRatio(); 
    290296#else 
    291         return true; 
    292 #endif 
    293 } 
    294 //----------------------------------------------------------------------- 
    295 float OctreeHierarchyInterface::GetNodeVisibilityRatio(GtpVisibility::HierarchyNode *node) const 
    296 { 
    297 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 
    298         return static_cast<Octree *>(node)->getVisibilityRatio(); 
    299         //return static_cast<Octree *>(node)->isOctreeFullyVisible(); 
    300 #else 
    301         return true; 
     297        return 1.0f; 
    302298#endif 
    303299} 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/scripts/terrainCulling.cfg

    r2289 r2360  
    8484# 
    8585 
    86 #ViewCells=../../../../../../../GTP/trunk/Lib/Vis/Preprocessing/scripts/vienna-visibility.xml.gz 
     86ViewCells=../../../../../resources/media/vienna-visibility.xml.gz 
    8787 
    8888 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/src/GtpVisibility.vcproj

    r2353 r2360  
    259259                        </File> 
    260260                        <File 
     261                                RelativePath=".\CoherentHierarchicalCullingManager2.cpp"> 
     262                        </File> 
     263                        <File 
    261264                                RelativePath=".\CullingLogManager.cpp"> 
    262265                        </File> 
     
    266269                        <File 
    267270                                RelativePath="..\src\DummyPreprocessingManager.cpp"> 
     271                        </File> 
     272                        <File 
     273                                RelativePath=".\FlexibleHeap.h"> 
    268274                        </File> 
    269275                        <File 
     
    301307                        <File 
    302308                                RelativePath="..\include\CoherentHierarchicalCullingManager.h"> 
     309                        </File> 
     310                        <File 
     311                                RelativePath="..\include\CoherentHierarchicalCullingManager2.h"> 
    303312                        </File> 
    304313                        <File 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp

    r2332 r2360  
    13541354                optBool, 
    13551355                "gvs_per_viewcell=", 
    1356                 "false"); 
     1356                "true"); 
    13571357 
    13581358        RegisterOption("GvsPreprocessor.stats", 
  • GTP/trunk/Lib/Vis/Preprocessing/src/FlexibleHeap.h

    r2176 r2360  
    1515{ 
    1616public: 
     17         
    1718        Heapable(): mPriority(0) { NotInHeap(); SetPriority(0.0f); } 
    1819 
     
    2526        //inline float GetPriority() const  { return mPriority; } 
    2627        virtual float GetPriority() const = 0; 
     28 
    2729protected: 
    2830 
Note: See TracChangeset for help on using the changeset viewer.