Changeset 1610


Ignore:
Timestamp:
10/11/06 05:35:33 (18 years ago)
Author:
mattausch
Message:

removed vsposp bug

Location:
GTP/trunk/Lib/Vis
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionCullingSceneManager.cpp

    r1606 r1610  
    7272void OcclusionCullingSceneManager::InitDepthPass() 
    7373{ 
    74         MaterialPtr depthMat = MaterialManager::getSingleton().getByName("Visibility/DepthPass"); 
     74        MaterialPtr depthMat =  
     75                MaterialManager::getSingleton().getByName("Visibility/DepthPass"); 
    7576 
    7677        if (depthMat.isNull()) 
     
    106107    { 
    107108                // Init 
    108                 itemBufferMat = MaterialManager::getSingleton().create("Visibility/ItemBufferPass", 
     109                itemBufferMat =  
     110                        MaterialManager::getSingleton().create("Visibility/ItemBufferPass", 
    109111                ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME); 
    110112 
     
    132134            ResourceGroupManager::getSingleton().getWorldResourceGroupName()); 
    133135    } 
     136         
    134137        destroyLevelIndexes(); 
    135138    mTerrainPages.clear(); 
     139 
    136140    // Load the configuration 
    137141    loadConfig(stream); 
     
    361365void OcclusionCullingSceneManager::_renderVisibleObjects() 
    362366{ 
    363          
    364367        if (mNormalExecution) 
    365368        { 
    366369                // the standard octree rendering mode 
    367370                TerrainSceneManager::_renderVisibleObjects(); 
     371                getRenderQueue()->clear(mDeleteQueueAfterRendering); 
    368372                return; 
    369373        } 
     
    11231127                // if no there is no view cell, set everything visible 
    11241128                SetObjectsVisible(true); 
     1129 
    11251130                return; 
    11261131        } 
     
    11341139        for (oit = vc->GetPvs().mEntries.begin(); oit != oit_end; ++ oit) 
    11351140        { 
     1141                // no associated geometry found 
    11361142                if (!(*oit).first) continue; 
    11371143 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/README.txt

    r1246 r1610  
    5151 
    5252 
    53 8) start TerrainExampleApplication for testing 
     538) TestCullingTerrain is the test application 
     54 
     55take the path to the Ogre Release as working directory, e.g., 
     56D:\svn\gametools\OGRE\trunk\ogrenew\Samples\Common\bin\Release 
     57 
     58start TestCullingTerrain 
  • GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp

    r1580 r1610  
    544544inline bool BvHierarchy::GlobalTerminationCriteriaMet(const BvhTraversalData &data) const 
    545545{ 
     546        // note: tracking for global cost termination  
     547        // does not make much sense for interleaved vsp / osp partition 
     548        // as it is the responsibility of the hierarchy manager 
     549 
    546550        const bool terminationCriteriaMet = 
    547551                (0 
    548552                || (mBvhStats.Leaves() >= mTermMaxLeaves) 
    549                 // does not make much sense for interleaved vsp / osp partition 
    550553                //|| (mBvhStats.mGlobalCostMisses >= mTermGlobalCostMissTolerance) 
    551554                //|| mOutOfMemory  
    552555                ); 
    553556 
    554         if (0 && terminationCriteriaMet) 
     557        if (1 && terminationCriteriaMet) 
    555558        { 
    556559                Debug << "bvh global termination criteria met:" << endl; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp

    r1580 r1610  
    231231                ); 
    232232 
    233         if (0 && terminationCriteriaMet) 
     233#if _DEBUG 
     234        if (terminationCriteriaMet) 
    234235        { 
    235236                Debug << "hierarchy global termination criteria met:" << endl; 
     
    237238                Debug << "cost misses: " << mHierarchyStats.mGlobalCostMisses << " " << mTermGlobalCostMissTolerance << endl; 
    238239        } 
     240#endif 
     241 
    239242        return terminationCriteriaMet; 
    240243} 
     
    327330 
    328331        mTotalCost = mVspTree->mTotalCost; 
    329         Debug << "\nreseting cost, new total cost: " << mTotalCost << endl; 
     332        cout << "\nreseting cost for vsp, new total cost: " << mTotalCost << endl; 
    330333 
    331334        mTQueue.Push(vsc); 
     
    392395bool HierarchyManager::ApplySubdivisionCandidate(SubdivisionCandidate *sc, const bool repairQueue) 
    393396{ 
     397        // test if global termination criteria were met before this split 
    394398        const bool globalTerminationCriteriaMet = GlobalTerminationCriteriaMet(sc); 
    395399        const bool vspSplit = (sc->Type() == SubdivisionCandidate::VIEW_SPACE); 
    396400 
    397         if (!globalTerminationCriteriaMet) 
    398         { 
    399                 // cost ratio of cost decrease / totalCost 
    400                 const float costRatio = mCurrentCandidate->GetRenderCostDecrease() / mTotalCost; 
    401                 //Debug << "ratio: " << costRatio << " min ratio: " << mTermMinGlobalCostRatio << endl; 
    402          
    403                 if (costRatio < mTermMinGlobalCostRatio) 
    404                 { 
    405                         ++ mHierarchyStats.mGlobalCostMisses; 
    406                 } 
    407  
    408                 mTotalCost -= mCurrentCandidate->GetRenderCostDecrease(); 
    409         } 
    410  
    411         bool success; 
     401        bool success = false; 
     402 
    412403        switch (sc->Type()) 
    413404        { 
     
    438429        } 
    439430 
     431        if (!success) // split was not taken 
     432        { 
     433                return false; 
     434        } 
     435 
     436        /////////////// 
     437        //-- split was successful =>  
     438        //-- update stats and render queue 
     439 
     440    // cost ratio of cost decrease / totalCost 
     441        const float costRatio = mCurrentCandidate->GetRenderCostDecrease() / mTotalCost; 
     442        //Debug << "ratio: " << costRatio << " min ratio: " << mTermMinGlobalCostRatio << endl; 
     443         
     444        if (costRatio < mTermMinGlobalCostRatio) 
     445        { 
     446                ++ mHierarchyStats.mGlobalCostMisses; 
     447        } 
     448         
     449        mTotalCost -= mCurrentCandidate->GetRenderCostDecrease(); 
     450         
    440451        cout << sc->Type() << " "; 
    441452                 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.cpp

    r1588 r1610  
    582582                ); 
    583583 
    584         if (0 && localTerminationCriteriaMet) 
     584#if _DEBUG 
     585        if (localTerminationCriteriaMet) 
    585586        { 
    586587                Debug << "local termination criteria met:" << endl; 
     
    591592                Debug << "depth " << data.mDepth << " " << mTermMaxDepth << endl; 
    592593        } 
    593  
     594#endif 
    594595        return localTerminationCriteriaMet;              
    595596} 
     
    598599inline bool VspTree::GlobalTerminationCriteriaMet(const VspTraversalData &data) const 
    599600{ 
     601        // note: to track for global cost misses does not really  
     602        // make sense because cost termination  happens in the hierarchy mananger 
     603 
    600604        const bool terminationCriteriaMet = (0 
    601605                // || mOutOfMemory 
    602606                || (mVspStats.Leaves() >= mMaxViewCells) 
    603                 // does not really make sense because cost termination already in hierarchy 
    604607                // || (mVspStats.mGlobalCostMisses >= mTermGlobalCostMissTolerance)  
    605608                ); 
    606609 
    607         if (0 && terminationCriteriaMet) 
     610#if _DEBUG 
     611        if (terminationCriteriaMet) 
    608612        { 
    609613                Debug << "vsp global termination criteria met:" << endl; 
     
    611615                Debug << "leaves: " << mVspStats.Leaves() << " " <<  mMaxViewCells << endl; 
    612616        } 
     617#endif 
    613618 
    614619        return terminationCriteriaMet; 
Note: See TracChangeset for help on using the changeset viewer.