Changeset 1610 for GTP/trunk/Lib/Vis/Preprocessing
- Timestamp:
- 10/11/06 05:35:33 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
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.