- Timestamp:
- 11/15/05 15:57:15 (19 years ago)
- Location:
- trunk/VUT/GtpVisibilityPreprocessor
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/scripts/default.env
r411 r414 24 24 25 25 Preprocessor { 26 # type sampling 27 type vss 26 type sampling 27 # type exact 28 # type vss 28 29 } 29 30 … … 78 79 minPvsDif 100 79 80 minPvs 10 80 maxPvs 30081 samples 081 maxPvs 150 82 samples 100000 82 83 } 83 84 … … 94 95 # input fromViewCells 95 96 # input fromSceneGeometry 96 samples 20000097 samples 100000 97 98 sideTolerance 0.005 98 99 } … … 132 133 #splitPlaneStrategy 130 133 134 134 splitPlaneStrategy 1 024135 splitPlaneStrategy 12 135 136 136 137 maxPolyCandidates 50 … … 166 167 exportSplits true 167 168 # how much samples should be used in visualization 168 samples 1000169 samples 20000 169 170 } 170 171 } -
trunk/VUT/GtpVisibilityPreprocessor/src/Environment.cpp
r411 r414 1336 1336 1337 1337 1338 RegisterOption("VspKdTree.Construction. Samples",1338 RegisterOption("VspKdTree.Construction.samples", 1339 1339 optInt, 1340 1340 "-vsp_construction_samples=", … … 1343 1343 RegisterOption("VspKdTree.Termination.maxDepth", 1344 1344 optInt, 1345 "vsp_ depth=", "30");1345 "vsp_term_maxdepth=", "30"); 1346 1346 1347 1347 RegisterOption("VspKdTree.Termination.minPvs", … … 1352 1352 RegisterOption("VspKdTree.Termination.minRays", 1353 1353 optInt, 1354 "vsp_ minrays=",1354 "vsp_term_minrays=", 1355 1355 "10"); 1356 1356 1357 RegisterOption("VspKdTree. maxCostRatio",1357 RegisterOption("VspKdTree.Termination.minSize", 1358 1358 optFloat, 1359 "vsp_maxcost=", 1359 "vsp_term_minsize=", 1360 "0.001"); 1361 1362 RegisterOption("VspKdTree.Termination.maxCostRatio", 1363 optFloat, 1364 "vsp_term_maxcost=", 1360 1365 "0.95"); 1361 1366 1362 RegisterOption("VspKdTree. maxRayContribution",1367 RegisterOption("VspKdTree.Termination.maxRayContribution", 1363 1368 optFloat, 1364 "vsp_ max_ray_contrib=",1369 "vsp_term_max_ray_contrib=", 1365 1370 "0.5"); 1366 1371 … … 1383 1388 "endpoints=", 1384 1389 "10000"); 1385 1386 RegisterOption("VspKdTree.minSize",1387 optFloat,1388 "minsize=",1389 "0.001");1390 1390 1391 1391 RegisterOption("VspKdTree.maxTotalMemory", -
trunk/VUT/GtpVisibilityPreprocessor/src/RenderSimulator.cpp
r410 r414 3 3 #include "ViewCellBsp.h" 4 4 #include "ViewCell.h" 5 6 void SimulationStatistics::Print(ostream &app) const 7 { 8 app << "===== Simulation statistics ===============\n"; 9 10 app << setprecision(4); 11 12 app << "#N_CTIME ( Simulation time [s] )\n" << Time() << " \n"; 13 14 app << "#MAX_COST ( maximal cost of a view cell )\n" << maxCost << "\n"; 15 16 app << "#MIN_COST ( minimal cost of a view cell )\n" << minCost << "\n"; 17 18 app << "#AVG_RENDER_TIME ( average render time )\n" << avgRenderTime << "\n"; 19 20 app << "#AVG_RENDER_TIME_NO_OVERHEAD ( average render time without overhead )\n" << avgRtWithoutOverhead << "\n"; 21 22 app << "===== END OF Simulation statistics ==========\n"; 23 } 5 24 6 25 RenderSimulator::RenderSimulator() … … 26 45 Real BspViewCellRenderSimulator::SimulateRendering() 27 46 { 47 mStat.Reset(); 48 mStat.Start(); 49 28 50 Real renderTime = 0; 29 51 30 52 // overhead for loading the PVS of the view cells 31 53 float loadPvsOverhead = 0; 32 33 54 // probability that view point lies in a view cell 34 55 float pInVcTotal = 0; 35 36 56 // total probability that a view cell border is crossed 37 57 float pCrossVcTotal = 0; … … 57 77 58 78 // compute render time of PVS times probability that view point is in view cell 59 renderTime += pInVc * RenderPvs(*(*it), mObjRenderCost);79 float vcCost = pInVc * RenderPvs(*(*it), mObjRenderCost); 60 80 81 renderTime += vcCost; 82 83 if (vcCost > mStat.maxCost) 84 mStat.maxCost = vcCost; 85 else if (vcCost < mStat.minCost) 86 mStat.minCost = vcCost; 87 61 88 // probability that a view cell border is crossed 62 89 float pCrossVc = area; 63 90 91 // crossing the border of a view cell is also depending on the move speed 64 92 loadPvsOverhead += pCrossVc * mVcOverhead * mMoveSpeed; 65 93 … … 72 100 loadPvsOverhead /= pCrossVcTotal; 73 101 74 //Debug << "render time without overhead: " << renderTime * 1e-3 << endl; 75 102 mStat.avgRtWithoutOverhead = renderTime; 103 mStat.avgRenderTime = renderTime + loadPvsOverhead; 104 105 mStat.Stop(); 106 76 107 return renderTime + loadPvsOverhead; 77 108 } … … 98 129 { 99 130 //mKdTree->CollectLeavesPvs(); 131 mStat.Reset(); 132 mStat.Start(); 100 133 101 134 // total render time … … 132 165 const float pCrossVc = box.SurfaceArea(); 133 166 134 renderTime += pInVc * RenderPvs(*it, mObjRenderCost); 167 float vcCost = pInVc * RenderPvs(*it, mObjRenderCost); 168 renderTime += vcCost; 169 170 if (vcCost > mStat.maxCost) 171 mStat.maxCost = vcCost; 172 else if (vcCost < mStat.minCost) 173 mStat.minCost = vcCost; 174 135 175 loadPvsOverhead += pCrossVc * mVcOverhead * mMoveSpeed; 136 176 … … 139 179 } 140 180 181 Debug << "RT: " << renderTime << endl; 182 Debug << "pvsOverhead: " << loadPvsOverhead << endl; 183 184 141 185 renderTime /= pInVcTotal; 142 186 loadPvsOverhead /= pCrossVcTotal; 143 187 188 mStat.avgRtWithoutOverhead = renderTime; 189 mStat.avgRenderTime = renderTime + loadPvsOverhead; 190 191 mStat.Stop(); 192 144 193 return renderTime + loadPvsOverhead; 145 194 } -
trunk/VUT/GtpVisibilityPreprocessor/src/RenderSimulator.h
r411 r414 3 3 4 4 #include "common.h" 5 #include "Statistics.h" 5 6 6 7 class BspTree; … … 9 10 class KdLeaf; 10 11 12 class SimulationStatistics: public StatisticsBase 13 { 14 public: 15 /// view cell with the biggest "cost" 16 float maxCost; 17 /// view cell with the minimal "cost" 18 float minCost; 19 /// average render time 20 float avgRenderTime; 21 /// average render time with the overhead when crossing view cells 22 float avgRtWithoutOverhead; 23 24 void Reset() 25 { 26 maxCost = 0; 27 minCost = 999999; 28 avgRenderTime = 0; 29 avgRtWithoutOverhead = 0; 30 } 31 32 void Print(ostream &app) const; 33 34 friend ostream &operator<<(ostream &s, const SimulationStatistics &stat) 35 { 36 stat.Print(s); 37 return s; 38 } 39 }; 40 11 41 /** Simulated rendering using a simple render heuristics. Used to evaluate the 12 42 quality of the view cell partition. … … 14 44 class RenderSimulator 15 45 { 46 16 47 public: 17 48 RenderSimulator(); … … 25 56 /// move speed of player 26 57 float mMoveSpeed; 58 59 SimulationStatistics mStat; 27 60 }; 28 61 -
trunk/VUT/GtpVisibilityPreprocessor/src/SamplingPreprocessor.cpp
r412 r414 15 15 environment->GetIntValue("Sampling.totalSamples", mTotalSamples); 16 16 environment->GetIntValue("BspTree.Construction.samples", mBspConstructionSamples); 17 environment->GetIntValue("VspTree.Construction.samples", mVspConstructionSamples); 18 17 environment->GetIntValue("VspKdTree.Construction.samples", mVspConstructionSamples); 19 18 environment->GetIntValue("ViewCells.PostProcessing.samples", mPostProcessSamples); 20 19 environment->GetIntValue("BspTree.Visualization.samples", mVisualizationSamples); … … 389 388 390 389 int pvsOut = Min((int)objects.size(), 10); 390 int pvsSize = 0; 391 391 392 392 RayContainer rays[10]; … … 509 509 510 510 mPass++; 511 512 int pvsSize = 0;513 511 514 if (ViewCell::sHierarchy == ViewCell::BSP) { 515 for (i=0; i < mViewCells.size(); i++) { 516 ViewCell *vc = mViewCells[i]; 517 pvsSize += vc->GetPvs().GetSize(); 518 } 519 } else { 512 if (ViewCell::sHierarchy == ViewCell::KD) 513 { 514 pvsSize = 0; 515 520 516 for (i=0; i < objects.size(); i++) { 521 517 Intersectable *object = objects[i]; … … 523 519 } 524 520 } 525 521 else 522 { 523 Debug << "contr: " << passSampleContributions << " pvs: " << pvsSize << " objects: " << objects.size() << endl; 524 pvsSize += passSampleContributions; 525 } 526 526 float avgRayContrib = (passContributingSamples > 0) ? 527 527 passSampleContributions/(float)passContributingSamples : 0; … … 531 531 << "k #SampleContributions=" << passSampleContributions << " (" 532 532 << 100*passContributingSamples/(float)passSamples<<"%)" << " avgPVS=" 533 << pvsSize /(float)objects.size() << endl533 << (float)pvsSize /(float)objects.size() << endl 534 534 << "avg ray contrib=" << avgRayContrib << endl 535 535 << "reverse samples [%]" << reverseSamples/(float)passSamples*100.0f << endl; … … 552 552 //-- render simulation 553 553 cout << "\nevaluating bsp view cells render time before merge ... "; 554 Real rt =GetRenderSimulator()->SimulateRendering();555 556 cout << "avg render time: " << rt * 1e-3<< endl;557 Debug << "avg render time: " << rt * 1e-3<< endl;554 GetRenderSimulator()->SimulateRendering(); 555 556 cout << "avg render time: " << GetRenderSimulator()->mStat << endl; 557 Debug << "avg render time: " << GetRenderSimulator()->mStat << endl; 558 558 559 559 //-- post processing of bsp view cells … … 574 574 if (exporter) 575 575 { 576 exporter->ExportBspLeaves(*mBspTree, stat.maxPvs);576 exporter->ExportBspLeaves(*mBspTree, 350/*stat.maxPvs*/); 577 577 //exporter->ExportBspViewCellPartition(*mBspTree, 0); 578 578 delete exporter; … … 598 598 cout << "\nevaluating render time after merge ... "; 599 599 600 rt =GetRenderSimulator()->SimulateRendering();601 602 cout << "render time: " << rt * 1e-3<< endl;603 Debug << "render time: " << rt * 1e-3<< endl;600 GetRenderSimulator()->SimulateRendering(); 601 602 cout << "render time: " << GetRenderSimulator()->mStat << endl; 603 Debug << "render time: " << GetRenderSimulator()->mStat << endl; 604 604 605 605 if (1) // export view cells … … 609 609 if (exporter) 610 610 { 611 exporter->ExportBspViewCellPartition(*mBspTree, stat.maxPvs);611 exporter->ExportBspViewCellPartition(*mBspTree, 350/*stat.maxPvs*/); 612 612 //exporter->ExportBspViewCellPartition(*mBspTree, 0); 613 613 delete exporter; … … 813 813 int limit = min((int)mSampleRays.size(), mPostProcessSamples); 814 814 815 for (int i = 0; i < limit; ++ i)815 for (int i = 0; i < limit; ++ i) 816 816 { 817 817 Ray *ray = mSampleRays[i]; … … 819 819 // traverse leaves stored in the rays and compare and merge consecutive 820 820 // leaves (i.e., the neighbors in the tree) 821 if (ray->bspIntersections. empty())821 if (ray->bspIntersections.size() < 2) 822 822 continue; 823 823 … … 827 827 ++ iit; 828 828 829 for (; iit != (*rit)->bspIntersections.end(); ++ iit)829 for (; iit != ray->bspIntersections.end(); ++ iit) 830 830 { 831 831 BspLeaf *leaf = (*iit).mLeaf; … … 837 837 ++ merged; 838 838 } 839 839 840 previousLeaf = leaf; 840 841 } … … 882 883 883 884 // export scene geometry 884 if ( 0)885 if (1) 885 886 { 886 887 Material m;//= RandomMaterial(); -
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.cpp
r411 r414 285 285 286 286 if (!ray->intersections.empty()) 287 { 288 contribution += mViewCell->GetPvs().AddSample(ray->intersections[0].mObject); 289 } 290 287 contribution += mViewCell->GetPvs().AddSample(ray->intersections[0].mObject); 288 291 289 if (ray->sourceObject.mObject) 292 290 contribution += mViewCell->GetPvs().AddSample(ray->sourceObject.mObject); … … 297 295 ++ contributingSamples; 298 296 } 297 299 298 if (BspTree::sStoreLeavesWithRays) 300 299 // warning: intersections not ordered … … 320 319 } 321 320 322 void Bsp ViewCellsStatistics::Print(ostream &app) const323 { 324 app << "===== Bsp ViewCellsstatistics ===============\n";321 void BspTreeStatistics::Print(ostream &app) const 322 { 323 app << "===== BspTree statistics ===============\n"; 325 324 326 325 app << setprecision(4); 327 326 328 app << "#N_OVERALLPVS ( objects in PVS )\n" << pvs << endl; 329 330 app << "#N_PMAXPVS ( largest PVS )\n" << maxPvs << endl; 331 332 app << "#N_PMINPVS ( smallest PVS )\n" << minPvs << endl; 333 334 app << "#N_PAVGPVS ( average PVS )\n" << AvgPvs() << endl; 335 336 app << "#N_PEMPTYPVS ( view cells with PVS smaller 2 )\n" << emptyPvs << endl; 337 338 app << "#N_VIEWCELLS ( number of view cells)\n" << viewCells << endl; 339 340 app << "#N_AVGBSPLEAVES (average number of BSP leaves per view cell )\n" << AvgBspLeaves() << endl; 341 342 app << "#N_MAXBSPLEAVES ( maximal number of BSP leaves per view cell )\n" << maxBspLeaves << endl; 343 344 app << "===== END OF BspViewCells statistics ==========\n"; 345 } 346 347 void BspTreeStatistics::Print(ostream &app) const 348 { 349 app << "===== BspTree statistics ===============\n"; 350 351 app << setprecision(4); 327 app << "#N_CTIME ( Construction time [s] )\n" << Time() << " \n"; 352 328 353 329 app << "#N_NODES ( Number of nodes )\n" << nodes << "\n"; … … 586 562 void BspTree::Construct(const RayContainer &sampleRays) 587 563 { 588 564 mStat.nodes = 1; 589 565 mBox.Initialize(); // initialise BSP tree bounding box 590 566 … … 673 649 tStack.push(tData); 674 650 675 long startTime = GetTime();651 mStat.Start(); 676 652 cout << "**** Contructing bsp tree ****\n"; 677 653 … … 685 661 } 686 662 687 cout << "**** Finished tree construction ****\n"; 688 Debug << "BSP tree contruction time: " << TimeDiff(startTime, GetTime())*1e-3 << "s" << endl; 663 mStat.Stop(); 689 664 } 690 665 … … 898 873 backData.mNode = interior->mBack; 899 874 875 //DEL_PTR(leaf); 900 876 return interior; 901 877 } … … 1941 1917 1942 1918 ++ stat.viewCells; 1943 int pvsSize = viewCell->GetPvs().GetSize();1919 const int pvsSize = viewCell->GetPvs().GetSize(); 1944 1920 1945 1921 stat.pvs += pvsSize; 1946 1922 1947 if (pvsSize < 2)1923 if (pvsSize < 1) 1948 1924 ++ stat.emptyPvs; 1949 1925 … … 2555 2531 return planePoly; 2556 2532 } 2533 2534 void BspViewCellsStatistics::Print(ostream &app) const 2535 { 2536 app << "===== BspViewCells statistics ===============\n"; 2537 2538 app << setprecision(4); 2539 2540 //app << "#N_CTIME ( Construction time [s] )\n" << Time() << " \n"; 2541 2542 app << "#N_OVERALLPVS ( objects in PVS )\n" << pvs << endl; 2543 2544 app << "#N_PMAXPVS ( largest PVS )\n" << maxPvs << endl; 2545 2546 app << "#N_PMINPVS ( smallest PVS )\n" << minPvs << endl; 2547 2548 app << "#N_PAVGPVS ( average PVS )\n" << AvgPvs() << endl; 2549 2550 app << "#N_PEMPTYPVS ( view cells with PVS smaller 2 )\n" << emptyPvs << endl; 2551 2552 app << "#N_VIEWCELLS ( number of view cells)\n" << viewCells << endl; 2553 2554 app << "#N_AVGBSPLEAVES (average number of BSP leaves per view cell )\n" << AvgBspLeaves() << endl; 2555 2556 app << "#N_MAXBSPLEAVES ( maximal number of BSP leaves per view cell )\n" << maxBspLeaves << endl; 2557 2558 app << "===== END OF BspViewCells statistics ==========\n"; 2559 } -
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.h
r412 r414 6 6 #include "Polygon3.h" 7 7 #include <stack> 8 #include "Statistics.h" 8 9 9 10 class ViewCell; … … 71 72 typedef vector<BoundedRay *> BoundedRayContainer; 72 73 73 class BspTreeStatistics 74 class BspTreeStatistics: public StatisticsBase 74 75 { 75 76 public: 76 // total number of nodes 77 int nodes; 78 // number of splits 79 int splits; 80 // totals number of rays 81 int rays; 82 // maximal reached depth 83 int maxDepth; 84 // minimal depth 85 int minDepth; 86 // max depth nodes 87 int maxDepthNodes; 88 // max number of rays per node 89 int maxObjectRefs; 90 // accumulated depth (used to compute average) 91 int accumDepth; 92 // number of initial polygons 93 int polys; 94 /// samples contributing to pvs 95 int contributingSamples; 96 /// sample contributions to pvs 97 int sampleContributions; 98 /// largest pvs 99 int largestPvs; 100 101 // Constructor 102 BspTreeStatistics() 103 { 104 Reset(); 105 } 106 107 int Nodes() const {return nodes;} 108 int Interior() const { return nodes / 2; } 109 int Leaves() const { return (nodes / 2) + 1; } 110 // TODO: computation wrong 111 double AvgDepth() const { return accumDepth / (double)Leaves();}; 77 // total number of nodes 78 int nodes; 79 // number of splits 80 int splits; 81 // totals number of rays 82 int rays; 83 // maximal reached depth 84 int maxDepth; 85 // minimal depth 86 int minDepth; 87 // max depth nodes 88 int maxDepthNodes; 89 // max number of rays per node 90 int maxObjectRefs; 91 // accumulated depth (used to compute average) 92 int accumDepth; 93 // number of initial polygons 94 int polys; 95 /// samples contributing to pvs 96 int contributingSamples; 97 /// sample contributions to pvs 98 int sampleContributions; 99 /// largest pvs 100 int largestPvs; 101 102 // Constructor 103 BspTreeStatistics() 104 { 105 Reset(); 106 } 107 108 int Nodes() const {return nodes;} 109 int Interior() const { return nodes / 2; } 110 int Leaves() const { return (nodes / 2) + 1; } 111 112 // TODO: computation wrong 113 double AvgDepth() const { return accumDepth / (double)Leaves();}; 112 114 113 void Reset() 114 { 115 nodes = 0; 116 splits = 0; 117 maxDepthNodes = 0; 118 maxDepth = 0; 119 minDepth = 99999; 120 polys = 0; 121 accumDepth = 0; 122 123 contributingSamples = 0; 124 sampleContributions = 0; 125 } 126 127 void 128 Print(ostream &app) const; 129 130 friend ostream &operator<<(ostream &s, const BspTreeStatistics &stat) { 131 stat.Print(s); 132 return s; 133 } 134 115 void Reset() 116 { 117 nodes = 0; 118 splits = 0; 119 maxDepthNodes = 0; 120 maxDepth = 0; 121 minDepth = 99999; 122 polys = 0; 123 accumDepth = 0; 124 125 contributingSamples = 0; 126 sampleContributions = 0; 127 } 128 129 void Print(ostream &app) const; 130 131 friend ostream &operator<<(ostream &s, const BspTreeStatistics &stat) 132 { 133 stat.Print(s); 134 return s; 135 } 135 136 }; 136 137 137 class BspViewCellsStatistics 138 class BspViewCellsStatistics: public StatisticsBase 138 139 { 139 140 public: 141 142 /// number of view cells 143 int viewCells; 144 145 /// size of the PVS 146 int pvs; 140 147 141 /// number of view cells 142 int viewCells; 143 144 /// size of the PVS 145 int pvs; 148 /// largest PVS of all view cells 149 int maxPvs; 150 151 /// smallest PVS of all view cells 152 int minPvs; 153 154 /// view cells with empty PVS 155 int emptyPvs; 156 157 /// number of bsp leaves covering the view space 158 int bspLeaves; 159 160 /// largest number of leaves covered by one view cell 161 int maxBspLeaves; 162 163 // Constructor 164 BspViewCellsStatistics() 165 { 166 Reset(); 167 } 168 169 double AvgBspLeaves() const {return (double)bspLeaves / (double)viewCells;}; 170 double AvgPvs() const {return (double)pvs / (double)viewCells;}; 146 171 147 /// largest PVS of all view cells 148 int maxPvs; 149 150 /// smallest PVS of all view cells 151 int minPvs; 152 153 /// view cells with empty PVS 154 int emptyPvs; 155 156 /// number of bsp leaves covering the view space 157 int bspLeaves; 158 159 /// largest number of leaves covered by one view cell 160 int maxBspLeaves; 161 162 163 // Constructor 164 BspViewCellsStatistics() 165 { 166 Reset(); 167 } 168 169 double AvgBspLeaves() const {return (double)bspLeaves / (double)viewCells;}; 170 double AvgPvs() const {return (double)pvs / (double)viewCells;}; 171 172 173 void Reset() 174 { 175 viewCells = 0; 176 pvs = 0; 177 maxPvs = 0; 178 minPvs = 999999; 179 emptyPvs = 0; 180 bspLeaves = 0; 181 maxBspLeaves = 0; 182 } 183 184 void 185 Print(ostream &app) const; 186 187 friend ostream &operator<<(ostream &s, const BspViewCellsStatistics &stat) { 188 stat.Print(s); 189 return s; 190 } 191 172 void Reset() 173 { 174 viewCells = 0; 175 pvs = 0; 176 maxPvs = 0; 177 178 minPvs = 999999; 179 emptyPvs = 0; 180 bspLeaves = 0; 181 maxBspLeaves = 0; 182 } 183 184 void Print(ostream &app) const; 185 186 friend ostream &operator<<(ostream &s, const BspViewCellsStatistics &stat) 187 { 188 stat.Print(s); 189 return s; 190 } 192 191 }; 193 192 -
trunk/VUT/GtpVisibilityPreprocessor/src/VspKdTree.cpp
r413 r414 241 241 AxisAlignedBox3 *forcedBoundingBox) 242 242 { 243 stat.Start();243 mStat.Start(); 244 244 245 245 maxMemory = maxStaticMemory; … … 254 254 255 255 256 stat.nodes = 1;256 mStat.nodes = 1; 257 257 258 258 bbox.Initialize(); … … 276 276 cout<<"Dirr Bbox = "<<dirBBox<<endl; 277 277 278 stat.rays = leaf->rays.size();278 mStat.rays = leaf->rays.size(); 279 279 leaf->UpdatePvsSize(); 280 280 281 stat.initialPvsSize = leaf->GetPvsSize();281 mStat.initialPvsSize = leaf->GetPvsSize(); 282 282 283 283 // Subdivide(); … … 291 291 } 292 292 293 stat.Stop();294 295 stat.Print(cout);293 mStat.Stop(); 294 295 mStat.Print(cout); 296 296 cout<<"#Total memory=" << GetMemUsage() << endl; 297 297 } … … 899 899 900 900 // update stats 901 stat.rayRefs -= (int)leaf->rays.size();902 stat.rayRefs += raysBack + raysFront;901 mStat.rayRefs -= (int)leaf->rays.size(); 902 mStat.rayRefs += raysBack + raysFront; 903 903 904 904 delete leaf; … … 1066 1066 while (tail >= i && leaf->rays[tail].mRay->ScheduledForRemoval()) 1067 1067 { 1068 ++ stat.removedRayRefs;1068 ++ mStat.removedRayRefs; 1069 1069 leaf->rays[tail].mRay->Unref(); 1070 1070 leaf->rays.pop_back(); … … 1076 1076 break; 1077 1077 1078 ++ stat.removedRayRefs;1078 ++ mStat.removedRayRefs; 1079 1079 1080 1080 leaf->rays[i].mRay->Unref(); … … 1092 1092 if (leaf->rays[i].mRay == ray) 1093 1093 { 1094 ++ stat.removedRayRefs;1094 ++ mStat.removedRayRefs; 1095 1095 ray->Unref(); 1096 1096 leaf->rays[i] = leaf->rays[leaf->rays.size() - 1]; … … 1296 1296 #endif 1297 1297 1298 stat.nodes -= collapsedNodes - 1;1299 stat.rayRefs -= totalRayCount - rayCount;1298 mStat.nodes -= collapsedNodes - 1; 1299 mStat.rayRefs -= totalRayCount - rayCount; 1300 1300 1301 1301 #if DEBUG_COLLAPSE -
trunk/VUT/GtpVisibilityPreprocessor/src/VspKdTree.h
r413 r414 371 371 virtual void Print(ostream &s) const 372 372 { 373 s << endl << "L: r = " << rays.size() << endl;373 s << endl << "L: r = " << (int)rays.size() << endl; 374 374 }; 375 375 … … 620 620 621 621 ///////////////////////////// 622 VspKdStatistics m stat;622 VspKdStatistics mStat; 623 623 624 624 VspKdTree();
Note: See TracChangeset
for help on using the changeset viewer.