Changeset 1635 for GTP/trunk/Lib/Vis
- Timestamp:
- 10/18/06 02:32:32 (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
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; -
GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp
r1634 r1635 464 464 mViewSpaceSubdivisionType = NO_VIEWSPACE_SUBDIV; 465 465 466 // create just one view cell 467 SubdivisionCandidate *vspSc = 468 PrepareViewSpaceSubdivision(sampleRays, objects); 469 466 470 // start view space subdivison immediately? 467 471 if (StartViewSpaceSubdivision()) … … 469 473 // prepare vsp tree for traversal 470 474 mViewSpaceSubdivisionType = mSavedViewSpaceSubdivisionType; 471 SubdivisionCandidate *vspSc =472 PrepareViewSpaceSubdivision(sampleRays, objects);473 475 mTQueue.Push(vspSc); 474 476 } … … 487 489 sampleRays, 488 490 objects, 489 forcedViewSpace //,490 /*vspSc*/);491 forcedViewSpace,// 492 vspSc); 491 493 492 494 cout << "\nfinished in " << TimeDiff(startTime, GetTime()) * 1e-3 << " secs" << endl; … … 699 701 const VssRayContainer &sampleRays, 700 702 const ObjectContainer &objects, 701 AxisAlignedBox3 *forcedViewSpace) 703 AxisAlignedBox3 *forcedViewSpace, 704 SubdivisionCandidate *firstVsp) 702 705 { 703 706 while (!FinishedConstruction()) … … 736 739 << mMinDepthForViewSpaceSubdivion << ") " << endl; 737 740 738 SubdivisionCandidate *vspSc = PrepareViewSpaceSubdivision(sampleRays, objects);739 mTQueue.Push( vspSc);741 //SubdivisionCandidate *vspSc = PrepareViewSpaceSubdivision(sampleRays, objects); 742 mTQueue.Push(firstVsp); 740 743 741 744 cout << "reseting queue ... "; … … 889 892 mSavedViewSpaceSubdivisionType = mViewSpaceSubdivisionType; 890 893 mViewSpaceSubdivisionType = NO_VIEWSPACE_SUBDIV; 894 895 // first view cell 896 SubdivisionCandidate *vspVc = PrepareViewSpaceSubdivision(sampleRays, objects); 891 897 892 898 mSavedObjectSpaceSubdivisionType = mObjectSpaceSubdivisionType; … … 908 914 909 915 // subdivide object space first 910 911 916 ResetObjectSpaceSubdivision(sampleRays, objects); 912 917 … … 920 925 921 926 mSubdivisionStats.close(); 927 922 928 if ((i ++) >= limit) 923 929 break; … … 980 986 bool HierarchyManager::ViewSpaceSubdivisionConstructed() const 981 987 { 982 return mVspTree && mVspTree->GetRoot(); 988 return mViewSpaceSubdivisionType != NO_VIEWSPACE_SUBDIV; 989 //return mVspTree && mVspTree->GetRoot(); 983 990 } 984 991 -
GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.h
r1634 r1635 255 255 const VssRayContainer &sampleRays, 256 256 const ObjectContainer &objects, 257 AxisAlignedBox3 *forcedViewSpace); 257 AxisAlignedBox3 *forcedViewSpace, 258 SubdivisionCandidate *firstVsp); 258 259 259 260 /** This is for interleaved construction using some objects
Note: See TracChangeset
for help on using the changeset viewer.