Changeset 736 for GTP/trunk/Lib/Vis/Preprocessing
- Timestamp:
- 04/08/06 23:35:12 (19 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
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 }
Note: See TracChangeset
for help on using the changeset viewer.