Changeset 1640 for GTP/trunk/Lib/Vis
- Timestamp:
- 10/18/06 18:17:27 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionCullingSceneManager.cpp
r1623 r1640 160 160 void OcclusionCullingSceneManager::PrepareVisualization(Camera *cam) 161 161 { 162 //Ogre::LogManager::getSingleton().logMessage("here4");163 162 // add player camera for visualization purpose 164 163 try -
GTP/trunk/Lib/Vis/Preprocessing/scripts/vsposp_typical.env
r1633 r1640 184 184 VspTree { 185 185 Construction { 186 samples 100000187 186 } 188 187 … … 225 224 226 225 Construction { 227 # type 0 = sequential computation, type 1=interleaved 228 type 2 226 227 samples 100000 228 229 # type 0 = sequential computation, 1 = interleaved, 2 = gradient 230 type 1 231 229 232 # if the object space should be subdivided first (if false, the view space is subdivided first) 230 233 startWithObjectSpace true … … 233 236 # only for interleaved method 234 237 235 # only for interleaved method: the minimum depth for object space partition236 minDepthForOsp 7237 # the minimum depth for view space partition238 minDepthForVsp 7239 240 238 # if dirty split candidates are reevaluated 241 repairQueue false 239 repairQueue true 240 241 # recompute split plane when "repairing" a candidate 242 recomputeSplitPlaneOnRepair false 242 243 243 244 ################################################### … … 249 250 levels 4 250 251 251 # recompute split plane when "repairing" a candidate252 recomputeSplitPlaneOnRepair true252 # minimal steps of same type: for interleaved, this is only valid for the first few splits 253 minStepsOfSameType 200 253 254 } 254 255 -
GTP/trunk/Lib/Vis/Preprocessing/scripts/vsposp_typical.sh
r1633 r1640 12 12 13 13 SCENE=vsposp_typical 14 #SCENE=vsposp_vienna 14 15 #SCENE=soda5 15 16 #SCENE=cube … … 25 26 26 27 27 METHOD= sequential28 METHOD=interleaved_full 28 29 echo "$SCENE $METHOD" 29 30 … … 34 35 -bvh_subdivision_stats=$LOG_PREFIX-$METHOD-bvh-subdivisionStats.log \ 35 36 -hierarchy_subdivision_stats=$LOG_PREFIX-$METHOD-hierarchy-subdivisionStats.log \ 36 -hierarchy_construction_start_with_osp=true 37 -hierarchy_construction_type=1 \ 38 -hierarchy_construction_recompute_split_on_repair=true 37 39 38 40 mv debug.log $LOG_PREFIX-$METHOD-debug.log … … 40 42 mv final_object_partition.wrl $LOG_PREFIX-$METHOD-final_object_partition.wrl 41 43 mv final_view_cells.wrl $LOG_PREFIX-$METHOD-final_view_cells.wrl 44 45 46 METHOD=interleaved 47 echo "$SCENE $METHOD" 48 49 $PROGRAM $ENVIRONMENT \ 50 -view_cells_evaluation_stats_prefix=$LOG_PREFIX-$METHOD \ 51 -view_cells_merge_stats=$LOG_PREFIX-$METHOD-mergeStats.log \ 52 -vsp_subdivision_stats=$LOG_PREFIX-$METHOD-vsp-subdivisionStats.log \ 53 -bvh_subdivision_stats=$LOG_PREFIX-$METHOD-bvh-subdivisionStats.log \ 54 -hierarchy_subdivision_stats=$LOG_PREFIX-$METHOD-hierarchy-subdivisionStats.log \ 55 -hierarchy_construction_type=1 \ 56 -hierarchy_construction_recompute_split_on_repair=false 57 58 mv debug.log $LOG_PREFIX-$METHOD-debug.log 59 mv view_cells.wrl $LOG_PREFIX-$METHOD-view_cells.wrl 60 mv final_object_partition.wrl $LOG_PREFIX-$METHOD-final_object_partition.wrl 61 mv final_view_cells.wrl $LOG_PREFIX-$METHOD-final_view_cells.wrl 62 63 64 METHOD=gradient 65 echo "$SCENE $METHOD" 66 67 $PROGRAM $ENVIRONMENT \ 68 -view_cells_evaluation_stats_prefix=$LOG_PREFIX-$METHOD \ 69 -view_cells_merge_stats=$LOG_PREFIX-$METHOD-mergeStats.log \ 70 -vsp_subdivision_stats=$LOG_PREFIX-$METHOD-vsp-subdivisionStats.log \ 71 -bvh_subdivision_stats=$LOG_PREFIX-$METHOD-bvh-subdivisionStats.log \ 72 -hierarchy_subdivision_stats=$LOG_PREFIX-$METHOD-hierarchy-subdivisionStats.log \ 73 -hierarchy_construction_type=2 \ 74 -hierarchy_construction_recompute_split_on_repair=true 75 76 mv debug.log $LOG_PREFIX-$METHOD-debug.log 77 mv view_cells.wrl $LOG_PREFIX-$METHOD-view_cells.wrl 78 mv final_object_partition.wrl $LOG_PREFIX-$METHOD-final_object_partition.wrl 79 mv final_view_cells.wrl $LOG_PREFIX-$METHOD-final_view_cells.wrl -
GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp
r1636 r1640 1501 1501 mHierarchyManager->mVspTree->GetViewCells(*ray, tmpViewCells); 1502 1502 1503 // matt: probably slow to allocate memory for view cells every time 1503 1504 ViewCellContainer::const_iterator vit, vit_end = tmpViewCells.end(); 1504 1505 … … 1786 1787 1787 1788 1788 void BvHierarchy:: CreateRoot(const ObjectContainer &objects)1789 void BvHierarchy::Initialise(const ObjectContainer &objects) 1789 1790 { 1790 1791 /////// … … 1796 1797 mRoot = bvhleaf; 1797 1798 1799 // compute bounding box from objects 1800 mBoundingBox = mRoot->GetBoundingBox(); 1801 1798 1802 // associate root with current objects 1799 1803 AssociateObjectsWithLeaf(bvhleaf); 1800 1804 } 1805 1801 1806 1802 1807 /* … … 1831 1836 BvhSubdivisionCandidate::sBvHierarchy = this; 1832 1837 1833 // create new root 1834 CreateRoot(objects); 1835 1836 // compute bounding box from objects 1837 mBoundingBox = mRoot->GetBoundingBox(); 1838 // root and bounding box was already constructed 1838 1839 BvhLeaf *bvhLeaf = dynamic_cast<BvhLeaf *>(mRoot); 1839 1840 … … 1961 1962 // reset root 1962 1963 DEL_PTR(mRoot); 1963 CreateRoot(objects); 1964 1965 BvhLeaf *bvhleaf = new BvhLeaf(mBoundingBox, NULL, (int)objects.size()); 1966 bvhleaf->mObjects = objects; 1967 mRoot = bvhleaf; 1964 1968 1965 1969 #if PROBABILIY_IS_BV_VOLUME … … 2072 2076 2073 2077 2074 } 2078 // TODO: return memory usage in MB 2079 float BvHierarchy::GetMemUsage() const 2080 { 2081 return (float) 2082 (sizeof(BvHierarchy) 2083 + mBvhStats.Leaves() * sizeof(BvhLeaf) 2084 + mBvhStats.Interior() * sizeof(BvhInterior) 2085 ) / (1024.0f * 1024.0f); 2086 } 2087 2088 2089 } -
GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.h
r1633 r1640 544 544 BvhIntersectable *GetOrCreateBvhIntersectable(BvhNode *node); 545 545 546 /** Collects rays .546 /** Collects rays associated with the objects. 547 547 */ 548 548 void CollectRays(const ObjectContainer &objects, VssRayContainer &rays) const; … … 551 551 @returns number of view cells found 552 552 */ 553 int ComputeBoxIntersections( 554 const AxisAlignedBox3 &box, 555 ViewCellContainer &viewCells) const; 553 int ComputeBoxIntersections(const AxisAlignedBox3 &box, 554 ViewCellContainer &viewCells) const; 556 555 557 556 /** Returns leaf the point pt lies in, starting from root. … … 566 565 void SetViewCellsTree(ViewCellsTree *vt) { mViewCellsTree = vt; } 567 566 567 /** Returns estimated memory usage of tree. 568 */ 569 float GetMemUsage() const; 568 570 569 571 protected: … … 598 600 /** Evaluate balanced object partition. 599 601 */ 600 float EvalLocalObjectPartition( 601 const BvhTraversalData &tData,602 const int axis,603 ObjectContainer &objectsFront,604 ObjectContainer &objectsBack); 605 606 float EvalSah(607 608 const int axis,609 ObjectContainer &objectsFront,610 ObjectContainer &objectsBack);602 float EvalLocalObjectPartition(const BvhTraversalData &tData, 603 const int axis, 604 ObjectContainer &objectsFront, 605 ObjectContainer &objectsBack); 606 607 /** Evaluate surface area heuristic for the node. 608 */ 609 float EvalSah(const BvhTraversalData &tData, 610 const int axis, 611 ObjectContainer &objectsFront, 612 ObjectContainer &objectsBack); 611 613 612 614 /** Computes priority of the traversal data and stores it in tData. … … 628 630 @returns new root of the subtree 629 631 */ 630 BvhNode *Subdivide( 631 SplitQueue &tQueue, 632 SubdivisionCandidate *splitCandidate, 633 const bool globalCriteriaMet); 632 BvhNode *Subdivide(SplitQueue &tQueue, 633 SubdivisionCandidate *splitCandidate, 634 const bool globalCriteriaMet); 634 635 635 636 /** Subdivides leaf. … … 641 642 @returns the new interior node = the of the subdivision 642 643 */ 643 BvhInterior *SubdivideNode( 644 const BvhSubdivisionCandidate &sc, 645 BvhTraversalData &frontData, 646 BvhTraversalData &backData); 644 BvhInterior *SubdivideNode(const BvhSubdivisionCandidate &sc, 645 BvhTraversalData &frontData, 646 BvhTraversalData &backData); 647 647 648 648 /** Splits the objects for the next subdivision. 649 649 @returns cost for this split 650 650 */ 651 float SelectObjectPartition( 652 const BvhTraversalData &tData, 653 ObjectContainer &frontObjects, 654 ObjectContainer &backObjects); 651 float SelectObjectPartition(const BvhTraversalData &tData, 652 ObjectContainer &frontObjects, 653 ObjectContainer &backObjects); 655 654 656 655 /** Writes the node to disk … … 659 658 void ExportNode(BvhNode *node, OUT_STREAM &stream); 660 659 660 /** Exports objects associated with this leaf. 661 */ 661 662 void ExportObjects(BvhLeaf *leaf, OUT_STREAM &stream); 662 663 /** Returns estimated memory usage of tree.664 */665 float GetMemUsage() const;666 663 667 664 /** Associates the objects with their bvh leaves. … … 677 674 @param axis the current split axis 678 675 */ 679 void PrepareLocalSubdivisionCandidates( 680 const BvhTraversalData &tData, 681 const int axis); 682 683 static void CreateLocalSubdivisionCandidates( 684 const ObjectContainer &objects, 685 SortableEntryContainer **subdivisionCandidates, 686 const bool sort, 687 const int axis); 676 void PrepareLocalSubdivisionCandidates(const BvhTraversalData &tData, 677 const int axis); 678 679 static void CreateLocalSubdivisionCandidates(const ObjectContainer &objects, 680 SortableEntryContainer **subdivisionCandidates, 681 const bool sort, 682 const int axis); 688 683 689 684 /** Computes object partition with the best cost according to the heurisics. … … 696 691 @returns relative cost (relative to parent cost) 697 692 */ 698 float EvalLocalCostHeuristics( 699 const BvhTraversalData &tData, 700 const int axis, 701 ObjectContainer &objectsFront, 702 ObjectContainer &objectsBack); 693 float EvalLocalCostHeuristics(const BvhTraversalData &tData, 694 const int axis, 695 ObjectContainer &objectsFront, 696 ObjectContainer &objectsBack); 703 697 704 698 /** Evaluates the contribution to the front and back volume … … 709 703 @param volPvs updates the right pvs 710 704 */ 711 void EvalHeuristicsContribution( 712 Intersectable *obj, 713 float &volLeft, 714 float &volRight); 705 void EvalHeuristicsContribution(Intersectable *obj, 706 float &volLeft, 707 float &volRight); 715 708 716 709 /** Prepares objects for the cost heuristics. … … 729 722 /** Prepares construction for vsp and osp trees. 730 723 */ 731 AxisAlignedBox3 EvalBoundingBox( 732 const ObjectContainer &objects, 733 const AxisAlignedBox3 *parentBox = NULL) const; 724 AxisAlignedBox3 EvalBoundingBox(const ObjectContainer &objects, 725 const AxisAlignedBox3 *parentBox = NULL) const; 734 726 735 727 /** Collects list of invalid candidates. Candidates … … 737 729 that affects this candidate. 738 730 */ 739 void CollectDirtyCandidates( 740 BvhSubdivisionCandidate *sc, 741 vector<SubdivisionCandidate *> &dirtyList, 742 const bool onlyUnmailed); 731 void CollectDirtyCandidates(BvhSubdivisionCandidate *sc, 732 vector<SubdivisionCandidate *> &dirtyList, 733 const bool onlyUnmailed); 743 734 744 735 /** Collect view cells which see this bvh leaf. 745 736 */ 746 void CollectViewCells( 747 const ObjectContainer &objects, 748 ViewCellContainer &viewCells, 749 const bool setCounter = false) const; 737 void CollectViewCells(const ObjectContainer &objects, 738 ViewCellContainer &viewCells, 739 const bool setCounter = false) const; 750 740 751 741 /** Counts the view cells of this object. note: only … … 760 750 /** Collects view cells which see an object. 761 751 */ 762 void CollectViewCells( 763 Intersectable *object, 764 ViewCellContainer &viewCells, 765 const bool useMailBoxing, 766 const bool setCounter = false) const; 752 void CollectViewCells(Intersectable *object, 753 ViewCellContainer &viewCells, 754 const bool useMailBoxing, 755 const bool setCounter = false) const; 767 756 768 757 /** Evaluates increase in pvs size. … … 772 761 /** Rays will be clipped to the bounding box. 773 762 */ 774 void PreprocessRays( 775 BvhLeaf *root, 776 const VssRayContainer &sampleRays, 777 RayInfoContainer &rays); 763 void PreprocessRays(BvhLeaf *root, 764 const VssRayContainer &sampleRays, 765 RayInfoContainer &rays); 778 766 779 767 /** Print the subdivision stats in the subdivison log. … … 783 771 /** Prints out the stats for this subdivision. 784 772 */ 785 void AddSubdivisionStats( 786 const int viewCells, 787 const float renderCostDecr, 788 const float totalRenderCost); 773 void AddSubdivisionStats(const int viewCells, 774 const float renderCostDecr, 775 const float totalRenderCost); 789 776 790 777 /** Stores rays with objects that see the rays. … … 800 787 the first subdivision candidate. 801 788 */ 802 SubdivisionCandidate *PrepareConstruction( 803 const VssRayContainer &sampleRays, 804 const ObjectContainer &objects); 789 SubdivisionCandidate *PrepareConstruction(const VssRayContainer &sampleRays, 790 const ObjectContainer &objects); 805 791 806 792 /** Resets bv hierarchy. E.g. deletes root and resets stats. 807 793 */ 808 SubdivisionCandidate *Reset( 809 const VssRayContainer &rays, 810 const ObjectContainer &objects); 794 SubdivisionCandidate *Reset(const VssRayContainer &rays, 795 const ObjectContainer &objects); 811 796 812 797 /** Evaluates volume of view cells that see the objects. … … 820 805 /** Assigns sorted objects to front and back data. 821 806 */ 822 void AssignSortedObjects( 823 const BvhSubdivisionCandidate &sc, 824 BvhTraversalData &frontData, 825 BvhTraversalData &backData); 826 827 /** Creates new root of hierarchy. 828 */ 829 void CreateRoot(const ObjectContainer &objects); 830 /*void 831 RenderBvhNode(BvhNode *node) 832 { 833 if (node->IsLeaf()) { 834 BvhLeaf *leaf = (BvhLeaf *) node; 835 for (int i=0; i < mObjects.size(); i++) 836 cout << "leaf obj " << i << endl; 837 //RenderIntersectable(mObjects[i]); 838 } else { 839 BvhInterior *in = (BvhInterior *)node; 840 RenderBvhNode(in->GetBack()); 841 RenderBvhNode(in->GetFront()); 842 } 843 844 }*/ 807 void AssignSortedObjects(const BvhSubdivisionCandidate &sc, 808 BvhTraversalData &frontData, 809 BvhTraversalData &backData); 810 811 /** Creates new root of hierarchy and computes bounding box. 812 Has to be called before the preparation of the subdivision. 813 */ 814 void Initialise(const ObjectContainer &objects); 815 816 845 817 protected: 846 818 -
GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp
r1633 r1640 2168 2168 "10000"); 2169 2169 2170 2171 2170 RegisterOption("VspTree.Construction.renderCostDecreaseWeight", 2172 2171 optFloat, … … 2462 2461 2463 2462 2463 2464 2464 /*******************************************************************/ 2465 2465 /* Hierarchy Manager related options */ 2466 2466 /*******************************************************************/ 2467 2468 RegisterOption("Hierarchy.Construction.samples", 2469 optInt, 2470 "vsp_construction_samples=", 2471 "100000"); 2472 2467 2473 2468 2474 RegisterOption("Hierarchy.subdivisionStats", … … 2525 2531 "hierarchy_construction_levels=", 2526 2532 "4"); 2527 2528 2533 2534 RegisterOption("Hierarchy.Construction.minStepsOfSameType", 2535 optInt, 2536 "hierarchy_construction_min_steps_same_type=", 2537 "200"); 2538 2529 2539 RegisterOption("Hierarchy.Construction.recomputeSplitPlaneOnRepair", 2530 2540 optBool, -
GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp
r1636 r1640 109 109 "Hierarchy.Construction.levels", mNumMultiLevels); 110 110 111 Environment::GetSingleton()->GetIntValue( 112 "Hierarchy.Construction.minStepsOfSameType", mMinStepsOfSameType); 113 114 111 115 char subdivisionStatsLog[100]; 112 116 Environment::GetSingleton()->GetStringValue("Hierarchy.subdivisionStats", subdivisionStatsLog); … … 116 120 "Hierarchy.Construction.recomputeSplitPlaneOnRepair", mRecomputeSplitPlaneOnRepair); 117 121 118 Debug << "******** Hierachy Manager Parameters ***********" << endl;122 Debug << "******** Hierachy Manager Options ***********" << endl; 119 123 Debug << "max leaves: " << mTermMaxLeaves << endl; 120 124 Debug << "min global cost ratio: " << mTermMinGlobalCostRatio << endl; … … 124 128 Debug << "number of multilevels: " << mNumMultiLevels << endl; 125 129 Debug << "recompute split plane on repair: " << mRecomputeSplitPlaneOnRepair << endl; 130 Debug << "minimal number of steps from same type: " << mMinStepsOfSameType << endl; 126 131 127 132 switch (mConstructionType) … … 228 233 void HierarchyManager::EvalSubdivisionStats() 229 234 { 235 // TODO 236 const float objectSpaceMem = GetObjectSpaceMemUsage(); 237 const float viewSpaceMem = mVspTree->GetMemUsage(); 238 239 // calculate cost in MB 240 const float memoryCost = mHierarchyStats.mMemory / (1024.0f * 1024.0f) 241 + objectSpaceMem + viewSpaceMem; 242 230 243 //cout << "pvs entries " << mHierarchyStats.pvsEntries << endl; 231 244 AddSubdivisionStats(mHierarchyStats.Leaves(), … … 233 246 mHierarchyStats.mTotalCost, 234 247 mHierarchyStats.mPvsEntries, 235 m HierarchyStats.mMemory,236 1.0f / (mHierarchyStats.mTotalCost * m HierarchyStats.mMemory)248 memoryCost, 249 1.0f / (mHierarchyStats.mTotalCost * memoryCost) 237 250 ); 238 251 } … … 243 256 const float totalRenderCost, 244 257 const int pvsEntries, 245 const int memory,258 const float memory, 246 259 const float renderCostPerStorage) 247 260 { … … 309 322 310 323 mHierarchyStats.mNodes = 2; 311 324 325 // create first nodes 326 mVspTree->Initialise(sampleRays, forcedViewSpace); 327 InitialiseObjectSpaceSubdivision(objects); 328 329 // hack: assume that object space can be seen from view space 312 330 mHierarchyStats.mTotalCost = (float)objects.size(); 331 mHierarchyStats.mPvsEntries = 1; 332 mHierarchyStats.mMemory = sizeof(PvsData) + sizeof(Intersectable *) / (1024.0f * 1024.0f); 333 334 EvalSubdivisionStats(); 313 335 Debug << "setting total cost to " << mHierarchyStats.mTotalCost << endl; 314 336 … … 316 338 cout << "Constructing view space / object space tree ... \n"; 317 339 318 // compute view space bounding box319 mVspTree->ComputeBoundingBox(sampleRays, forcedViewSpace);320 321 340 SplitQueue objectSpaceQueue; 322 341 SplitQueue viewSpaceQueue; … … 326 345 mSavedViewSpaceSubdivisionType = mViewSpaceSubdivisionType; 327 346 mViewSpaceSubdivisionType = NO_VIEWSPACE_SUBDIV; 328 329 mSavedObjectSpaceSubdivisionType = mObjectSpaceSubdivisionType; 347 //mSavedObjectSpaceSubdivisionType = mObjectSpaceSubdivisionType; 330 348 331 349 // number of initial splits 332 int minSteps = 200;350 const int minSteps = mMinStepsOfSameType; 333 351 float renderCostDecr = Limits::Infinity; 334 352 … … 337 355 338 356 objectSpaceQueue.Push(osc); 357 339 358 340 359 ///////////////////////// … … 349 368 RunConstruction(objectSpaceQueue, dirtyVspList, renderCostDecr, minSteps); 350 369 351 cout << ospSteps << " object space partition steps taken" << endl; 352 370 cout << "\n" << ospSteps << " object space partition steps taken" << endl; 371 372 // create view space 353 373 SubdivisionCandidate *vsc = 354 374 PrepareViewSpaceSubdivision(sampleRays, objects); 355 375 356 376 viewSpaceQueue.Push(vsc); 357 377 358 378 // view space subdivision was constructed 359 379 mViewSpaceSubdivisionType = mSavedViewSpaceSubdivisionType; 360 380 361 // don't terminate on max steps 362 //maxSteps = mTermMaxLeaves; 381 // the priorities were calculated for driving sha. 382 // => recalculate "real" priorities taking visibility into 383 // account so we can compare to view space splits 384 ResetQueue(objectSpaceQueue, false); 385 386 387 // lower number of minsteps: the decicion of which domain to subdivide 388 // should be decided using the render cost decrease from now 389 //minSteps = 1; 363 390 364 391 // This method subdivides view space / object space … … 370 397 while (!(viewSpaceQueue.Empty() && objectSpaceQueue.Empty())) 371 398 { 399 const float vspPriority = viewSpaceQueue.Empty() ? 0 : viewSpaceQueue.Top()->GetPriority(); 400 const float ospPriority = objectSpaceQueue.Empty() ? 0 : objectSpaceQueue.Top()->GetPriority(); 401 402 cout << "new decicion, vsp: " << vspPriority << ", osp: " << ospPriority << endl; 403 372 404 // should view or object space be subdivided further? 373 if (viewSpaceQueue.Empty() || 374 (!objectSpaceQueue.Empty() && 375 (objectSpaceQueue.Top()->GetPriority() > viewSpaceQueue.Top()->GetPriority()))) 376 { 377 // use splits of one kind until rendercost slope is reached 378 //renderCostDecr = mHierarchyStats.mRenderCostDecrease; 379 380 // lower number of minsteps: this should be solved 381 // with render cost decrease from now 382 //minSteps = 5; 383 405 if (ospPriority >= vspPriority) 406 { 407 // use splits of one kind until rendercost decrease of other domain is reached 408 renderCostDecr = vspPriority; 409 cout << "comparing with this render cost: " << renderCostDecr << endl; 384 410 // dirtied view space candidates 385 411 SubdivisionCandidateContainer dirtyVspList; … … 391 417 RunConstruction(objectSpaceQueue, dirtyVspList, renderCostDecr, minSteps); 392 418 393 cout << ospSteps << " object space partition steps taken" << endl;419 cout << "\n" << ospSteps << " object space partition steps taken" << endl; 394 420 395 // object space subdivision constructed 396 mObjectSpaceSubdivisionType = mSavedObjectSpaceSubdivisionType; 397 398 /// Repair split queue 421 /// Repair split queue, i.e., affected view space candidates 399 422 cout << "repairing queue ... " << endl; 400 423 RepairQueue(dirtyVspList, viewSpaceQueue, true); 401 cout << " repaired " <<dirtyVspList.size() << " candidates" << endl;424 cout << "\nrepaired " << (int)dirtyVspList.size() << " candidates" << endl; 402 425 } 403 426 else 404 427 { 405 428 // use splits of one kind until rendercost slope is reached 406 // renderCostDecr = mHierarchyStats.mRenderCostDecrease; 429 renderCostDecr = ospPriority; 430 cout << "comparing with this render cost: " << renderCostDecr << endl; 407 431 408 432 ///////////////// … … 415 439 RunConstruction(viewSpaceQueue, dirtyOspList, renderCostDecr, minSteps); 416 440 417 cout << vspSteps << " view space partition steps taken" << endl;441 cout << "\n" << vspSteps << " view space partition steps taken" << endl; 418 442 419 443 // view space subdivision constructed … … 423 447 cout << "repairing queue ... " << endl; 424 448 RepairQueue(dirtyOspList, objectSpaceQueue, true); 425 cout << "repaired " << dirtyOspList.size() << " candidates" << endl;449 cout << "repaired " << (int)dirtyOspList.size() << " candidates" << endl; 426 450 } 427 451 } … … 443 467 mHierarchyStats.Start(); 444 468 mHierarchyStats.mNodes = 2; // two nodes for view space and object space 445 469 mHierarchyStats.mPvsEntries = 1; 470 mHierarchyStats.mMemory = sizeof(PvsData) + sizeof(Intersectable *) / (1024.0f * 1024.0f); 446 471 mHierarchyStats.mTotalCost = (float)objects.size(); 472 447 473 mHierarchyStats.mRenderCostDecrease = 0; 448 474 … … 453 479 cout << "Constructing view space / object space tree ... \n"; 454 480 455 // compute view space bounding box 456 mVspTree->ComputeBoundingBox(sampleRays, forcedViewSpace); 481 // create only roots 482 mVspTree->Initialise(sampleRays, forcedViewSpace); 483 InitialiseObjectSpaceSubdivision(objects); 457 484 458 485 // use objects for evaluating vsp tree construction in the … … 464 491 mViewSpaceSubdivisionType = NO_VIEWSPACE_SUBDIV; 465 492 466 // create just one view cell467 SubdivisionCandidate *vspSc =468 PrepareViewSpaceSubdivision(sampleRays, objects);469 470 493 // start view space subdivison immediately? 471 494 if (StartViewSpaceSubdivision()) 472 495 { 473 496 // prepare vsp tree for traversal 474 mViewSpaceSubdivisionType = mSavedViewSpaceSubdivisionType; 497 mViewSpaceSubdivisionType = mSavedViewSpaceSubdivisionType; 498 SubdivisionCandidate *vspSc = 499 PrepareViewSpaceSubdivision(sampleRays, objects); 500 475 501 mTQueue.Push(vspSc); 476 502 } … … 489 515 sampleRays, 490 516 objects, 491 forcedViewSpace,// 492 vspSc); 517 forcedViewSpace); 493 518 494 519 cout << "\nfinished in " << TimeDiff(startTime, GetTime()) * 1e-3 << " secs" << endl; … … 519 544 520 545 return vsc; 546 } 547 548 549 float HierarchyManager::GetObjectSpaceMemUsage() const 550 { 551 if (mObjectSpaceSubdivisionType == KD_BASED_OBJ_SUBDIV) 552 { 553 // TODO; 554 } 555 else if (mObjectSpaceSubdivisionType == BV_BASED_OBJ_SUBDIV) 556 { 557 return mBvHierarchy->GetMemUsage(); 558 } 559 560 return -1; 561 } 562 563 void HierarchyManager::InitialiseObjectSpaceSubdivision(const ObjectContainer &objects) 564 { 565 if (mObjectSpaceSubdivisionType == KD_BASED_OBJ_SUBDIV) 566 { 567 // TODO; 568 } 569 else if (mObjectSpaceSubdivisionType == BV_BASED_OBJ_SUBDIV) 570 { 571 mBvHierarchy->Initialise(objects); 572 } 521 573 } 522 574 … … 608 660 } 609 661 610 mHierarchyStats.mTotalCost -= sc->GetRenderCostDecrease();611 612 662 cout << sc->Type() << " "; 613 663 664 ///////////// 614 665 // update stats 666 615 667 mHierarchyStats.mNodes += 2; 616 617 const int pvsEntries = sc->GetPvsEntriesIncr(); 618 mHierarchyStats.mPvsEntries += pvsEntries; 619 620 //cout << "pvs entries: " << pvsEntries << " " << mHierarchyStats.pvsEntries << endl; 621 mHierarchyStats.mMemory += 0; // TODO 668 mHierarchyStats.mTotalCost -= sc->GetRenderCostDecrease(); 669 670 const int pvsEntriesIncr = sc->GetPvsEntriesIncr(); 671 mHierarchyStats.mPvsEntries += pvsEntriesIncr; 672 //cout << "pvs entries: " << pvsEntriesIncr << " " << mHierarchyStats.pvsEntries << endl; 673 674 const int sizeOfEntry = sizeof(PvsData) + sizeof(Intersectable *); 675 // memory size in byte 676 mHierarchyStats.mMemory += float(pvsEntriesIncr * sizeOfEntry); 622 677 mHierarchyStats.mRenderCostDecrease = sc->GetRenderCostDecrease(); 623 678 624 // subdivision successful679 // output stats 625 680 EvalSubdivisionStats(); 626 681 … … 656 711 657 712 713 int HierarchyManager::GetObjectSpaceSubdivisionLeaves() const 714 { 715 int maxLeaves= 0; 716 717 if (mObjectSpaceSubdivisionType == KD_BASED_OBJ_SUBDIV) 718 { 719 maxLeaves = mOspTree->mOspStats.Leaves(); 720 } 721 else if (mObjectSpaceSubdivisionType == BV_BASED_OBJ_SUBDIV) 722 { 723 maxLeaves = mBvHierarchy->mBvhStats.Leaves(); 724 } 725 726 return maxLeaves; 727 } 728 729 658 730 bool HierarchyManager::StartObjectSpaceSubdivision() const 659 731 { … … 673 745 return 674 746 ((mConstructionType == INTERLEAVED) && 675 (mMin DepthForObjectSpaceSubdivion <= mVspTree->mVspStats.maxDepth));747 (mMinStepsOfSameType <= mVspTree->mVspStats.nodes)); 676 748 } 677 749 … … 694 766 return 695 767 ((mConstructionType == INTERLEAVED) && 696 (mMin DepthForViewSpaceSubdivion <= GetObjectSpaceSubdivisionDepth()));768 (mMinStepsOfSameType <= GetObjectSpaceSubdivisionLeaves())); 697 769 } 698 770 … … 701 773 const VssRayContainer &sampleRays, 702 774 const ObjectContainer &objects, 703 AxisAlignedBox3 *forcedViewSpace, 704 SubdivisionCandidate *firstVsp) 775 AxisAlignedBox3 *forcedViewSpace) 705 776 { 706 777 while (!FinishedConstruction()) … … 719 790 mObjectSpaceSubdivisionType = mSavedObjectSpaceSubdivisionType; 720 791 721 cout << "\nstarting object space subdivision a t depth"722 << mVspTree->mVspStats. maxDepth<< " ("723 << mMin DepthForObjectSpaceSubdivion<< ") " << endl;792 cout << "\nstarting object space subdivision after " 793 << mVspTree->mVspStats.nodes << " (" 794 << mMinStepsOfSameType << ") " << endl; 724 795 725 796 SubdivisionCandidate *ospSc = PrepareObjectSpaceSubdivision(sampleRays, objects); 797 798 cout << "reseting queue ... "; 799 ResetQueue(mTQueue, mRecomputeSplitPlaneOnRepair); 800 cout << "finished" << endl; 801 726 802 mTQueue.Push(ospSc); 803 } 804 805 if (StartViewSpaceSubdivision()) 806 { 807 mViewSpaceSubdivisionType = mSavedViewSpaceSubdivisionType; 808 809 cout << "\nstarting view space subdivision at depth " 810 << GetObjectSpaceSubdivisionLeaves() << " (" 811 << mMinStepsOfSameType << ") " << endl; 812 813 SubdivisionCandidate *vspSc = PrepareViewSpaceSubdivision(sampleRays, objects); 727 814 728 815 cout << "reseting queue ... "; 729 ResetQueue( );816 ResetQueue(mTQueue, mRecomputeSplitPlaneOnRepair); 730 817 cout << "finished" << endl; 731 } 732 733 if (StartViewSpaceSubdivision()) 734 { 735 mViewSpaceSubdivisionType = mSavedViewSpaceSubdivisionType; 736 737 cout << "\nstarting view space subdivision at depth " 738 << GetObjectSpaceSubdivisionDepth() << " (" 739 << mMinDepthForViewSpaceSubdivion << ") " << endl; 740 741 //SubdivisionCandidate *vspSc = PrepareViewSpaceSubdivision(sampleRays, objects); 742 mTQueue.Push(firstVsp); 743 744 cout << "reseting queue ... "; 745 ResetQueue(); 746 cout << "finished" << endl; 818 819 // push view space candidate 820 mTQueue.Push(vspSc); 747 821 } 748 822 … … 784 858 if ((sc->GetRenderCostDecrease() < minRenderCostDecr) && 785 859 !(steps < minSteps)) 860 { 861 cout << "breaking on " << sc->GetRenderCostDecrease() << " smaller than " << minRenderCostDecr << endl; 786 862 break; 787 863 } 788 864 //////// 789 865 //-- subdivide leaf node of either type … … 826 902 827 903 mHierarchyStats.mTotalCost = mBvHierarchy->mTotalCost; 828 904 905 // bug!! pvs entries could be much higher at this stage 829 906 mHierarchyStats.mNodes = 2; 830 mHierarchyStats.mPvsEntries = 0;907 mHierarchyStats.mPvsEntries = 1; 831 908 mHierarchyStats.mRenderCostDecrease = 0; 832 909 … … 861 938 862 939 mHierarchyStats.mNodes = 2; 863 mHierarchyStats.mPvsEntries = 0; 940 // bug!! pvs entries could be much higher at this stage 941 mHierarchyStats.mPvsEntries = 1; 864 942 mHierarchyStats.mRenderCostDecrease = 0; 865 943 944 // evaluate new stats before first subdivsiion 866 945 EvalSubdivisionStats(); 867 946 … … 884 963 cout << "Constructing view space / object space tree ... \n"; 885 964 886 // compute view space bounding box 887 mVspTree->ComputeBoundingBox(sampleRays, forcedViewSpace); 965 // initialise view / object space 966 mVspTree->Initialise(sampleRays, forcedViewSpace); 967 InitialiseObjectSpaceSubdivision(objects); 888 968 889 969 // use sah for evaluating osp tree construction … … 892 972 mSavedViewSpaceSubdivisionType = mViewSpaceSubdivisionType; 893 973 mViewSpaceSubdivisionType = NO_VIEWSPACE_SUBDIV; 894 895 // first view cell896 SubdivisionCandidate *vspVc = PrepareViewSpaceSubdivision(sampleRays, objects);897 974 898 975 mSavedObjectSpaceSubdivisionType = mObjectSpaceSubdivisionType; 899 //mObjectSpaceSubdivisionType = NO_OBJ_SUBDIV;976 mObjectSpaceSubdivisionType = NO_OBJ_SUBDIV; 900 977 901 978 const int limit = mNumMultiLevels; … … 935 1012 // subdivide view space with respect to the objects 936 1013 937 if (!ViewSpaceSubdivisionConstructed()) 938 { 939 mTQueue.Push(vspVc); 940 941 // view space subdivision constructed 942 mViewSpaceSubdivisionType = mSavedViewSpaceSubdivisionType; 943 } 944 else 945 { 946 ResetViewSpaceSubdivision(sampleRays, objects); 947 } 1014 SubdivisionCandidate *vspVc = ResetViewSpaceSubdivision(sampleRays, objects); 1015 mTQueue.Push(vspVc); 1016 1017 // view space subdivision constructed 1018 mViewSpaceSubdivisionType = mSavedViewSpaceSubdivisionType; 1019 948 1020 949 1021 // process view space candidates … … 969 1041 FinishObjectSpaceSubdivision(objects); 970 1042 } 1043 1044 1045 void HierarchyManager::OptimizeMultiLevel(const VssRayContainer &sampleRays, 1046 const ObjectContainer &objects, 1047 AxisAlignedBox3 *forcedViewSpace) 1048 { 1049 mHierarchyStats.Reset(); 1050 mHierarchyStats.Start(); 1051 mHierarchyStats.mNodes = 2; 1052 1053 mHierarchyStats.mTotalCost = (float)objects.size(); 1054 Debug << "setting total cost to " << mHierarchyStats.mTotalCost << endl; 1055 1056 const long startTime = GetTime(); 1057 cout << "Constructing view space / object space tree ... \n"; 1058 1059 // initialise view / object space 1060 mVspTree->Initialise(sampleRays, forcedViewSpace); 1061 InitialiseObjectSpaceSubdivision(objects); 1062 1063 // use sah for evaluating osp tree construction 1064 // in the first iteration of the subdivision 1065 1066 mSavedViewSpaceSubdivisionType = mViewSpaceSubdivisionType; 1067 mViewSpaceSubdivisionType = NO_VIEWSPACE_SUBDIV; 1068 1069 mSavedObjectSpaceSubdivisionType = mObjectSpaceSubdivisionType; 1070 mObjectSpaceSubdivisionType = NO_OBJ_SUBDIV; 1071 1072 const int limit = mNumMultiLevels; 1073 int i = 0; 1074 1075 // This method subdivides view space / object space 1076 // in order to converge to some optimal cost for this partition 1077 // start with object space partiton 1078 // then optimizate view space partition for the current osp 1079 // and vice versa until iteration depth is reached. 1080 while (1) 1081 { 1082 char subdivisionStatsLog[100]; 1083 sprintf(subdivisionStatsLog, "tests/i3d/subdivision-%04d.log", i); 1084 mSubdivisionStats.open(subdivisionStatsLog); 1085 1086 // subdivide object space first 1087 ResetObjectSpaceSubdivision(sampleRays, objects); 1088 1089 // process object space candidates 1090 RunConstruction(false); 1091 1092 // object space subdivision constructed 1093 mObjectSpaceSubdivisionType = mSavedObjectSpaceSubdivisionType; 1094 1095 cout << "iteration " << i << " of " << limit << " finished" << endl; 1096 1097 mSubdivisionStats.close(); 1098 1099 if ((i ++) >= limit) 1100 break; 1101 1102 sprintf(subdivisionStatsLog, "tests/i3d/subdivision-%04d.log", i); 1103 mSubdivisionStats.open(subdivisionStatsLog); 1104 1105 ///////////////// 1106 // subdivide view space with respect to the objects 1107 1108 SubdivisionCandidate *vspVc = ResetViewSpaceSubdivision(sampleRays, objects); 1109 mTQueue.Push(vspVc); 1110 1111 // view space subdivision constructed 1112 mViewSpaceSubdivisionType = mSavedViewSpaceSubdivisionType; 1113 1114 1115 // process view space candidates 1116 RunConstruction(false); 1117 1118 cout << "iteration " << i << " of " << limit << " finished" << endl; 1119 1120 mSubdivisionStats.close(); 1121 1122 if ((i ++) >= limit) 1123 break; 1124 } 1125 1126 cout << "\nfinished in " << TimeDiff(startTime, GetTime()) * 1e-3 << " secs" << endl; 1127 1128 /*#if _DEBUG 1129 cout << "view space: " << GetViewSpaceBox() << endl; 1130 cout << "object space: " << GetObjectSpaceBox() << endl; 1131 #endif*/ 1132 1133 mHierarchyStats.Stop(); 1134 mVspTree->mVspStats.Stop(); 1135 FinishObjectSpaceSubdivision(objects); 1136 } 1137 971 1138 972 1139 … … 1067 1234 1068 1235 1069 void HierarchyManager::ResetQueue( )1236 void HierarchyManager::ResetQueue(SplitQueue &splitQueue, const bool recomputeSplitPlane) 1070 1237 { 1071 1238 SubdivisionCandidateContainer mCandidateBuffer; 1072 1239 1073 1240 // remove from queue 1074 while (! mTQueue.Empty())1075 { 1076 SubdivisionCandidate *candidate = NextSubdivisionCandidate( mTQueue);1241 while (!splitQueue.Empty()) 1242 { 1243 SubdivisionCandidate *candidate = NextSubdivisionCandidate(splitQueue); 1077 1244 // reevaluate local split plane and priority 1078 candidate->EvalPriority( );1245 candidate->EvalPriority(recomputeSplitPlane); 1079 1246 cout << "."; 1080 1247 mCandidateBuffer.push_back(candidate); … … 1085 1252 for (sit = mCandidateBuffer.begin(); sit != sit_end; ++ sit) 1086 1253 { 1087 mTQueue.Push(*sit);1254 splitQueue.Push(*sit); 1088 1255 } 1089 1256 } -
GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.h
r1635 r1640 51 51 /// total number of entries in the pvs 52 52 int mPvsEntries; 53 /// storage cost 54 int mMemory;53 /// storage cost in MB 54 float mMemory; 55 55 /// total number of nodes 56 56 int mNodes; … … 76 76 77 77 int Nodes() const {return mNodes;} 78 int Interior() const { return mNodes / 2 ; }78 int Interior() const { return mNodes / 2 - 1; } 79 79 int Leaves() const { return (mNodes / 2) + 1; } 80 80 … … 246 246 247 247 248 /** Create bounding box and root. 249 */ 250 void InitialiseObjectSpaceSubdivision(const ObjectContainer &objects); 251 252 /** Returns memory usage of object space hierarchy. 253 */ 254 float GetObjectSpaceMemUsage() const; 255 248 256 ////////////////////////////// 249 257 // the main loop … … 255 263 const VssRayContainer &sampleRays, 256 264 const ObjectContainer &objects, 257 AxisAlignedBox3 *forcedViewSpace, 258 SubdivisionCandidate *firstVsp); 265 AxisAlignedBox3 *forcedViewSpace); 259 266 260 267 /** This is for interleaved construction using some objects … … 307 314 const float totalRenderCost, 308 315 const int totalPvsEntries, 309 const int memory,316 const float memory, 310 317 const float renderCostPerStorage); 311 318 … … 365 372 /** Reset the split queue, i.e., reevaluate the split candidates. 366 373 */ 367 void ResetQueue( );374 void ResetQueue(SplitQueue &splitQueue, const bool recomputeSplitPlane); 368 375 369 376 /** After the suddivision has ended, do some final tasks. … … 374 381 */ 375 382 int GetObjectSpaceSubdivisionDepth() const; 383 384 /** Returns number of leaves in object space subdivision. 385 */ 386 int GetObjectSpaceSubdivisionLeaves() const; 376 387 377 388 /** Construct object space partition interleaved with view space partition. … … 401 412 AxisAlignedBox3 *forcedViewSpace); 402 413 414 /** Based on a given subdivision, we try to optimize using an 415 multiple iteration over view and object space. 416 */ 417 void OptimizeMultiLevel(const VssRayContainer &sampleRays, 418 const ObjectContainer &objects, 419 AxisAlignedBox3 *forcedViewSpace); 420 403 421 /** Reset the object space subdivision. 404 422 E.g., deletes hierarchy and resets stats. … … 471 489 //////////////////// 472 490 491 int mMinStepsOfSameType; 492 473 493 /// statistics about the hierarchy 474 494 HierarchyStatistics mHierarchyStats; … … 490 510 */ 491 511 bool mUseMultiLevelConstruction; 512 492 513 /// number of iteration steps for multilevel approach 493 514 int mNumMultiLevels; 515 494 516 /** if split plane should be recomputed for the repair. 495 517 Otherwise only the priority is recomputed, the -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r1633 r1640 2599 2599 { 2600 2600 Environment::GetSingleton()->GetIntValue("BspTree.Construction.samples", mInitialSamples); 2601 2601 2602 mBspTree->SetViewCellsManager(this); 2602 2603 mBspTree->SetViewCellsTree(mViewCellsTree); … … 4774 4775 : ViewCellsManager(vcTree), mHierarchyManager(hm) 4775 4776 { 4776 Environment::GetSingleton()->GetIntValue(" VspTree.Construction.samples", mInitialSamples);4777 Environment::GetSingleton()->GetIntValue("Hierarchy.Construction.samples", mInitialSamples); 4777 4778 4778 4779 mHierarchyManager->SetViewCellsManager(this); -
GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.cpp
r1633 r1640 559 559 560 560 561 // TODO: return memory usage in MB 561 // $$matt temporary: number of rayrefs + pvs should be in there, but 562 // commented out for testing 562 563 float VspTree::GetMemUsage() const 563 564 { 564 565 return (float) 565 (sizeof(VspTree) + 566 mVspStats.Leaves() * sizeof(VspLeaf) + 567 mCreatedViewCells * sizeof(VspViewCell) + 568 mVspStats.pvs * sizeof(PvsData) + 569 mVspStats.Interior() * sizeof(VspInterior) + 570 mVspStats.accumRays * sizeof(RayInfo)) / (1024.0f * 1024.0f); 566 (sizeof(VspTree) 567 + mVspStats.Leaves() * sizeof(VspLeaf) 568 + mVspStats.Leaves() * sizeof(VspViewCell) 569 + mVspStats.Interior() * sizeof(VspInterior) 570 //+ mVspStats.pvs * sizeof(PvsData) 571 //+ mVspStats.rayRefs * sizeof(RayInfo) 572 ) / (1024.0f * 1024.0f); 571 573 } 572 574 … … 739 741 { 740 742 // view cell is created during subdivision 741 //CreateViewCell(tData);742 743 743 VspLeaf *leaf = dynamic_cast<VspLeaf *>(newNode); 744 744 ViewCell *viewCell = leaf->GetViewCell(); … … 1858 1858 1859 1859 // accumulate rays to compute rays / leaf 1860 mVspStats. accumRays += (int)data.mRays->size();1860 mVspStats.rayRefs += (int)data.mRays->size(); 1861 1861 1862 1862 if (data.mPvs < mTermMinPvs) … … 2834 2834 2835 2835 2836 void VspTree::Initialise(const VssRayContainer &rays, 2837 AxisAlignedBox3 *forcedBoundingBox) 2838 { 2839 ComputeBoundingBox(rays, forcedBoundingBox); 2840 2841 VspLeaf *leaf = new VspLeaf(); 2842 mRoot = leaf; 2843 2844 VspViewCell *viewCell = new VspViewCell(); 2845 leaf->SetViewCell(viewCell); 2846 2847 // set view cell values 2848 viewCell->mLeaves.push_back(leaf); 2849 2850 viewCell->SetVolume(mBoundingBox.GetVolume()); 2851 leaf->mProbability = mBoundingBox.GetVolume(); 2852 } 2853 2854 2836 2855 SubdivisionCandidate *VspTree::PrepareConstruction(const VssRayContainer &sampleRays, 2837 2856 RayInfoContainer &rays) … … 2846 2865 // initialise termination criteria 2847 2866 mTermMinProbability *= mBoundingBox.GetVolume(); 2867 2848 2868 // get clipped rays 2849 2869 PreprocessRays(sampleRays, rays); … … 2852 2872 const int pvsSize = EvalPvsSize(rays); 2853 2873 2874 // root and bounding box were already constructed 2875 VspLeaf *leaf = dynamic_cast<VspLeaf *>(mRoot); 2854 2876 2855 2877 ////////// … … 2858 2880 const float prop = mBoundingBox.GetVolume(); 2859 2881 2860 // we assume that leaf was already created2861 VspLeaf *leaf = new VspLeaf();2862 mRoot = leaf;2863 2864 2882 // first vsp traversal data 2865 VspTraversalData vData(leaf, 0, &rays, pvsSize, prop, mBoundingBox); 2866 2867 // create first view cell 2868 CreateViewCell(vData, false); 2883 VspTraversalData vData(leaf, 0, &rays, pvsSize, prop, mBoundingBox); 2884 2869 2885 2870 2886 #if WORK_WITH_VIEWCELL_PVS -
GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.h
r1633 r1640 79 79 /// number of invalid leaves 80 80 int invalidLeaves; 81 /// accumulatednumber of rays refs82 int accumRays;81 /// number of rays refs 82 int rayRefs; 83 83 /// overall pvs size 84 84 int pvs; … … 100 100 // TODO: computation wrong 101 101 double AvgDepth() const { return accumDepth / (double)Leaves();}; 102 double AvgRays() const { return accumRays / (double)Leaves();};102 double AvgRays() const { return rayRefs / (double)Leaves();}; 103 103 104 104 void Reset() … … 124 124 maxPvs = 0; 125 125 invalidLeaves = 0; 126 accumRays = 0;126 rayRefs = 0; 127 127 maxObjectRefs = 0; 128 128 mGlobalCostMisses = 0; … … 996 996 int EvalContributionToPvs(KdLeaf *leaf) const; 997 997 998 /** Creates new root of hierarchy and computes bounding box. 999 Has to be called before the preparation of the subdivision. 1000 */ 1001 void Initialise(const VssRayContainer &rays, 1002 AxisAlignedBox3 *forcedBoundingBox); 998 1003 999 1004 protected: -
GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp
r1634 r1640 112 112 else 113 113 { 114 strippedFilename = string(StripPath(currentFile.c_str())); 114 char *str = StripPath(currentFile.c_str()); 115 strippedFilename = string(str); 116 117 delete []str; 115 118 } 116 119
Note: See TracChangeset
for help on using the changeset viewer.