- Timestamp:
- 01/24/07 01:33:39 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp
r2017 r2048 2114 2114 BvhLeaf *leaf = static_cast<BvhLeaf *>(node); 2115 2115 const AxisAlignedBox3 box = leaf->GetBoundingBox(); 2116 stream << "<Leaf "2116 stream << "<Leaf id=\"" << node->GetId() << "\"" 2117 2117 << " min=\"" << box.Min().x << " " << box.Min().y << " " << box.Min().z << "\"" 2118 2118 << " max=\"" << box.Max().x << " " << box.Max().y << " " << box.Max().z << "\"" … … 2130 2130 const AxisAlignedBox3 box = interior->GetBoundingBox(); 2131 2131 2132 stream << "<Interior "2132 stream << "<Interior id=\"" << node->GetId() << "\"" 2133 2133 << " min=\"" << box.Min().x << " " << box.Min().y << " " << box.Min().z << "\"" 2134 2134 << " max=\"" << box.Max().x << " " << box.Max().y << " " << box.Max().z -
GTP/trunk/Lib/Vis/Preprocessing/src/CombinedPreprocessor.cpp
r2046 r2048 74 74 75 75 long startTime = GetTime(); 76 76 77 for (int i=0; i < mTotalSamples; i += mSamplesPerPass, mPass++) { 77 78 mRayCaster->InitPass(); -
GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp
r2046 r2048 1296 1296 "1000000"); 1297 1297 1298 RegisterOption("GvsPreprocessor. samplesPerPass",1298 RegisterOption("GvsPreprocessor.gvsSamplesPerPass", 1299 1299 optInt, 1300 1300 "gvs_samples_per_pass=", … … 1611 1611 "view_cells_compress_objects=", 1612 1612 "false"); 1613 1614 1613 1615 1614 RegisterOption("ViewCells.useKdPvs", … … 1618 1617 "false"); 1619 1618 1620 1621 1619 RegisterOption("ViewCells.useKdPvsAfterFiltering", 1622 1620 optBool, … … 1624 1622 "false"); 1625 1623 1626 1627 1624 RegisterOption("ViewCells.importRandomViewCells", 1625 optBool, 1626 "view_cells_import_random_viewcells=", 1627 "false"); 1628 1629 RegisterOption("ViewCells.exportRandomViewCells", 1630 optBool, 1631 "view_cells_export_random_viewcells=", 1632 "false"); 1633 1634 1628 1635 1629 1636 /****************************************************************************/ … … 1784 1791 RegisterOption("BspTree.Factor.pvs", optFloat, "bsp_factor_pvs=", "1.0"); 1785 1792 1786 /************************************************************************************/ 1787 /* Preprocessor related options */ 1788 /************************************************************************************/ 1793 1794 1795 1796 /**********************************************************************/ 1797 /* Preprocessor related options */ 1798 /**********************************************************************/ 1789 1799 1790 1800 RegisterOption("Preprocessor.type", … … 1863 1873 "false"); 1864 1874 1875 RegisterOption("Preprocessor.evaluatePixelError", 1876 optBool, 1877 "preprocessor_evaluatePixelError", 1878 "false"); 1879 1865 1880 RegisterOption("Preprocessor.applyVisibilitySpatialFilter", 1866 1881 optBool, -
GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp
r2023 r2048 860 860 GlRendererBuffer::EvalPvsStat() 861 861 { 862 cout<<"here15"<<endl; 863 MakeCurrent(); 864 865 GlRenderer::EvalPvsStat(); 866 867 DoneCurrent(); 868 cout<<"here185"<<endl; 862 MakeCurrent(); 863 864 GlRenderer::EvalPvsStat(); 865 866 DoneCurrent(); 869 867 // mRenderingFinished.wakeAll(); 868 } 869 870 871 void GlRendererBuffer::EvalPvsStat(const SimpleRayContainer &viewPoints) 872 { 873 MakeCurrent(); 874 875 GlRenderer::EvalPvsStat(viewPoints); 876 877 DoneCurrent(); 870 878 } 871 879 … … 1291 1299 1292 1300 bool GlRendererBuffer::ValidViewPoint() 1293 { cout << "here49" << endl; 1294 /*MakeCurrent(); 1301 { 1302 MakeCurrent(); 1303 1304 SetupProjection(GetWidth(), GetHeight()); 1295 1305 1296 1306 bool result = GlRenderer::ValidViewPoint(); 1307 1297 1308 DoneCurrent(); 1298 */bool result = true; 1309 1299 1310 return result; 1300 1311 } … … 1304 1315 GlRenderer::EvalPvsStat() 1305 1316 { 1306 cout <<"here3399"<<endl;1307 1317 mPvsStat.Reset(); 1308 1318 halton.Reset(); … … 1372 1382 } 1373 1383 1384 1385 void GlRenderer::EvalPvsStat(const SimpleRayContainer &viewPoints) 1386 { 1387 ClearErrorBuffer(); 1388 1389 mPvsStat.Reset(); 1390 halton.Reset(); 1391 1392 SetupProjection(GetWidth(), GetHeight()); 1393 1394 cout << "mPvsStatFrames=" << mPvsStatFrames << endl; 1395 1396 SimpleRayContainer::const_iterator sit, sit_end = viewPoints.end(); 1397 int i = 0; 1398 1399 for (sit = viewPoints.begin(); sit != sit_end; ++ sit, ++ i) 1400 { 1401 //cout << "view point: " << (*sit) << endl;; 1402 SimpleRay sray = *sit; 1403 1404 float err; 1405 1406 // set frame id for saving the error buffer 1407 mFrame = i; 1408 mViewPoint = sray.mOrigin; 1409 mViewDirection = sray.mDirection; 1410 1411 if (0 && (mPvsErrorBuffer[i].mError == 1.0f)) 1412 { 1413 // check if the view point is valid 1414 if (!ValidViewPoint()) 1415 { 1416 cout << "error: " << " view point invalid" << endl; 1417 mPvsErrorBuffer[i].mError = -1.0f; 1418 } 1419 else 1420 { 1421 cout << "view point valid" << endl; 1422 } 1423 } 1424 1425 if (mPvsErrorBuffer[i].mError > 0.0f) 1426 { 1427 int pvsSize; 1428 1429 // compute the pixel error 1430 float error = GetPixelError(pvsSize); 1431 1432 mPvsErrorBuffer[i].mError = error; 1433 mPvsErrorBuffer[i].mPvsSize = pvsSize; 1434 1435 cout << "(" << i << "," << mPvsErrorBuffer[i].mError <<")"; 1436 } 1437 1438 err = mPvsErrorBuffer[i].mError; 1439 1440 if (err >= 0.0f) 1441 { 1442 if (err > mPvsStat.maxError) 1443 mPvsStat.maxError = err; 1444 1445 mPvsStat.sumError += err; 1446 mPvsStat.sumPvsSize += mPvsErrorBuffer[i].mPvsSize; 1447 1448 if (err == 0.0f) 1449 ++ mPvsStat.errorFreeFrames; 1450 1451 ++ mPvsStat.frames; 1452 } 1453 } 1454 1455 glFinish(); 1456 cout << endl << flush; 1457 } 1458 1459 1460 1374 1461 bool 1375 1462 GlRenderer::ValidViewPoint() 1376 1463 { 1377 if (!mDetectEmptyViewSpace) 1378 return true; 1464 //cout<<"VV4 "; 1465 if (!mDetectEmptyViewSpace) 1466 return true; 1467 //cout << "vp: " << mViewPoint << " dir: " << mViewDirection << endl; 1379 1468 1380 1469 OcclusionQuery *query = mOcclusionQueries[0]; … … 1415 1504 // cout<<"VV4 "; 1416 1505 1506 //cout<<"count: " << pixelCount<<endl; 1507 1417 1508 if (pixelCount > 0) 1418 { cout<<"count: " << pixelCount<<endl;1509 { 1419 1510 return false; // backfacing polygon found -> not a valid viewspace sample 1420 1511 } -
GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.h
r2023 r2048 26 26 class TriangleIntersectable; 27 27 class BvhNode; 28 28 class SimpleRayContainer; 29 29 30 struct VssRayContainer; 30 31 … … 152 153 virtual void 153 154 EvalPvsStat(); 155 156 virtual void EvalPvsStat(const SimpleRayContainer &viewPoints); 154 157 155 158 virtual void InitGL(); … … 272 275 virtual void EvalPvsStat(); 273 276 277 virtual void EvalPvsStat(const SimpleRayContainer &viewPoints); 274 278 275 279 virtual int GetWidth() const = 0; -
GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.cpp
r2017 r2048 25 25 }; 26 26 27 27 28 static const float MIN_DIST = 0.001f; 28 29 … … 37 38 Environment::GetSingleton()->GetIntValue("GvsPreprocessor.totalSamples", mTotalSamples); 38 39 Environment::GetSingleton()->GetIntValue("GvsPreprocessor.initialSamples", mInitialSamples); 39 Environment::GetSingleton()->GetIntValue("GvsPreprocessor. samplesPerPass", mSamplesPerPass);40 Environment::GetSingleton()->GetIntValue("GvsPreprocessor.gvsSamplesPerPass", mGvsSamplesPerPass); 40 41 Environment::GetSingleton()->GetIntValue("GvsPreprocessor.minContribution", mMinContribution); 41 42 Environment::GetSingleton()->GetFloatValue("GvsPreprocessor.epsilon", mEps); … … 44 45 Environment::GetSingleton()->GetIntValue("GvsPreprocessor.maxViewCells", mMaxViewCells); 45 46 47 Environment::GetSingleton()->GetBoolValue("Preprocessor.evaluatePixelError", mEvaluatePixelError); 48 46 49 char gvsStatsLog[100]; 47 50 Environment::GetSingleton()->GetStringValue("GvsPreprocessor.stats", gvsStatsLog); … … 51 54 Debug << "number of total samples: " << mTotalSamples << endl; 52 55 Debug << "number of initial samples: " << mInitialSamples << endl; 53 Debug << "number of samples per pass: " << mSamplesPerPass << endl; 56 cout << "number of gvs samples per pass: " << mGvsSamplesPerPass << endl; 57 cout << "number of samples per pass: " << mSamplesPerPass << endl; 54 58 Debug << "threshold: " << mThreshold << endl; 55 59 Debug << "epsilon: " << mEps << endl; … … 83 87 mRayQueue.pop(); 84 88 85 delete ray;89 //delete ray; 86 90 } 87 91 } … … 141 145 if (!HandleRay(newRay)) 142 146 { 143 delete newRay; 144 } 145 146 147 //delete newRay; 148 } 149 147 150 return 1; 148 151 } … … 286 289 const VssRay &ray2, 287 290 const VssRay &oldRay) 288 {//cout <<"x"<<Magnitude(p1 - p2) << " "; 291 { 292 //cout <<"y"<<Magnitude(p1 - p2) << " "; 289 293 int castRays = 0; 290 294 … … 320 324 321 325 // this ray will not be further processed 322 if (!enqueued) 323 delete newRay; 326 //if (!enqueued) delete newRay; 324 327 325 328 return castRays; … … 339 342 else 340 343 { 341 cout << " not yet implemented" << endl;344 cout << "border sampling: " << tObj->Type() << " not yet implemented" << endl; 342 345 } 343 346 … … 427 430 428 431 CLEAR_CONTAINER(invalidSamples); 429 //cout << "***********"<< endl; 432 433 //cout << "cast rays: " << castRays << endl; 430 434 return castRays; 431 435 } … … 495 499 // other types not implemented yet 496 500 if (tObj->Type() == Intersectable::TRIANGLE_INTERSECTABLE) 501 { 497 502 occluder = static_cast<TriangleIntersectable *>(tObj)->GetItem(); 503 } 498 504 else 499 cout << "not yet implemented" << endl; 500 505 { 506 cout << "reverse sampling: " << tObj->Type() << " not yet implemented" << endl; 507 } 501 508 // get a point which is passing just outside of the occluder 502 509 Vector3 newPoint; … … 603 610 ++ mGvsStats.mGvsPass; 604 611 605 while (!mRayQueue.empty() 606 )//&& (mGvsStats.mTotalSamples + castSamples < mTotalSamples) ) 612 while (!mRayQueue.empty())//&& (mGvsStats.mTotalSamples + castSamples < mTotalSamples) ) 607 613 { 608 614 // handle next ray … … 614 620 castSamples += newSamples; 615 621 616 //cout << "new samples: " << newSamples << " " << "queue: " << (int)mRayQueue.size() << endl; 617 delete ray; 622 //delete ray; 623 } 624 625 // HACK 626 if (mRayCaster->mVssRayPool.mIndex > mSamplesPerPass) 627 { 628 cout << "warning: new samples: " << castSamples << " " << "queue: " << (int)mRayQueue.size() << endl; 629 Debug << "warning: new samples: " << castSamples << " " << "queue: " << (int)mRayQueue.size() << endl; 618 630 } 619 631 … … 753 765 { 754 766 //Intersectable::NewMail(); 767 755 768 // compute direct intersections with view cell 756 769 IntersectWithViewCell(); … … 763 776 while (1) 764 777 { 778 mRayCaster->InitPass(); 779 765 780 // Ray queue empty => 766 781 // cast a number of uniform samples to fill ray queue … … 773 788 mGvsStats.mPerViewCellSamples += newSamples; 774 789 775 776 if (passSamples >= mSamplesPerPass) 790 if (passSamples >= mGvsSamplesPerPass) 777 791 { 778 792 ++ mPass; 779 780 793 mGvsStats.mPassContribution = mGvsStats.mTotalContribution - oldContribution; 781 794 … … 805 818 void GvsPreprocessor::CompileViewCellsList() 806 819 { 820 vector<ViewCellPoints *> *vcPoints = mViewCellsManager->GetViewCellPoints(); 821 822 if (!vcPoints->empty()) 823 { 824 vector<ViewCellPoints *>::const_iterator vit, vit_end = vcPoints->end(); 825 826 for (vit = vcPoints->begin(); vit != vit_end; ++ vit) 827 { 828 mViewCells.push_back((*vit)->first); 829 } 830 831 return; 832 } 833 807 834 while ((int)mViewCells.size() < mMaxViewCells) 808 835 { … … 886 913 (*oit)->mCounter = 0; 887 914 } 888 long lastTime = GetTime();889 890 while (NextViewCell())891 {915 //int dummy = 0; 916 while (NextViewCell())// && (dummy < 3)) 917 {//++ dummy; 918 long startTime = GetTime(); 892 919 cout << "\n***********************\n" 893 920 << "processing view cell " << mProcessedViewCells … … 907 934 GetObjectPvs(objectPvs); 908 935 909 cout << "triangle pvs of " << (int)mTrianglePvs.size() << " was converted to object pvs of " << (int)objectPvs.size() << endl; 936 cout << "triangle pvs of " << (int)mTrianglePvs.size() 937 << " was converted to object pvs of " << (int)objectPvs.size() << endl; 910 938 911 939 //////// … … 922 950 const long currentTime = GetTime(); 923 951 924 mGvsStats.mTimePerViewCell = TimeDiff( lastTime, currentTime) * 1e-3f;952 mGvsStats.mTimePerViewCell = TimeDiff(startTime, currentTime) * 1e-3f; 925 953 mGvsStats.mTotalTime += mGvsStats.mTimePerViewCell; 926 954 927 lastTime = currentTime;955 //lastTime = currentTime; 928 956 929 957 mGvsStats.Stop(); … … 940 968 941 969 // is this really necessary? 942 ClearRayQueue(); 970 //ClearRayQueue(); 971 972 if (mEvaluatePixelError || mExportVisibility) 973 { 974 StorePvs(objectPvs); 975 } 976 } 977 } 978 979 980 void GvsPreprocessor::StorePvs(const ObjectContainer &objectPvs) 981 { 982 ObjectContainer::const_iterator oit, oit_end = objectPvs.end(); 983 984 for (oit = objectPvs.begin(); oit != oit_end; ++ oit) 985 { 986 mCurrentViewCell->GetPvs().AddSample(*oit, 1); 987 } 988 } 989 990 991 void GvsPreprocessor::ComputeRenderError() 992 { 993 cout << "computing gvs render error" << endl; 994 vector<ViewCellPoints *> *vcPoints = mViewCellsManager->GetViewCellPoints(); 995 996 vector<ViewCellPoints *>::const_iterator vit, vit_end = vcPoints->end(); 997 998 for (vit = vcPoints->begin(); vit != vit_end; ++ vit) 999 { 1000 ViewCellPoints *vcPoints = *vit; 1001 1002 renderer->EvalPvsStat(vcPoints->second); 1003 1004 mStats << 1005 "#ViewCell\n" << vcPoints->first->GetId() << endl << 1006 "#AvgPvsRenderError\n" <<renderer->mPvsStat.GetAvgError() << endl << 1007 "#AvgPixelError\n" << renderer->GetAvgPixelError() << endl << 1008 "#MaxPixelError\n" << renderer->GetMaxPixelError() << endl << 1009 "#MaxPvsRenderError\n" << renderer->mPvsStat.GetMaxError() << endl << 1010 "#ErrorFreeFrames\n" << renderer->mPvsStat.GetErrorFreeFrames() << endl << 1011 "#AvgRenderPvs\n" << renderer->mPvsStat.GetAvgPvs() << endl; 943 1012 } 944 1013 } … … 1007 1076 while (mGvsStats.mTotalSamples < mTotalSamples) 1008 1077 { 1078 mRayCaster->InitPass(); 1009 1079 // Ray queue empty => 1010 1080 // cast a number of uniform samples to fill ray queue … … 1017 1087 mGvsStats.mTotalSamples += newSamples; 1018 1088 1019 if (passSamples % (m SamplesPerPass + 1) == mSamplesPerPass)1089 if (passSamples % (mGvsSamplesPerPass + 1) == mGvsSamplesPerPass) 1020 1090 { 1021 1091 ++ mPass; … … 1075 1145 // list of view cells to compute 1076 1146 CompileViewCellsList(); 1077 1078 1147 PerViewCellComputation(); 1148 1149 if (mEvaluatePixelError) 1150 { 1151 ComputeRenderError(); 1152 } 1079 1153 } 1080 1154 else … … 1090 1164 CLEAR_CONTAINER(mVssRays); 1091 1165 } 1166 1167 // export the preprocessed information to a file 1168 if (0 && mExportVisibility) 1169 { 1170 ExportPreprocessedData(mVisibilityFileName); 1171 } 1092 1172 1093 1173 return true; 1174 } 1175 1176 1177 void GvsPreprocessor::DeterminePvsObjects(VssRayContainer &rays) 1178 { 1179 mViewCellsManager->DeterminePvsObjects(rays, true); 1094 1180 } 1095 1181 -
GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.h
r2003 r2048 215 215 void IntersectWithViewCell(); 216 216 217 void DeterminePvsObjects(VssRayContainer &rays); 218 219 virtual void ComputeRenderError(); 220 221 void StorePvs(const ObjectContainer &objectPvs); 222 223 217 224 ////////////////////// 218 225 219 220 int mSamplesPerPass; 221 int mTotalSamples; 226 //int mSamplesPerPass; 227 //int mTotalSamples; 222 228 int mInitialSamples; 223 229 … … 230 236 VssRayContainer mVssRays; 231 237 238 239 232 240 /////////// 233 241 // stats … … 250 258 251 259 ObjectContainer mTrianglePvs; 260 261 // HACK 262 int mGvsSamplesPerPass; 263 264 bool mComputeRenderError; 265 266 bool mEvaluatePixelError; 252 267 }; 253 268 -
GTP/trunk/Lib/Vis/Preprocessing/src/Intersectable.h
r1999 r2048 64 64 BVH_INTERSECTABLE, 65 65 TRIANGLE_INTERSECTABLE, 66 OBJECTS_INTERSECTABLE 66 OBJECTS_INTERSECTABLE, 67 DUMMY_INTERSECTABLE 67 68 }; 68 69 -
GTP/trunk/Lib/Vis/Preprocessing/src/IntersectableWrapper.h
r1999 r2048 188 188 { 189 189 public: 190 TriangleIntersectable( Triangle3item):190 TriangleIntersectable(const Triangle3 &item): 191 191 IntersectableWrapper<Triangle3>(item) {} 192 192 … … 220 220 221 221 222 class DummyIntersectable: public IntersectableWrapper<int> 223 { 224 public: 225 DummyIntersectable(const int item): 226 IntersectableWrapper<int>(item) {} 227 228 int Type() const 229 { 230 return Intersectable::DUMMY_INTERSECTABLE; 231 } 232 }; 233 222 234 } 223 235 -
GTP/trunk/Lib/Vis/Preprocessing/src/Mutation.cpp
r2035 r2048 712 712 sray = SimpleRay(origin, direction, MUTATION_BASED_DISTRIBUTION, pdf); 713 713 sray.mGeneratorId = index; 714 715 return true; 714 716 } 715 717 -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
r2047 r2048 155 155 Environment::GetSingleton()->GetStringValue("Preprocessor.stats", buffer); 156 156 mStats.open(buffer); 157 158 157 159 158 Environment::GetSingleton()->GetBoolValue("Preprocessor.applyVisibilityFilter", mApplyVisibilityFilter); 160 159 Environment::GetSingleton()->GetBoolValue("Preprocessor.applyVisibilitySpatialFilter", … … 182 181 Debug << "export obj: " << mExportObj << endl; 183 182 Debug << "use view space box: " << mUseViewSpaceBox << endl; 183 184 cout << "samples per pass " << mSamplesPerPass << endl; 184 185 } 185 186 … … 262 263 } 263 264 264 #define POWERPLANT_HACK 1265 265 266 266 bool Preprocessor::LoadBinaryObj(const string filename, … … 1204 1204 1205 1205 // reserve constant block of rays 1206 mRayCaster->ReserveVssRayPool(2*mSamplesPerPass); 1206 cout << "======================" << endl; 1207 cout << "reserving " << 2 * mSamplesPerPass << " rays " << endl; 1208 mRayCaster->ReserveVssRayPool(2 * mSamplesPerPass); 1207 1209 1208 1210 return true; … … 1311 1313 } 1312 1314 1313 mViewCellsManager->DeterminePvsObjects(vssRays 1314 ); 1315 1315 DeterminePvsObjects(vssRays); 1316 1316 } 1317 1317 … … 1530 1530 } 1531 1531 1532 } 1532 1533 void Preprocessor::DeterminePvsObjects(VssRayContainer &rays) 1534 { 1535 mViewCellsManager->DeterminePvsObjects(rays, false); 1536 } 1537 1538 1539 } -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.h
r2046 r2048 129 129 ); 130 130 131 bool 132 ExportRayAnimation(const char *filename, 133 const vector<VssRayContainer> &vssRays 134 ); 135 136 virtual int 137 GenerateRays(const int number, 138 SamplingStrategy &strategy, 139 SimpleRayContainer &rays); 131 bool ExportRayAnimation(const char *filename, 132 const vector<VssRayContainer> &vssRays); 133 134 virtual int GenerateRays(const int number, 135 SamplingStrategy &strategy, 136 SimpleRayContainer &rays); 140 137 141 138 virtual int GenerateRays(const int number, 142 const int raysType,143 SimpleRayContainer &rays);139 const int raysType, 140 SimpleRayContainer &rays); 144 141 145 142 bool GenerateRayBundle(SimpleRayContainer &rayBundle, 146 const SimpleRay &mainRay,147 const int number,148 const int shuffleType) const;143 const SimpleRay &mainRay, 144 const int number, 145 const int shuffleType) const; 149 146 150 147 virtual void CastRays(SimpleRayContainer &rays, … … 153 150 const bool pruneInvalidRays = true); 154 151 155 /** Compute pixel error of the current PVS solution by sampling given number of viewpoints */ 152 /** Compute pixel error of the current PVS solution by sampling given number of viewpoints . 153 */ 156 154 virtual void ComputeRenderError(); 157 155 … … 179 177 PreprocessorThread *GetThread() const; 180 178 181 182 179 Intersectable *GetObjectById(const int id); 183 180 184 181 void PrepareHwGlobalLines(); 182 183 virtual void DeterminePvsObjects(VssRayContainer &rays); 184 185 185 186 //////////////////////////////////////////////// 186 187 -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.vcproj
r2023 r2048 221 221 OptimizeForProcessor="3" 222 222 OptimizeForWindowsApplication="TRUE" 223 AdditionalIncludeDirectories="..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;..\..\..\..\..\..\NonGTP\Boost;..\MultiLevelRayTracing;"$(QTDIR)\include\QtCore";"$(QTDIR)\include\QtGui";"$(QTDIR)\include";"$(QTDIR)\include\QtOpenGl";"$(CG_INC_PATH)" "224 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;GTP_INTERNAL;USE_QT ;USE_CG"223 AdditionalIncludeDirectories="..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;..\..\..\..\..\..\NonGTP\Boost;..\MultiLevelRayTracing;"$(QTDIR)\include\QtCore";"$(QTDIR)\include\QtGui";"$(QTDIR)\include";"$(QTDIR)\include\QtOpenGl";"$(CG_INC_PATH)";Timer" 224 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;GTP_INTERNAL;USE_QT" 225 225 ExceptionHandling="TRUE" 226 226 RuntimeLibrary="2" … … 377 377 </File> 378 378 <File 379 RelativePath=".\Timer\BenchTimer.cpp"> 380 </File> 381 <File 382 RelativePath=".\Timer\BenchTimer.h"> 383 </File> 384 <File 379 385 RelativePath="..\src\BoostPreprocessorThread.cpp"> 380 386 </File> … … 527 533 </File> 528 534 <File 535 RelativePath=".\Timer\merror.cpp"> 536 </File> 537 <File 538 RelativePath=".\Timer\merror.h"> 539 </File> 540 <File 529 541 RelativePath="..\src\Mesh.cpp"> 530 542 </File> … … 539 551 </File> 540 552 <File 553 RelativePath=".\Timer\mstring.h"> 554 </File> 555 <File 556 RelativePath=".\Mutation.cpp"> 557 </File> 558 <File 559 RelativePath=".\Mutation.h"> 560 </File> 561 <File 541 562 RelativePath="..\src\MutualVisibility.cpp"> 542 563 </File> … … 572 593 </File> 573 594 <File 595 RelativePath=".\Timer\PerfTimer.h"> 596 </File> 597 <File 598 RelativePath=".\Timer\PerfTimerSkeleton.h"> 599 </File> 600 <File 574 601 RelativePath="..\src\Plane3.cpp"> 575 602 </File> … … 738 765 <File 739 766 RelativePath="..\src\RayInfo.h"> 767 </File> 768 <File 769 RelativePath=".\Timer\RDTSCTimer.cpp"> 770 </File> 771 <File 772 RelativePath=".\Timer\RDTSCTimer.h"> 740 773 </File> 741 774 <File -
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp
r2008 r2048 166 166 167 167 168 if (mSnapErrorFrames && pErrorPixels > 0.01f) {168 if (mSnapErrorFrames && pErrorPixels >= 0.01f) { 169 169 170 170 char filename[256]; -
GTP/trunk/Lib/Vis/Preprocessing/src/RayCaster.h
r2014 r2048 69 69 // pool of vss rays to be used in one pass of the sampling 70 70 struct VssRayPool { 71 VssRayPool():mRays(NULL), mIndex(0) {}71 VssRayPool():mRays(NULL), mIndex(0), mNumber(0) {} 72 72 ~VssRayPool() { 73 73 if (mRays) … … 79 79 delete mRays; 80 80 mRays = new VssRay[number]; 81 mNumber = number; 81 82 } 82 83 … … 85 86 } 86 87 VssRay *Alloc() { 88 // reset pool 89 if (mIndex == mNumber) 90 mIndex = 0; 87 91 return mRays + mIndex++; 88 92 } … … 90 94 VssRay *mRays; 91 95 int mIndex; 96 int mNumber; 92 97 }; 93 98 -
GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.cpp
r2044 r2048 669 669 } else 670 670 if (strcmp(curr, "mutation")==0) { 671 // temp matt: still no mutationstrategy! 672 mDistributions.push_back(new MutationBasedDistribution(mPreprocessor)); 671 mDistributions.push_back(new MutationBasedDistribution(mPreprocessor)); 673 672 } 674 673 -
GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.vcproj
r2023 r2048 209 209 Name="VCLinkerTool" 210 210 AdditionalDependencies="xerces-c_2.lib glew32.lib zdll.lib zziplib.lib devil.lib glut32.lib OpenGL32.Lib glu32.lib Preprocessor.lib RTScene.lib RTWorld.lib QtCore4.lib qtmain.lib cg.lib cgGL.lib QtOpenGL4.lib Qt3Support4.lib QtTest4.lib QtGui4.lib QtInterface.lib" 211 OutputFile="../bin/release/Preprocessor .exe"211 OutputFile="../bin/release/Preprocessor2.exe" 212 212 LinkIncremental="1" 213 213 AdditionalLibraryDirectories="..\src\GL;..\lib\release;..\..\Preprocessing\lib\release;..\..\..\..\..\..\NonGTP\Boost\lib;..\..\..\..\..\..\NonGTP\Xerces\xercesc\lib;..\..\..\..\..\..\NonGTP\Zlib\lib;..\..\..\..\..\..\NonGTP\Devil\lib;..\MultiLevelRayTracing\RTScene\Release;..\MultiLevelRayTracing\RTWorld\Release;"$(QTDIR)\lib";.\QtInterface\Release;"$(CG_LIB_PATH)"" -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r2043 r2048 352 352 353 353 354 bool ViewCellsManager::GenerateRandomViewCells(vector<ViewCellPoints *> &viewCells,354 /*bool ViewCellsManager::GenerateRandomViewCells(vector<ViewCellPoints *> &viewCells, 355 355 const int nViewCells, 356 356 const int nViewPoints) … … 369 369 ViewCellContainer::const_iterator vit, vit_end = rViewCells.end(); 370 370 371 for (vit = rViewCells.begin(); vit != vit_end; ++ vit) 371 int i = 0; 372 for (vit = rViewCells.begin(); vit != vit_end; ++ vit, ++ i) 372 373 { 373 374 ViewCell *vc = *vit; … … 379 380 380 381 SimpleRayContainer viewPoints; 382 cout << "processing view cell " << i << endl; 381 383 // generate random view points 382 384 GenerateViewPoints(vc, nViewPoints, viewPoints); … … 388 390 vcPts->second.push_back(*pit); 389 391 } 392 } 393 394 return true; 395 }*/ 396 397 398 bool ViewCellsManager::GenerateRandomViewCells(vector<ViewCellPoints *> &viewCells, 399 const int nViewCells, 400 const int nViewPoints) 401 { 402 ViewCellContainer rViewCells; 403 404 cout << "generating " << nViewCells << " random view cells" << endl; 405 ///GenerateRandomViewCells(rViewCells, nViewCells); 406 407 //cout << "finished" << endl; 408 409 //for (int i = 0; i < viewCells.size(); ++ i) 410 // cout << "vc " << i << ": " << viewCells[i]->GetId() << endl; 411 412 cout << "generating " << nViewPoints << " view points per view cell" << endl; 413 414 int generatedViewCells = 0; 415 int i = 0; 416 while (generatedViewCells < nViewCells) 417 { 418 ++ i; 419 420 const int idx = (int)RandomValue(0.0f, (float)mViewCells.size() - 0.5f); 421 422 ViewCell *viewCell = GetViewCell(idx); 423 424 cout << "testing view cell: " << viewCell->GetId() << endl; 425 426 if (!viewCell->Mailed()) 427 { 428 viewCell->Mail(); 429 430 SimpleRayContainer viewPoints; 431 cout<<"here18"<<endl; 432 // generate random view points 433 if (IsValidViewSpace(viewCell) && 434 GenerateViewPoints(viewCell, nViewPoints, viewPoints)) 435 {cout << "here99" << endl; 436 Debug << "vc: " << viewCell->GetId() << endl; 437 438 ViewCellPoints *vcPts = new ViewCellPoints(); 439 viewCells.push_back(vcPts); 440 441 // valid view cell found 442 vcPts->first = viewCell; 443 444 // generate view points 445 ++ generatedViewCells; 446 447 SimpleRayContainer::const_iterator pit, pit_end = viewPoints.end(); 448 449 for (pit = viewPoints.begin(); pit != pit_end; ++ pit) 450 { 451 Debug << "vp: " << (*pit) << endl; 452 vcPts->second.push_back(*pit); 453 } 454 cout << "view cell " << generatedViewCells << " generated: " << viewCell->GetId() << endl; 455 } 456 else 457 { 458 cout << "error: invalid view cell " << generatedViewCells << " with id " << viewCell->GetId() << endl; 459 } 460 } 461 462 if (i > nViewCells * 1000000) // safety 463 { 464 cout << "big error" << endl; 465 break; 466 } 467 cout << "processd view cells " << generatedViewCells << " of " << nViewCells << endl << endl; 390 468 } 391 469 … … 437 515 438 516 517 bool ViewCellsManager::ImportRandomViewCells(const string &filename) 518 { 519 return ImportRandomViewCells(filename, mViewCellPoints); 520 } 521 522 439 523 bool ViewCellsManager::GenerateViewPoints(ViewCell *viewCell, 440 524 const int numViewPoints, … … 445 529 int i = 0; 446 530 531 cout << "generating view points for view cell " << viewCell->GetId() << endl; 532 447 533 while (generatedPts < numViewPoints) 448 534 { … … 450 536 451 537 if (GenerateViewPoint(viewCell, pt)) 452 { 538 {cout<<"here4"<<endl; 453 539 ++ generatedPts; 540 cout << "generated view point " << generatedPts << endl; 454 541 viewPoints.push_back(pt); 455 542 } 456 543 457 544 // savety criterium 458 if (++ i > numViewPoints + 100000)545 if (++ i > numViewPoints * 3) 459 546 { 460 547 return false; … … 462 549 } 463 550 551 cout << "view point generation finished" << endl; 552 464 553 return true; 554 } 555 556 557 bool ViewCellsManager::ExportRandomViewCells(const string &filename) 558 { 559 const int numViewCells = 100; 560 const int numViewPoints = 10; 561 562 preprocessor->mViewCellsManager-> 563 GenerateRandomViewCells(mViewCellPoints, numViewCells, numViewPoints); 564 565 //cout << "exporting random view cells" << endl; 566 return preprocessor->mViewCellsManager->ExportRandomViewCells(filename, mViewCellPoints); 465 567 } 466 568 … … 473 575 int tries = 0; 474 576 Vector3 viewPoint, direction; 475 const int maxTries = 10 0;577 const int maxTries = 10; 476 578 477 579 while (1) … … 499 601 //halton.GenerateNext(); 500 602 501 //cout << "vp: " << viewPoint << endl;502 //cout << "dir: " << direction << endl;503 504 603 ViewCell *v = GetViewCell(viewPoint); 505 604 506 605 if (v && v->GetValid()) 507 606 { 508 //cout << "validating view point" << endl;509 510 607 mPreprocessor->GetRenderer()->mViewPoint = viewPoint; 511 608 mPreprocessor->GetRenderer()->mViewDirection = direction; 512 // preprocessor->renderer->EvalPvsStat();513 cout<<"*********hgere55"<<endl; 514 if ( preprocessor->renderer->ValidViewPoint())609 //mPreprocessor->GetRenderer()->EvalPvsStat(); 610 611 if (mPreprocessor->GetRenderer()->ValidViewPoint()) 515 612 { 516 cout << "view point valid "<< endl;613 cout << "view point valid " << viewPoint << " " << direction << endl; 517 614 break; 518 615 } 519 cout<<"here33"<<endl;616 520 617 } 521 618 … … 526 623 // cout << "error!" << endl; 527 624 if (++ tries > maxTries) 625 { 626 cerr << "error: no view point computed" << endl; 528 627 return false; 628 } 529 629 } 530 630 … … 584 684 else 585 685 { 586 cout << "error: invalid view cell " << generatedViewCells << " generated:" << viewCell->GetId() << endl;686 cout << "error: invalid view cell " << generatedViewCells << " with id " << viewCell->GetId() << endl; 587 687 } 588 688 } … … 615 715 616 716 DEL_PTR(mMixtureDistribution); 717 718 CLEAR_CONTAINER(mViewCellPoints); 617 719 } 618 720 … … 1005 1107 vm->FinalizeViewCells(true); 1006 1108 // vm->mViewCellsTree->AssignRandomColors(); 1109 } 1110 1111 if (0) 1112 { 1113 cout << "=============== " << vm->GetViewCellById(5318)->GetPvs().GetSize() << "========" << endl; 1007 1114 } 1008 1115 … … 2609 2716 2610 2717 2611 2612 2613 2718 int ViewCellsManager::GetNumViewCells() const 2614 2719 { … … 3540 3645 } 3541 3646 3647 3542 3648 void ViewCellsManager::UpdatePvsForEvaluation(ViewCell *root, ObjectPvs &pvs) 3543 3649 { -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h
r2021 r2048 541 541 vector<ViewCellPoints *> &viewCells); 542 542 543 bool ImportRandomViewCells(const string &filename); 543 544 544 545 bool ExportRandomViewCells(const string &filename, 545 546 const vector<ViewCellPoints *> &viewCells); 546 547 548 bool ExportRandomViewCells(const string &filename); 549 547 550 bool GenerateViewPoint(ViewCell *viewCell, SimpleRay &ray); 548 551 549 552 bool IsValidViewSpace(ViewCell *vc); 553 550 554 551 555 ////////////// … … 558 562 @param objects the scene objects 559 563 @param finalizeViewCells if the view cells should be post processed, i.e. 560 a mesh is created representing the geometry564 a mesh is created representing the geometry 561 565 @param bconverter a conversion routine working with the similarities of bounding 562 boxes: if there is a certain similarity of overlap between563 bounding boxes, two tested564 candidate objects are consideredto be the same objects566 boxes: if there is a certain similarity of overlap between 567 bounding boxes, two tested candidate objects are considered 568 to be the same objects 565 569 @returns the view cells manager if loading was successful, false otherwise 566 570 */ … … 575 579 576 580 // TODO: write own visibiltiy filter class 577 void ApplyFilter(KdTree *kdTree, 578 const float viewSpaceFilterSize, 579 const float spatialFilterSize); 580 581 // new adaptive version of the filter 582 PvsFilterStatistics 583 ApplyFilter2(ViewCell *viewCell, 584 const bool useViewSpaceFilter, 585 const float filterSize, 586 ObjectPvs &pvs, 587 vector<AxisAlignedBox3> *filteredBoxes = NULL); 581 void ApplyFilter(KdTree *kdTree, 582 const float viewSpaceFilterSize, 583 const float spatialFilterSize); 584 585 // new adaptive version of the filter 586 PvsFilterStatistics ApplyFilter2(ViewCell *viewCell, 587 const bool useViewSpaceFilter, 588 const float filterSize, 589 ObjectPvs &pvs, 590 vector<AxisAlignedBox3> *filteredBoxes = NULL); 588 591 589 592 void ApplySpatialFilter(KdTree *kdTree, … … 606 609 607 610 ////////////////////////////////////////////////////////////////// 611 608 612 609 613 /** If true, the kd nodes are stored instead of the object pvs. … … 635 639 636 640 637 void ViewCellsManager::ResetPvs();641 void ResetPvs(); 638 642 639 643 Preprocessor *GetPreprocessor() const { … … 643 647 void SetPreprocessor(Preprocessor *p) { 644 648 mPreprocessor = p; 649 } 650 651 vector<ViewCellPoints *> *GetViewCellPoints() 652 { 653 return &mViewCellPoints; 645 654 } 646 655 … … 741 750 void ExportMergedViewCells(const ObjectContainer &objects); 742 751 752 743 753 /////////////////////// 744 754 … … 746 756 */ 747 757 virtual float GetViewSpaceVolume(); 758 748 759 /** Prepares the view cells for sampling after loading them from disc. 749 760 */ 750 761 virtual void PrepareLoadedViewCells() {}; 762 751 763 /** Constructs local view cell merge hierarchy. 752 764 */ … … 755 767 756 768 /** Constructs local view cell merge hierarchy based solely on similarity with the 757 current viewcell769 current viewcell 758 770 */ 759 771 ViewCell *ConstructLocalMergeTree2(ViewCell *currentViewCell, … … 766 778 virtual void ExportStats(const string &mergeStats); 767 779 768 780 769 781 //////////////////////////////////////////////// 782 770 783 771 784 Preprocessor *mPreprocessor; … … 816 829 bool mCompressViewCells; 817 830 831 vector<ViewCellPoints *> mViewCellPoints; 832 818 833 /// holds the current view cell statistics 819 834 ViewCellsStatistics mCurrentViewCellsStats; 835 820 836 /// the scene bounding box 821 837 AxisAlignedBox3 mViewSpaceBox; … … 845 861 846 862 MixtureDistribution *mMixtureDistribution; 863 847 864 848 865 ////////////////// … … 1306 1323 ///////////////////////////////////////// 1307 1324 1308 1309 1325 bool mCompressObjects; 1310 1326 -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.cpp
r2017 r2048 64 64 static SAXParser::ValSchemes valScheme = SAXParser::Val_Auto; 65 65 66 66 #define PVS_HACK 1 67 67 68 68 inline static bool ilt(Intersectable *obj1, Intersectable *obj2) … … 393 393 394 394 395 void ViewCellsParseHandlers::ExchangePvs(ViewCell *vc) 396 { 397 //cout << "exchanging pvs" << endl; 398 399 sort(mBvhLeaves.begin(), mBvhLeaves.end(), ilt); 400 ObjectPvs newPvs; 401 402 ObjectPvsIterator pit = vc->GetPvs().GetIterator(); 403 404 BvhLeaf *dummyInst = new BvhLeaf(AxisAlignedBox3()); 405 406 ObjectContainer oldIntersectables; 407 // output PVS of view cell 408 while (pit.HasMoreEntries()) 409 { 410 ObjectPvsEntry entry = pit.Next(); 411 412 Intersectable *intersect = entry.mObject; 413 oldIntersectables.push_back(intersect); 414 415 DummyIntersectable *dummyIntersect = static_cast<DummyIntersectable *>(intersect); 416 417 const int objId = dummyIntersect->GetItem(); 418 dummyInst->SetId(objId); 419 420 vector<BvhLeaf *>::iterator oit = 421 lower_bound(mBvhLeaves.begin(), 422 mBvhLeaves.end(), 423 dummyInst, ilt); 424 425 if ((oit != mBvhLeaves.end()) && ((*oit)->GetId() == objId)) 426 { 427 // $$JB we should store a float a per object which corresponds 428 // to sumof pdfs, i.e. its relative visibility 429 // temporarily set to 1.0f 430 //cout << (*oit)->GetId() << " "; 431 432 newPvs.AddSample(*oit, 1.0f); 433 } 434 else 435 { 436 Debug << "error: object with id " << objId << " does not exist" << endl; 437 } 438 } 439 440 //newPvs.SimpleSort(); 441 delete dummyInst; 442 vc->SetPvs(newPvs); 443 444 CLEAR_CONTAINER(oldIntersectables); 445 } 446 447 448 void ViewCellsParseHandlers::ExchangeElements() 449 { 450 ViewCellContainer::const_iterator vit, vit_end = mViewCells.end(); 451 452 for (vit = mViewCells.begin(); vit != vit_end; ++ vit) 453 {//cout << "j"; 454 ExchangePvs(*vit); 455 } 456 } 457 458 395 459 void ViewCellsParseHandlers::StartViewCellHierarchyElement(const std::string &element, 396 460 AttributeList& attributes) … … 500 564 for (it = objIndices.begin(); it != it_end; ++ it) 501 565 { 566 #if PVS_HACK 567 //cout << "u"; 568 pvs.AddSample(new DummyIntersectable(*it), 1); 569 #else 502 570 const int objId = *it; 503 571 dummyInst.SetId(objId); … … 513 581 // to sumof pdfs, i.e. its relative visibility 514 582 // temporarily set to 1.0f 515 pvs.AddSample(*oit, 1.0f); 583 //cout << "r"; 584 585 pvs.AddSample(*oit, 1.0f); 516 586 } 517 587 else … … 519 589 Debug << "error: object with id " << objId << " does not exist" << endl; 520 590 } 591 #endif 521 592 } 522 593 } … … 839 910 } 840 911 if (attrName == "pvs") 841 { 912 {//cout <<"e"; 842 913 StrX attrValue(attributes.getValue(i)); 843 914 const char *ptr = attrValue.LocalForm(); … … 846 917 // otherwise view cell is undefined 847 918 848 StartViewCellPvs(viewCell->GetPvs(), ptr); // assume that view cell comes before pvs 919 // hack: assume that view cell comes before pvs 920 StartViewCellPvs(viewCell->GetPvs(), ptr); 849 921 //StartViewCellPvs(pvs, ptr); 850 922 } … … 1244 1316 1245 1317 leaf->mObjects = objects; 1246 BvHierarchy::AssociateObjectsWithLeaf(leaf); 1318 BvHierarchy::AssociateObjectsWithLeaf(leaf); 1319 1320 if (PVS_HACK) 1321 { 1322 if (1) // Temp matt: should HAVE right id 1323 { 1324 leaf->SetId((int)mBvhLeaves.size()); 1325 } 1326 mBvhLeaves.push_back(leaf); 1327 1328 //cout << "i"; 1329 } 1247 1330 } 1248 1331 … … 1263 1346 } 1264 1347 1265 //TODO: find objects and add them to pvs1266 // TODO: get view cell with specified id1267 1348 MeshInstance dummyInst(NULL); 1268 1349 … … 1424 1505 #else 1425 1506 parser->parse(filename.c_str()); 1507 1426 1508 #endif 1509 1510 if (PVS_HACK) 1511 handler.ExchangeElements(); 1427 1512 1428 1513 const unsigned long endMillis = XMLPlatformUtils::getCurrentMillis(); -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParserXerces.h
r2005 r2048 74 74 void CreateViewCellsManager(/*const char *name*/); 75 75 76 void ExchangeElements(); 77 void ExchangePvs(ViewCell *vc); 78 76 79 77 80 ///////////////////////// … … 94 97 VspNode *mVspRoot; 95 98 ViewCell *mViewCellRoot; 96 97 // typedef map<int, ViewCell *> ViewCellsMap; 99 int mUniqueObjectId; 100 vector<BvhLeaf *> mBvhLeaves; 101 //typedef map<int, ViewCell *> ViewCellsMap; 98 102 //ViewCellsMap mViewCells; 99 103 ViewCellContainer mViewCells; … … 119 123 int mViewSpaceHierarchyType; 120 124 int mObjectSpaceHierarchyType; 121 int nViewCells; 122 int nObjects; 125 int nViewCells; 126 int nObjects; 127 128 123 129 //////////////////////////////// 124 130 -
GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp
r2032 r2048 285 285 } 286 286 287 string viewCellsFile = ReplaceSuffix(filename, ".obj", ".vc"); 288 //viewCellsFile = ReplaceSuffix(filename, ".dat", ".vc"); 289 290 const int numViewCells = 5; 291 const int numViewPoints = 20; 287 string viewCellPointsFile; 288 289 if (strstr(filename.c_str(), ".obj")) 290 viewCellPointsFile = ReplaceSuffix(filename, ".obj", ".vc"); 291 else if (strstr(filename.c_str(), ".dat")) 292 viewCellPointsFile = ReplaceSuffix(filename, ".dat", ".vc"); 293 else if (strstr(filename.c_str(), ".x3d")) 294 viewCellPointsFile = ReplaceSuffix(filename, ".x3d", ".vc"); 295 296 bool importRandomViewCells; 297 Environment::GetSingleton()->GetBoolValue("ViewCells.importRandomViewCells", 298 importRandomViewCells); 299 300 if (importRandomViewCells) 301 { 302 cout << "importing random view cells" << endl; 303 preprocessor->mViewCellsManager->ImportRandomViewCells(viewCellPointsFile); 304 cout << "finished" << endl; 305 } 292 306 293 307 bool useHwGlobalLines; … … 377 391 } 378 392 379 vector<ViewCellPoints *> myViewCells; 380 381 preprocessor->mViewCellsManager->GenerateRandomViewCells(myViewCells, numViewCells, numViewPoints); 382 cout << "exporting random view cells" << endl; 383 preprocessor->mViewCellsManager->ExportRandomViewCells(viewCellsFile, myViewCells); 384 385 //preprocessor->mViewCellsManager->ImportRandomViewCells(viewCellsFile, myViewCells); 386 CLEAR_CONTAINER(myViewCells); 387 388 //preprocessor->renderer->EvalPvsStat(); 393 bool exportRandomViewCells; 394 Environment::GetSingleton()->GetBoolValue("ViewCells.exportRandomViewCells", 395 exportRandomViewCells); 396 397 if (exportRandomViewCells) 398 { 399 cout << "exporting random view cells" << endl; 400 preprocessor->mViewCellsManager->ExportRandomViewCells(viewCellPointsFile); 401 cout << "finished" << endl; 402 } 403 404 /*bool evaluatePixelError; 405 Environment::GetSingleton()->GetBoolValue("Preprocessor.evaluatePixelError", evaluatePixelError); 406 407 if (evaluatePixelError) 408 { 409 cout << "evaluating pixel error" << endl; 410 preprocessor->ComputeRenderError(); 411 }*/ 389 412 390 413 qApp->exec();
Note: See TracChangeset
for help on using the changeset viewer.