Changeset 1663 for GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp
- Timestamp:
- 10/22/06 17:35:23 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp
r1662 r1663 28 28 #define USE_VOLUMES_FOR_HEURISTICS 1 29 29 30 #define CONSIDER_MEMORY 1 30 31 31 32 int BvhNode::sMailId = 10000; //2147483647; … … 502 503 const bool maxCostRatioViolated = mTermMaxCostRatio < ratio; 503 504 505 const int previousMisses = splitCandidate.mParentData.mMaxCostMisses; 506 504 507 splitCandidate.SetMaxCostMisses(maxCostRatioViolated ? 505 splitCandidate.mParentData.mMaxCostMisses + 1 : 506 splitCandidate.mParentData.mMaxCostMisses); 508 previousMisses + 1 : previousMisses); 507 509 508 510 const float oldProp = EvalViewCellsVolume(leaf->mObjects); … … 516 518 const float renderCostDecr = oldRenderCost - newRenderCost; 517 519 520 splitCandidate.SetRenderCostDecrease(renderCostDecr); 521 522 // increase in pvs entries 523 const int pvsEntriesIncr = EvalPvsEntriesIncr(splitCandidate); 524 splitCandidate.SetPvsEntriesIncr(pvsEntriesIncr); 525 518 526 #ifdef _DEBUG 519 527 Debug << "old render cost: " << oldRenderCost << endl; … … 539 547 else 540 548 { 549 const float factor = mRenderCostDecreaseWeight; 550 541 551 // take render cost of node into account 542 552 // otherwise danger of being stuck in a local minimum!! 543 priority = mRenderCostDecreaseWeight * renderCostDecr + 544 (1.0f - mRenderCostDecreaseWeight) * oldRenderCost; 553 #if CONSIDER_MEMORY 554 const float priority = factor * renderCostDecr - (1.0f - factor) * splitCandidate.GetPvsEntriesIncr(); 555 #else 556 const float priority = factor * renderCostDecr + (1.0f - factor) * oldRenderCost; 557 #endif 545 558 } 546 559 … … 548 561 const float priority = (float)-splitCandidate.mParentData.mDepth; 549 562 #endif 550 551 splitCandidate.SetRenderCostDecrease(renderCostDecr);552 553 // increase in pvs entries554 const int pvsEntriesIncr = EvalPvsEntriesIncr(splitCandidate);555 splitCandidate.SetPvsEntriesIncr(pvsEntriesIncr);556 563 557 564 // compute global decrease in render cost … … 583 590 // otherwise danger of being stuck in a local minimum!! 584 591 const float factor = mRenderCostDecreaseWeight; 592 // $$ matt temp 593 #if CONSIDER_MEMORY 594 const float priority = factor * renderCostDecr - (1.0f - factor) * splitCandidate.GetPvsEntriesIncr(); 595 #else 585 596 const float priority = factor * renderCostDecr + (1.0f - factor) * oldRenderCost; 597 #endif 586 598 #else 587 599 const float priority = (float)-splitCandidate.mParentData.mDepth;
Note: See TracChangeset
for help on using the changeset viewer.