Changeset 1610 for GTP/trunk/Lib
- Timestamp:
- 10/11/06 05:35:33 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionCullingSceneManager.cpp
r1606 r1610 72 72 void OcclusionCullingSceneManager::InitDepthPass() 73 73 { 74 MaterialPtr depthMat = MaterialManager::getSingleton().getByName("Visibility/DepthPass"); 74 MaterialPtr depthMat = 75 MaterialManager::getSingleton().getByName("Visibility/DepthPass"); 75 76 76 77 if (depthMat.isNull()) … … 106 107 { 107 108 // Init 108 itemBufferMat = MaterialManager::getSingleton().create("Visibility/ItemBufferPass", 109 itemBufferMat = 110 MaterialManager::getSingleton().create("Visibility/ItemBufferPass", 109 111 ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME); 110 112 … … 132 134 ResourceGroupManager::getSingleton().getWorldResourceGroupName()); 133 135 } 136 134 137 destroyLevelIndexes(); 135 138 mTerrainPages.clear(); 139 136 140 // Load the configuration 137 141 loadConfig(stream); … … 361 365 void OcclusionCullingSceneManager::_renderVisibleObjects() 362 366 { 363 364 367 if (mNormalExecution) 365 368 { 366 369 // the standard octree rendering mode 367 370 TerrainSceneManager::_renderVisibleObjects(); 371 getRenderQueue()->clear(mDeleteQueueAfterRendering); 368 372 return; 369 373 } … … 1123 1127 // if no there is no view cell, set everything visible 1124 1128 SetObjectsVisible(true); 1129 1125 1130 return; 1126 1131 } … … 1134 1139 for (oit = vc->GetPvs().mEntries.begin(); oit != oit_end; ++ oit) 1135 1140 { 1141 // no associated geometry found 1136 1142 if (!(*oit).first) continue; 1137 1143 -
GTP/trunk/Lib/Vis/OnlineCullingCHC/README.txt
r1246 r1610 51 51 52 52 53 8) start TerrainExampleApplication for testing 53 8) TestCullingTerrain is the test application 54 55 take the path to the Ogre Release as working directory, e.g., 56 D:\svn\gametools\OGRE\trunk\ogrenew\Samples\Common\bin\Release 57 58 start TestCullingTerrain -
GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp
r1580 r1610 544 544 inline bool BvHierarchy::GlobalTerminationCriteriaMet(const BvhTraversalData &data) const 545 545 { 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 546 550 const bool terminationCriteriaMet = 547 551 (0 548 552 || (mBvhStats.Leaves() >= mTermMaxLeaves) 549 // does not make much sense for interleaved vsp / osp partition550 553 //|| (mBvhStats.mGlobalCostMisses >= mTermGlobalCostMissTolerance) 551 554 //|| mOutOfMemory 552 555 ); 553 556 554 if ( 0&& terminationCriteriaMet)557 if (1 && terminationCriteriaMet) 555 558 { 556 559 Debug << "bvh global termination criteria met:" << endl; -
GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp
r1580 r1610 231 231 ); 232 232 233 if (0 && terminationCriteriaMet) 233 #if _DEBUG 234 if (terminationCriteriaMet) 234 235 { 235 236 Debug << "hierarchy global termination criteria met:" << endl; … … 237 238 Debug << "cost misses: " << mHierarchyStats.mGlobalCostMisses << " " << mTermGlobalCostMissTolerance << endl; 238 239 } 240 #endif 241 239 242 return terminationCriteriaMet; 240 243 } … … 327 330 328 331 mTotalCost = mVspTree->mTotalCost; 329 Debug << "\nreseting cost, new total cost: " << mTotalCost << endl;332 cout << "\nreseting cost for vsp, new total cost: " << mTotalCost << endl; 330 333 331 334 mTQueue.Push(vsc); … … 392 395 bool HierarchyManager::ApplySubdivisionCandidate(SubdivisionCandidate *sc, const bool repairQueue) 393 396 { 397 // test if global termination criteria were met before this split 394 398 const bool globalTerminationCriteriaMet = GlobalTerminationCriteriaMet(sc); 395 399 const bool vspSplit = (sc->Type() == SubdivisionCandidate::VIEW_SPACE); 396 400 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 412 403 switch (sc->Type()) 413 404 { … … 438 429 } 439 430 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 440 451 cout << sc->Type() << " "; 441 452 -
GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.cpp
r1588 r1610 582 582 ); 583 583 584 if (0 && localTerminationCriteriaMet) 584 #if _DEBUG 585 if (localTerminationCriteriaMet) 585 586 { 586 587 Debug << "local termination criteria met:" << endl; … … 591 592 Debug << "depth " << data.mDepth << " " << mTermMaxDepth << endl; 592 593 } 593 594 #endif 594 595 return localTerminationCriteriaMet; 595 596 } … … 598 599 inline bool VspTree::GlobalTerminationCriteriaMet(const VspTraversalData &data) const 599 600 { 601 // note: to track for global cost misses does not really 602 // make sense because cost termination happens in the hierarchy mananger 603 600 604 const bool terminationCriteriaMet = (0 601 605 // || mOutOfMemory 602 606 || (mVspStats.Leaves() >= mMaxViewCells) 603 // does not really make sense because cost termination already in hierarchy604 607 // || (mVspStats.mGlobalCostMisses >= mTermGlobalCostMissTolerance) 605 608 ); 606 609 607 if (0 && terminationCriteriaMet) 610 #if _DEBUG 611 if (terminationCriteriaMet) 608 612 { 609 613 Debug << "vsp global termination criteria met:" << endl; … … 611 615 Debug << "leaves: " << mVspStats.Leaves() << " " << mMaxViewCells << endl; 612 616 } 617 #endif 613 618 614 619 return terminationCriteriaMet;
Note: See TracChangeset
for help on using the changeset viewer.