Changeset 2677 for GTP/trunk/Lib/Vis
- Timestamp:
- 05/14/08 19:06:06 (17 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/scripts/demo1.env
r2676 r2677 54 54 useGlDebugger false 55 55 # 0 = INTERNAL 1 = MLRT 56 rayCastMethod 056 rayCastMethod 1 57 57 58 58 # type sampling -
GTP/trunk/Lib/Vis/Preprocessing/scripts/gvs.env
r2643 r2677 34 34 detectEmptyViewSpace true 35 35 loadMeshes false 36 # internal raycaster 37 #rayCastMethod 0 38 # intel raycaster 36 37 # internal: 0 intel: 1 39 38 rayCastMethod 1 39 40 40 exportVisibility false 41 41 applyVisibilityFilter false -
GTP/trunk/Lib/Vis/Preprocessing/scripts/run_demo_vienna
r2676 r2677 4 4 export PATH=../bin:$PATH 5 5 6 #TARGET=debug7 TARGET=release8 9 10 6 #COMMAND="./release/preprocessor.exe -preprocessor_quit_on_finish+" 11 7 COMMAND="../scripts/preprocessor.sh -preprocessor_quit_on_finish- -preprocessor_use_gl_renderer+ -preprocessor_evaluate_filter- -samples_per_evaluation=5000000 -samples_per_pass=500000 -total_samples=100000000" 12 8 13 9 14 SCENE=../data/vienna/vienna_cropped.obj 15 #SCENE=../data/vienna/city_full.obj 10 #SCENE=../data/vienna/vienna_cropped.obj 11 SCENE=../data/vienna/city_full.obj 12 16 13 VIEWCELLS=../data/vienna/vienna_cropped-seq-3000-false-20-viewcells.xml.gz 17 14 #VIEWCELLS=../data/vienna/vienna_cropped-57000-viewcells.xml.gz 18 19 20 #SCENE=../data/Arena/arena-high-lods.obj21 SCENE=../data/Arena/arena_trees.obj22 #VIEWCELLS=../data/Arena/arena-high-lods-57000-viewcells.xml.gz23 #VIEWCELLS=../data/Arena/arena-high-lods-10000-viewcells.xml.gz24 VIEWCELLS=../data/Arena/arena-high-lods-5000-viewcells.xml.gz25 26 15 27 16 -
GTP/trunk/Lib/Vis/Preprocessing/scripts/run_gvs_vienna.sh
r2601 r2677 13 13 echo "starting $TARGET version" 14 14 15 SCENE=../data/vienna/vienna_cropped.obj 16 #VIEWCELLS=../data/vienna/vienna_cropped-seq-3000-false-20-viewcells.xml.gz 17 VIEWCELLS=../data/vienna/vienna_cropped-57000-viewcells.xml.gz 15 #SCENE=../data/vienna/vienna_cropped.obj 16 SCENE=../data/vienna/city_full.obj 17 18 #VIEWCELLS=../data/vienna/vienna_cropped-57000-viewcells.xml.gz 19 #VIEWCELLS=../data/vienna/vienna_cropped-gradient-viewcells.xml.gz 20 VIEWCELLS=../data/vienna/vienna_cropped-seq-3000-false-20-viewcells.xml.gz 21 18 22 19 23 LOG_PREFIX=../scripts/tests/sig2008 -
GTP/trunk/Lib/Vis/Preprocessing/scripts/run_gvs_vps.sh
r2676 r2677 11 11 echo "starting $TARGET version" 12 12 13 SCENE=../data/vienna/vienna_cropped.obj 13 #SCENE=../data/vienna/vienna_cropped.obj 14 SCENE=../data/vienna/city_full.obj 14 15 15 16 VIEWCELLS=../data/vienna/vienna_cropped-gradient-viewcells.xml.gz … … 27 28 -preprocessor=gvs \ 28 29 -gvs_epsilon=0.0001 \ 29 -gvs_total_samples=100000 \30 -gvs_samples_per_pass=100000 \30 -gvs_total_samples=1000000 \ 31 -gvs_samples_per_pass=1000000 \ 31 32 -gvs_initial_samples=16 \ 32 -gvs_max_viewcells= 1\33 -gvs_max_viewcells=20 \ 33 34 -gvs_min_contribution=50 \ 34 35 -gvs_per_viewcell=true \ -
GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp
r2671 r2677 993 993 ) 994 994 { 995 Make Current();995 MakeLive(); 996 996 997 997 if (mPixelBuffer == NULL) … … 1022 1022 } 1023 1023 1024 Done Current();1024 DoneLive(); 1025 1025 } 1026 1026 … … 1042 1042 GlRendererBuffer::EvalPvsStat() 1043 1043 { 1044 Make Current();1044 MakeLive(); 1045 1045 1046 1046 GlRenderer::EvalPvsStat(); 1047 1047 1048 Done Current();1049 //mRenderingFinished.wakeAll();1048 DoneLive(); 1049 // mRenderingFinished.wakeAll(); 1050 1050 } 1051 1051 … … 1053 1053 void GlRendererBuffer::EvalPvsStat(const SimpleRayContainer &viewPoints) 1054 1054 { 1055 Make Current();1055 MakeLive(); 1056 1056 1057 1057 GlRenderer::EvalPvsStat(viewPoints); 1058 1058 1059 Done Current();1059 DoneLive(); 1060 1060 } 1061 1061 … … 1478 1478 } 1479 1479 1480 1480 1481 bool GlRendererBuffer::ValidViewPoint() 1481 1482 { 1482 Make Current();1483 MakeLive(); 1483 1484 1484 1485 SetupProjection(GetWidth(), GetHeight()); … … 1486 1487 bool result = GlRenderer::ValidViewPoint(); 1487 1488 1488 Done Current();1489 DoneLive(); 1489 1490 1490 1491 return result; … … 1528 1529 float error = GetPixelError(pvsSize); 1529 1530 1530 1531 // emit UpdatePvsErrorItem(i,1532 // mPvsErrorBuffer[i]);1533 // swapBuffers();1534 1531 mPvsErrorBuffer[i].mError = error; 1535 1532 mPvsErrorBuffer[i].mPvsSize = pvsSize; 1536 1533 1537 cout<<"("<<i<<" ["<<mViewPoint<<"]["<<mViewDirection<<"] "<<mPvsErrorBuffer[i].mError<<")";1534 //cout<<"("<<i<<" ["<<mViewPoint<<"]["<<mViewDirection<<"] "<<mPvsErrorBuffer[i].mError<<")"; 1538 1535 } 1539 1536 … … 1603 1600 for (sit = viewPoints.begin(); sit != sit_end; ++ sit, ++ i) 1604 1601 { 1602 if ((i % 10) == 99) 1603 cout << "processed " << i << " view points " << endl; 1604 1605 1605 //cout << "\n\nvp: " << (*sit) << endl; 1606 1606 SimpleRay sray = *sit; -
GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.h
r2671 r2677 330 330 virtual int GetHeight() const = 0; 331 331 332 virtual void Make Current() = 0;333 virtual void Done Current() = 0;332 virtual void MakeLive() = 0; 333 virtual void DoneLive() = 0; 334 334 335 335 virtual bool ValidViewPoint(); -
GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.cpp
r2671 r2677 68 68 mGvsStatsStream.open(gvsStatsLog); 69 69 70 cout << "number of gvs samples per pass: " << mGvsSamplesPerPass << endl; 71 cout << "number of samples per pass: " << mSamplesPerPass << endl; 72 70 73 Debug << "Gvs preprocessor options" << endl; 71 74 Debug << "number of total samples: " << mTotalSamples << endl; 72 75 Debug << "number of initial samples: " << mInitialSamples << endl; 73 cout << "number of gvs samples per pass: " << mGvsSamplesPerPass << endl;74 cout << "number of samples per pass: " << mSamplesPerPass << endl;75 76 Debug << "threshold: " << mThreshold << endl; 76 77 Debug << "epsilon: " << mEps << endl; … … 804 805 mGenericStats2 = 0; 805 806 806 //while (mGvsStats.mPerViewCellSamples < mTotalSamples)807 807 while (1) 808 808 { … … 1223 1223 app << "#PvsCost\n" << (int)mPvsCost << endl; 1224 1224 1225 #if 0 1225 app << "#PerViewCellSamples\n" << mPerViewCellSamples << endl; 1226 app << "#RaysPerSec\n" << RaysPerSec() << endl; 1227 1226 1228 app << "#TotalPvs\n" << mTotalPvs << endl; 1227 1229 app << "#TotalTime\n" << mTotalTime << endl; 1228 app << "#RaysPerSec\n" << RaysPerSec() << endl;1229 1230 app << "#PerViewCellSamples\n" << mPerViewCellSamples << endl;1231 1230 app << "#TotalSamples\n" << mTotalSamples << endl; 1232 app << "#SamplesContri\n" << mTotalContribution << endl; 1231 1233 1232 app << "#TotalTrianglePvs\n" << mTotalTrianglePvs << endl; 1234 1233 1235 #endif 1236 1237 //app << "#ReverseSamples\n" << mReverseSamples << endl; 1238 //app << "#BorderSamples\n" << mBorderSamples << endl; 1239 1240 //app << "#Pass\n" << mPass << endl; 1241 //app << "#ScDiff\n" << mPassContribution << endl; 1242 //app << "#GvsRuns\n" << mGvsPass << endl; 1234 if (0) 1235 { 1236 app << "#ReverseSamples\n" << mReverseSamples << endl; 1237 app << "#BorderSamples\n" << mBorderSamples << endl; 1238 1239 app << "#Pass\n" << mPass << endl; 1240 app << "#ScDiff\n" << mPassContribution << endl; 1241 app << "#GvsRuns\n" << mGvsPass << endl; 1242 1243 app << "#SamplesContri\n" << mTotalContribution << endl; 1244 } 1243 1245 1244 1246 app << endl; … … 1261 1263 ProcessViewCell(); 1262 1264 1263 mGvsStats.mTrianglePvs = (int)mTrianglePvs.size(); 1264 mGvsStats.mTotalTrianglePvs += mGvsStats.mTrianglePvs; 1265 1266 //////// 1267 //-- stats 1268 1269 // compute pvs size using larger (bvh objects) 1270 // note: for kd pvs we had to do this during gvs computation 1265 1271 1266 1272 if (!mUseKdPvs) … … 1283 1289 1284 1290 mGvsStats.mPerViewCellPvs = (int)objectPvs.size(); 1291 mGvsStats.mPvsCost = 0; // todo objectPvs.EvalPvsCost(); 1285 1292 } 1286 1293 else … … 1289 1296 mGvsStats.mPvsCost = mCurrentViewCell->GetPvs().EvalPvsCost(); 1290 1297 1291 cout << "id: " << mCurrentViewCell->GetId() << " pvs cost: " 1292 << mGvsStats.mPvsCost << " pvs tri: " << mTrianglePvs.size() << endl; 1293 } 1294 1295 1296 //////// 1297 //-- stats 1298 1299 mGvsStats.mViewCells = mProcessedViewCells;//mPass; 1300 mGvsStats.mTotalPvs += mGvsStats.mPerViewCellPvs; 1301 mGvsStats.mTotalSamples += mGvsStats.mPerViewCellSamples; 1302 1298 } 1299 1300 mGvsStats.mTrianglePvs = (int)mTrianglePvs.size(); 1301 1303 1302 // timing 1304 1303 const long currentTime = GetTime(); 1305 1306 1304 mGvsStats.mTimePerViewCell = TimeDiff(startTime, currentTime) * 1e-3f; 1305 1306 1307 //////////////// 1308 // global values 1309 1310 mGvsStats.mViewCells = mProcessedViewCells;//mPass; 1311 mGvsStats.mTotalTrianglePvs += mGvsStats.mTrianglePvs; 1307 1312 mGvsStats.mTotalTime += mGvsStats.mTimePerViewCell; 1313 mGvsStats.mTotalPvs += mGvsStats.mPerViewCellPvs; 1314 mGvsStats.mTotalSamples += mGvsStats.mPerViewCellSamples; 1308 1315 1309 1316 mGvsStats.Stop(); 1310 1317 mGvsStats.Print(mGvsStatsStream); 1311 1318 1319 cout << "id: " << mCurrentViewCell->GetId() << " pvs cost: " 1320 << mGvsStats.mPvsCost << " pvs tri: " << mTrianglePvs.size() << endl; 1321 1322 1312 1323 mTrianglePvs.clear(); 1313 1324 } -
GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.h
r2669 r2677 74 74 ObjectContainer mKdPvs; 75 75 76 float RaysPerSec() const { if (!mTotalTime) return 0; return (float) mTotalSamples / mTotalTime* 1e-6f; }76 float RaysPerSec() const { if (!mTotalTime) return 0; return (float)(mTotalSamples / mTotalTime) * 1e-6f; } 77 77 78 78 void Print(ostream &app) const; -
GTP/trunk/Lib/Vis/Preprocessing/src/KdTree.cpp
r2643 r2677 1477 1477 1478 1478 KdLeaf *KdTree::ImportBinLeaf(IN_STREAM &stream, 1479 1480 1481 { 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 lower_bound(objects.begin(), objects.end(), (Intersectable *)&dummyInst, ilt);1500 1501 1502 leaf->mObjects.push_back(*oit);1503 1504 Debug << "error: object with id " << objId << " does not exist" << endl;1505 1506 1507 1479 KdInterior *parent, 1480 const ObjectContainer &objects) 1481 { 1482 int leafId = TYPE_LEAF; 1483 int objId = leafId; 1484 int size; 1485 1486 stream.read(reinterpret_cast<char *>(&size), sizeof(int)); 1487 KdLeaf *leaf = new KdLeaf(parent, size); 1488 1489 MeshInstance dummyInst(NULL); 1490 1491 // read object ids 1492 // note: this can also be done geometrically 1493 for (int i = 0; i < size; ++ i) 1494 { 1495 stream.read(reinterpret_cast<char *>(&objId), sizeof(int)); 1496 dummyInst.SetId(objId); 1497 1498 ObjectContainer::const_iterator oit = 1499 lower_bound(objects.begin(), objects.end(), (Intersectable *)&dummyInst, ilt); 1500 1501 if ((oit != objects.end()) && ((*oit)->GetId() == objId)) 1502 leaf->mObjects.push_back(*oit); 1503 else 1504 Debug << "error: object with id " << objId << " does not exist" << endl; 1505 } 1506 1507 return leaf; 1508 1508 } 1509 1509 -
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp
r2676 r2677 70 70 71 71 72 void QtGlRendererBuffer::Make Current()72 void QtGlRendererBuffer::MakeLive() 73 73 { 74 74 QGLPixelBuffer::makeCurrent(); … … 77 77 78 78 79 void QtGlRendererBuffer::Done Current()79 void QtGlRendererBuffer::DoneLive() 80 80 { 81 81 QGLPixelBuffer::doneCurrent(); … … 92 92 QGL::DepthBuffer | 93 93 QGL::DoubleBuffer | 94 QGL::Rgba 95 ) ),94 QGL::Rgba) 95 ), 96 96 GlRendererBuffer(sceneGraph, viewcells, tree) 97 97 { … … 99 99 //mUseVbos = false; 100 100 101 Make Current();101 MakeLive(); 102 102 glViewport(0, 0, w, h); 103 103 glMatrixMode(GL_PROJECTION); … … 109 109 110 110 InitGL(); 111 DoneCurrent(); 111 112 //mydynamicTexture = generateDynamicTexture(); 113 // bind the dynamic texture to the pbuffer - this is a no-op under X11 114 //bindToDynamicTexture(mydynamicTexture); 115 116 DoneLive(); 112 117 } 113 118 … … 133 138 float QtGlRendererBuffer::GetPixelError(int &pvsSize) 134 139 { 135 Make Current();140 MakeLive(); 136 141 137 142 if (0) … … 141 146 cout << "rgba: " << format().rgba() << endl; 142 147 cout << "double: " << format().doubleBuffer() << endl; 148 cout << "depth: " << format().depth() << endl; 149 cout << "gl:" << format().hasOpenGL() << endl; 150 cout << "dir:" << format().directRendering() << endl; 143 151 } 144 152 … … 249 257 pixelCount = query->GetQueryResult(); 250 258 251 pErrorPixels = ((float)pixelCount) / (GetWidth() * GetHeight()); 252 259 pErrorPixels = (float)pixelCount / (GetWidth() * GetHeight()); 260 261 // some error happened 253 262 if (pixelCount > 0) 254 263 { … … 265 274 266 275 char filename[256]; 267 sprintf(filename, "error-frame-%04d-%0.5f.png", mFrame, pErrorPixels); 276 //sprintf(filename, "error-frame-%04d-%0.5f.png", mFrame, pErrorPixels); 277 sprintf(filename, "error-frame-%04d-%04d.png", mFrame, pixelCount); 268 278 QImage im = toImage(); 269 279 string str = mSnapPrefix + filename; … … 306 316 glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); 307 317 308 Done Current();318 DoneLive(); 309 319 310 320 return pErrorPixels; … … 2399 2409 // bind the dynamic texture to the pbuffer - this is a no-op under X11 2400 2410 mRenderBuffer->bindToDynamicTexture(dynamicTexture); 2401 makeCurrent();2411 //makeCurrent(); 2402 2412 } 2403 2413 -
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.h
r2671 r2677 61 61 ~QtGlRendererBuffer() {} 62 62 63 virtual void Make Current();64 virtual void Done Current();63 virtual void MakeLive(); 64 virtual void DoneLive(); 65 65 66 66 virtual int GetWidth() const { return width(); } … … 75 75 int ComputePvs(ObjectContainer &objects, ObjectContainer &pvs) const; 76 76 77 unsigned int mydynamicTexture; 77 78 78 79 public: … … 311 312 312 313 public slots: 313 void UpdateDynamicObjects(); 314 315 void UpdateDynamicObjects(); 314 316 void UpdateAllPvs(); 315 317 void ComputeVisibility(); … … 516 518 mShowDistribution ^= 1; 517 519 518 std::cout << "b: " << (mShowDistribution & 1) << " " << (mShowDistribution & 2) << " " << (mShowDistribution & 4) << " " << (mShowDistribution & 8) << std::endl; 520 std::cout << "b: " 521 << (mShowDistribution & 1) << " " 522 << (mShowDistribution & 2) << " " 523 << (mShowDistribution & 4) << " " 524 << (mShowDistribution & 8) << std::endl; 519 525 } 520 526 -
GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor05.vcproj
r2676 r2677 153 153 <Tool 154 154 Name="VCLinkerTool" 155 AdditionalDependencies="xerces-c_2.lib glew32.lib zdll.lib zziplib.lib devil.lib glut32.lib OpenGL32.Lib glu32.lib Preprocessor05.lib RTScene.lib RTWorld.lib cg.lib cgGL.lib Qt 3Support4.lib QtTest4.lib QtGui4.lib QtInterface05.lib QtOpenGL4.lib QtCore4.lib qtmain.lib"155 AdditionalDependencies="xerces-c_2.lib glew32.lib zdll.lib zziplib.lib devil.lib glut32.lib OpenGL32.Lib glu32.lib Preprocessor05.lib RTScene.lib RTWorld.lib cg.lib cgGL.lib QtInterface05.lib QtGui4.lib QtOpenGL4.lib QtCore4.lib qtmain.lib" 156 156 OutputFile="../bin/$(ConfigurationName)/Preprocessor.exe" 157 157 LinkIncremental="1" -
GTP/trunk/Lib/Vis/Preprocessing/src/demo1.env
r2524 r2677 74 74 visibilityFile visibility.xml 75 75 loadMeshes false 76 loadKdTree 76 loadKdTree false 77 77 exportKdTree false 78 78 … … 169 169 170 170 KdTree { 171 pvsArea 5e- 4171 pvsArea 5e-5 172 172 sahUseFaces false 173 173 Termination { -
GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp
r2676 r2677 257 257 { 258 258 cout << "importing random view cells" << endl; 259 preprocessor->mViewCellsManager->ImportViewCellsList(viewCellPointsFile); 260 cout << "finished" << endl; 259 if (preprocessor->mViewCellsManager->ImportViewCellsList(viewCellPointsFile)) 260 cout << "successfully loaded " << viewCellPointsFile << endl; 261 else 262 cout << "error: file << " << viewCellPointsFile << " not found, generating random view points!" << endl; 261 263 } 262 264
Note: See TracChangeset
for help on using the changeset viewer.