Changeset 1635 for GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp
- Timestamp:
- 10/18/06 02:32:32 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp
r1634 r1635 520 520 // otherwise danger of being stuck in a local minimum!! 521 521 const float factor = mRenderCostDecreaseWeight; 522 const float priority = factor * renderCostDecr + (1.0f - factor) * oldRenderCost; 522 float priority; 523 524 if (mHierarchyManager->GetViewSpaceSubdivisionType() == 525 HierarchyManager::NO_VIEWSPACE_SUBDIV) 526 { 527 //////////////// 528 //-- surface area heuristics 529 530 // if (objects.empty()) 531 // return 0.0f; 532 533 const AxisAlignedBox3 box = EvalBoundingBox(leaf->mObjects); 534 const float area = box.SurfaceArea(); 535 const float viewSpaceArea = mViewCellsManager->GetViewSpaceBox().SurfaceArea(); 536 537 priority = (float)leaf->mObjects.size() * area / viewSpaceArea; 538 } 539 else 540 { 541 priority = factor * renderCostDecr + (1.0f - factor) * oldRenderCost; 542 } 543 523 544 #else 524 545 const float priority = (float)-splitCandidate.mParentData.mDepth; … … 1360 1381 float BvHierarchy::EvalRenderCost(const ObjectContainer &objects) const 1361 1382 { 1362 if (mHierarchyManager->GetViewSpaceSubdivisionType() == 1363 HierarchyManager::NO_VIEWSPACE_SUBDIV) 1383 if (0 && 1384 (mHierarchyManager->GetViewSpaceSubdivisionType() == 1385 HierarchyManager::NO_VIEWSPACE_SUBDIV)) 1364 1386 { 1365 1387 //////////////// … … 1450 1472 { 1451 1473 // no view cells yet 1452 if ( mHierarchyManager->GetViewSpaceSubdivisionType() ==1474 if (0 && mHierarchyManager->GetViewSpaceSubdivisionType() == 1453 1475 HierarchyManager::NO_VIEWSPACE_SUBDIV) 1454 1476 return; … … 1543 1565 { 1544 1566 // no view cells yet 1545 if ( mHierarchyManager->GetViewSpaceSubdivisionType() ==1567 if (0 && mHierarchyManager->GetViewSpaceSubdivisionType() == 1546 1568 HierarchyManager::NO_VIEWSPACE_SUBDIV) 1547 1569 return 1;
Note: See TracChangeset
for help on using the changeset viewer.