Changeset 736
- Timestamp:
- 04/08/06 23:35:12 (19 years ago)
- Location:
- GTP/trunk/Lib/Vis
- Files:
-
- 2 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionCullingSceneManager.cpp
r726 r736 332 332 InitVisibilityCulling(mCameraInProgress); 333 333 334 std::stringstream d; d << "here34\n"; 335 LogManager::getSingleton().logMessage(d.str()); 336 334 337 335 /** 338 336 * the hierarchical culling algorithm -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreSolidBoundingBox.cpp
r722 r736 158 158 Real SolidBoundingBox::getSquaredViewDepth(const Camera* cam) const 159 159 { 160 Ogre::LogManager::getSingleton().logMessage("here3");161 160 const Vector3 &min = mBox.getMinimum(); 162 161 const Vector3 &max = mBox.getMaximum(); -
GTP/trunk/Lib/Vis/Preprocessing/scripts/default.env
r728 r736 378 378 useRandomAxis false 379 379 usePolygonSplitIfAvailable false 380 useBreathFirstSplits false380 nodePriorityQueueType 0 381 381 382 382 Visualization { -
GTP/trunk/Lib/Vis/Preprocessing/scripts/egsr_test_script
r711 r736 117 117 -vsp_bsp_use_cost_heuristics=false \ 118 118 -vsp_bsp_max_poly_candidates=0 \ 119 -vsp_bsp_ breath_first_splits=true\119 -vsp_bsp_node_queue_type=0 \ 120 120 -vsp_bsp_term_min_pvs=50 \ 121 121 -view_cells_construction_samples=0 \ … … 153 153 -vsp_bsp_max_poly_candidates=0 \ 154 154 -vsp_bsp_use_split_cost_queue=false \ 155 -vsp_bsp_ breath_first_splits=true\155 -vsp_bsp_node_queue_type=0 \ 156 156 -view_cells_filename=$LOG_PREFIX-$METHOD-viewCells.x3d 157 157 … … 181 181 -vsp_bsp_use_cost_heuristics=false \ 182 182 -vsp_bsp_max_poly_candidates=0 \ 183 -vsp_bsp_ breath_first_splits=true\183 -vsp_bsp_node_queue_type=0 \ 184 184 -view_cells_construction_samples=0 \ 185 185 -vsp_bsp_simulate_octree=true \ -
GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp
r735 r736 1234 1234 "5"); 1235 1235 1236 1237 1236 RegisterOption("ViewCells.renderCostEvaluationType", 1238 1237 optString, -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.cpp
r734 r736 401 401 402 402 403 int ViewCellsTree::Get Size(ViewCell *vc) const403 int ViewCellsTree::GetNumInitialViewCells(ViewCell *vc) const 404 404 { 405 405 int vcSize = 0; -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.h
r734 r736 270 270 ViewCellLeaf<T>(): mLeaf(NULL) { SetActive(); } 271 271 ViewCellLeaf<T>(Mesh *mesh): 272 ViewCell(mesh), mLeaf(NULL) { SetActive(); } 273 272 ViewCell(mesh), mLeaf(NULL) { SetActive(); } 274 273 275 274 … … 299 298 /** Returns number of leaves this view cell consists of. 300 299 */ 301 int Get Size(ViewCell *vc) const;300 int GetNumInitialViewCells(ViewCell *vc) const; 302 301 303 302 /** Collects leaves corresponding to a view cell. -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r735 r736 552 552 maxRenderCost = viewCells.back()->GetRenderCost(); 553 553 554 Debug << "histogram minrc: " << minRenderCost << " maxrc: " << maxRenderCost << endl; 555 554 556 const int intervals = min(10000, (int)viewCells.size()); 555 557 … … 561 563 const float totalRenderCost = mViewCellsTree->GetRoot()->GetRenderCost(); 562 564 const float totalVol = GetViewSpaceBox().GetVolume(); 563 564 float vol = 0; 565 int smallerCost = 0; 565 //const float totalVol = mViewCellsTree->GetRoot()->GetVolume(); 566 567 //float vol = 0; 568 //int smallerCost = 0; 569 int j = 0; 566 570 int i = 0; 567 int j = 0;568 569 571 570 572 ViewCellContainer::const_iterator it = viewCells.begin(), it_end = viewCells.end(); … … 574 576 while (1) 575 577 { 578 float vol = 0; 579 int smallerCost = 0; 580 576 581 while ((i < (int)viewCells.size()) && (viewCells[i]->GetRenderCost() < currentRenderCost)) 577 582 { … … 580 585 ++ smallerCost; 581 586 } 582 583 if ((i >= (int)viewCells.size()) || (currentRenderCost >= maxRenderCost)) 587 588 if (i < (int)viewCells.size()) 589 Debug << "new rc increase: " << viewCells[i]->GetRenderCost() / totalVol << " " << currentRenderCost / totalVol << endl; 590 591 if ((smallerCost >= (int)viewCells.size()) || (currentRenderCost >= maxRenderCost)) 584 592 break; 585 593 586 594 float rcRatio = currentRenderCost / maxRenderCost; 587 595 float volRatio = vol / totalVol; 588 596 589 outstream << "#Pass\n" << j ++<< endl;590 outstream << "#RenderCost \n" << rcRatio << endl;591 //fprintf(outstream, "#RenderCost\n%3.3f", rcRatio);592 outstream << "#ViewCells\n" << i<< endl;597 outstream << "#Pass\n" << j << endl; 598 outstream << "#RenderCostRatio\n" << rcRatio << endl; 599 outstream << "#WeightedCost\n" << currentRenderCost / totalVol << endl; 600 outstream << "#ViewCells\n" << smallerCost << endl; 593 601 outstream << "#Volume\n" << volRatio << endl << endl; 594 602 595 603 // increase current render cost 596 604 currentRenderCost += stepSize; 605 ++ j; 597 606 } 598 607 … … 617 626 minPvsSize = viewCells.front()->GetPvs().GetSize(); 618 627 maxPvsSize = viewCells.back()->GetPvs().GetSize(); 628 629 Debug << "histogram minpvssize: " << minPvsSize << " maxpvssize: " << maxPvsSize << endl; 619 630 620 631 const int intervals = min(10000, (int)viewCells.size()); … … 629 640 int currentPvsSize = minPvsSize;//(int)ceil(minRenderCost); 630 641 631 float vol = 0; 632 int smallerCost = 0; 633 642 //float vol = 0; 634 643 int i = 0; 635 644 int j = 0; 636 645 637 638 646 ViewCellContainer::const_iterator it = viewCells.begin(), it_end = viewCells.end(); 639 647 640 // note can skip computations for view cells already evaluated and delete them from vector ... 641 while (1) 642 { 648 while (1) 649 { 650 float vol = 0; 651 int smaller = 0; 652 643 653 while ((i < (int)viewCells.size()) && (viewCells[i]->GetPvs().GetSize() < currentPvsSize)) 644 654 { 645 655 vol += viewCells[i]->GetVolume(); 646 656 ++ i; 647 ++ smallerCost; 648 } 657 ++ smaller; 658 } 659 660 if (i < (int)viewCells.size()) 661 Debug << "new pvs size increase: " << viewCells[i]->GetPvs().GetSize() << " " << currentPvsSize << endl; 649 662 650 663 if ((i >= (int)viewCells.size()) || (currentPvsSize >= maxPvsSize)) … … 655 668 outstream << "#Pass\n" << j ++ << endl; 656 669 outstream << "#Pvs\n" << currentPvsSize << endl; 657 //fprintf(outstream, "#RenderCost\n%3.3f", rcRatio); 658 outstream << "#ViewCells\n" << i << endl; 670 outstream << "#ViewCells\n" << smaller << endl; 659 671 outstream << "#Volume\n" << volRatio << endl << endl; 660 672 … … 756 768 environment->GetIntValue("ViewCells.Evaluation.histoPasses", histoPasses); 757 769 770 int numLeaves = mViewCellsTree->GetNumInitialViewCells(mViewCellsTree->GetRoot()); 771 772 Debug << "number of leaves: " << numLeaves << endl; 773 cout << "number of leaves: " << numLeaves << endl; 774 758 775 if (useHisto) 759 776 { … … 763 780 for (int passes = 1; passes <= histoPasses; ++ passes) 764 781 { 765 int n = (int)mViewCells.size()* passes / histoPasses;782 int n = numLeaves * passes / histoPasses; 766 783 767 784 cout << "computing histogram for " << n << " view cells" << endl; … … 2292 2309 case 2: // merges 2293 2310 { 2294 int lSize = mViewCellsTree->Get Size(vc);2311 int lSize = mViewCellsTree->GetNumInitialViewCells(vc); 2295 2312 importance = (float)lSize / (float)mCurrentViewCellsStats.maxLeaves; 2296 2313 } … … 3218 3235 case 2: // merged leaves 3219 3236 { 3220 int lSize = mViewCellsTree->Get Size(vc);3237 int lSize = mViewCellsTree->GetNumInitialViewCells(vc); 3221 3238 importance = (float)lSize / 3222 3239 (float)mCurrentViewCellsStats.maxLeaves; … … 4146 4163 case 2: // merges 4147 4164 { 4148 int lSize = mViewCellsTree->Get Size(vc);4165 int lSize = mViewCellsTree->GetNumInitialViewCells(vc); 4149 4166 importance = (float)lSize / (float)mCurrentViewCellsStats.maxLeaves; 4150 4167 } -
GTP/trunk/Lib/Vis/shared/EvalStats/EvalStats.cpp
r733 r736 110 110 } 111 111 112 112 113 void EvalNumViewCells(ofstream &outstream, 113 114 const StatsContainer &firstStats, 114 const StatsContainer ¤tStats ,115 vector<float> &ratios)115 const StatsContainer ¤tStats) 116 // vector<float> &ratios) 116 117 { 117 118 //const int n = min((int)firstStats.size(), (int)currentStats.size()); … … 126 127 // compare render cost of current view cell with render cost 127 128 // of other view cells. 128 for (it = currentStats.begin(); it != it_end; ++ it )129 for (it = currentStats.begin(); it != it_end; ++ it, ++ i) 129 130 { 130 131 int j = 0; … … 141 142 float ratio = (float)i / (float)j; 142 143 143 outstream << "#RenderCost " << renderCost << endl; 144 outstream << "#ViewCellsRatio " << ratio << endl; 145 144 outstream << "#Pass\n" << i << endl; 145 outstream << "#RenderCost\n" << renderCost << endl; 146 outstream << "#ViewCellsRatio\n" << ratio << endl << endl; 147 148 //cout << "#Pass " << i ++ << endl; 149 //cout << "#RenderCost " << renderCost << endl; 150 //cout << "#ViewCellsRatio " << ratio << endl; 146 151 } 147 152 } … … 159 164 160 165 vector<string> outFilenames; 166 vector<string> outFilenames2; 161 167 162 168 // read input files from command line … … 182 188 //sscanf(argv[i], "%s.log", fn); 183 189 string outFilename = string(fn) + string("-ratio.log"); 190 string outFilename2 = string(fn) + string("-reverse.log"); 184 191 185 192 outFilenames.push_back(outFilename); 193 outFilenames2.push_back(outFilename2); 194 cout << "new filen: " << outFilename2 << endl; 186 195 } 187 196 else … … 193 202 //statsOut << "rc1 size: " << (int)renderCosts1.size() << " " << (int)renderCosts2.size() << endl << endl; 194 203 vector<StatsContainer>::const_iterator it = renderStats.begin(), it_end = renderStats.end(); 204 195 205 vector<string>::const_iterator sit, sit_end = outFilenames.end(); 206 vector<string>::const_iterator sit2, sit2_end = outFilenames2.end(); 196 207 197 208 sit = outFilenames.begin(); 198 209 sit2 = outFilenames2.begin(); 210 199 211 // compare all values with this vector 200 212 StatsContainer &firstStats = renderStats[0]; … … 204 216 //++ sit; 205 217 206 for (it; it != it_end; ++ it )218 for (it; it != it_end; ++ it, ++ sit, ++ sit2) 207 219 { 208 220 cout << "now writing output to file " << *sit << endl; 209 221 ofstream statsOut; 210 222 statsOut.open((*sit).c_str()); 211 223 ofstream statsOut2; 224 statsOut2.open((*sit2).c_str()); 225 226 cout << "opening new file: " << (*sit2).c_str() << endl; 212 227 // compute size of output vector 213 228 const int n = min((int)firstStats.size(), (int)(*it).size()); … … 221 236 cout << "need " << vc << " view cells to reach rendercost of method " << i << " with " << n << " view cells" << endl; 222 237 #endif 238 EvalNumViewCells(statsOut2, firstStats, (*it)); 239 223 240 statsOut.close(); 224 225 ++ sit; 241 statsOut2.close(); 226 242 } 227 243
Note: See TracChangeset
for help on using the changeset viewer.