Changeset 1917 for GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
- Timestamp:
- 12/21/06 00:42:55 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r1916 r1917 706 706 int smallerCostSum = 0; 707 707 708 // note can skip computations for view cells already evaluated and delete them from vector ... 708 // note can skip computations for view cells already 709 // evaluated and delete them from vector ... 709 710 while (1) 710 711 { … … 746 747 747 748 748 749 749 ViewCellsManager *ViewCellsManager::LoadViewCells(const string &filename, 750 750 ObjectContainer *objects, … … 904 904 viewCells = mViewCells; 905 905 #endif 906 ViewCellContainer::iterator it = viewCells.begin(), 907 it_end = viewCells.end(); 908 for (; it != it_end; ++it) { 909 //(*it)->UpdatePvsCost(); 910 (*it)->SetPvsCost((float)(*it)->GetFilteredPvsSize()); 906 ViewCellContainer::iterator it = viewCells.begin(), it_end = viewCells.end(); 907 for (; it != it_end; ++it) 908 { 909 if (1) 910 (*it)->UpdatePvsCost(); 911 else 912 (*it)->SetPvsCost((float)(*it)->GetFilteredPvsSize()); 911 913 } 912 914 … … 921 923 // hack: normalize pvs size 922 924 int histoMaxVal; 923 Environment::GetSingleton()->GetIntValue( 924 "Preprocessor.histogram.maxValue", histoMaxVal); 925 Environment::GetSingleton()->GetIntValue("Preprocessor.histogram.maxValue", histoMaxVal); 925 926 maxVal = max((float)histoMaxVal, maxPvs); 926 927 … … 938 939 if (!stepSize) stepSize = 1; 939 940 941 Debug << "intervals " << histoIntervals << endl; 940 942 Debug << "stepsize: " << stepSize << endl; 941 943 cout << "intervals " << histoIntervals << endl; 944 cout << "stepsize: " << stepSize << endl; 945 942 946 const float totalRenderCost = mViewCellsTree->GetRoot()->GetRenderCost(); 943 947 const float totalVol = GetViewSpaceBox().GetVolume(); … … 987 991 988 992 outstream.close(); 989 990 993 } 991 994 … … 6044 6047 6045 6048 // mix of sampling strategies 6046 mStrategies.push_back(SamplingStrategy::OBJECT_DIRECTION_BASED_DISTRIBUTION);6049 evalStrats.push_back(SamplingStrategy::OBJECT_DIRECTION_BASED_DISTRIBUTION); 6047 6050 6048 6051 //evalStrats.push_back(SamplingStrategy::OBJECT_BASED_DISTRIBUTION); … … 6168 6171 disposeRays(evaluationSamples, NULL); 6169 6172 } 6170 6171 } 6173 6174 //////////// 6175 //-- histogram 6176 6177 const int numLeaves = mViewCellsTree->GetNumInitialViewCells(mViewCellsTree->GetRoot()); 6178 bool useHisto; 6179 int histoStepSize; 6180 6181 Environment::GetSingleton()->GetBoolValue("ViewCells.Evaluation.histogram", useHisto); 6182 Environment::GetSingleton()->GetIntValue("ViewCells.Evaluation.histoStepSize", histoStepSize); 6183 6184 if (useHisto) 6185 { 6186 // evaluate view cells in a histogram 6187 char s[64]; 6188 6189 // hack: just show final view cells 6190 int pass = (int)mViewCells.size(); 6191 //for (int pass = histoStepSize; pass <= numLeaves; pass += histoStepSize) 6192 if (1) 6193 { 6194 string filename; 6195 6196 cout << "computing histogram for " << pass << " view cells" << endl; 6197 #if 0 6198 //-- evaluate histogram for render cost 6199 sprintf(s, "-%09d-histo.log", pass); 6200 filename = string(statsPrefix) + string(s); 6201 6202 EvalViewCellHistogram(filename, pass); 6203 6172 6204 #endif 6173 6174 6175 6176 } 6205 ////////////////////////////////////////// 6206 //-- evaluate histogram for pvs size 6207 6208 cout << "computing pvs histogram for " << pass << " view cells" << endl; 6209 6210 sprintf(s, "-%09d-histo-pvs.log", pass); 6211 filename = string(statsPrefix) + string(s); 6212 6213 EvalViewCellHistogramForPvsSize(filename, pass); 6214 } 6215 } 6216 } 6217 6218 #endif 6219 6220 6221 6222 }
Note: See TracChangeset
for help on using the changeset viewer.