- Timestamp:
- 05/18/08 00:30:13 (17 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/scripts/demo1.env
r2677 r2686 75 75 visibilityFile visibility.xml 76 76 loadMeshes false 77 loadKdTree 77 loadKdTree false 78 78 exportKdTree false 79 79 … … 177 177 maxCostRatio 0.98 178 178 ct_div_ci 0.5 179 maxNodes 50000 180 #500000 181 } 182 183 splitMethod spatialMedian 184 # splitMethod SAH 179 maxNodes 100000 180 } 181 182 # splitMethod spatialMedian 183 splitMethod SAH 185 184 splitBorder 0.01 186 185 } -
GTP/trunk/Lib/Vis/Preprocessing/scripts/run_demo_vienna
r2682 r2686 5 5 6 6 #COMMAND="./release/preprocessor.exe -preprocessor_quit_on_finish+" 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 "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 -view_cells_import_random_viewcells+" 8 8 9 9 10 SCENE=../data/vienna/vienna_cropped.obj11 #SCENE=../data/vienna/city_full.obj10 #SCENE=../data/vienna/vienna_cropped.obj 11 SCENE=../data/vienna/city_full.obj 12 12 13 VIEWCELLS=../data/vienna/vienna_cropped-seq-3000-false-20-viewcells.xml.gz 13 VIEWCELLS=../data/vienna/vienna_cropped-gradient-viewcells.xml.gz 14 #VIEWCELLS=../data/vienna/vienna_cropped-seq-3000-false-20-viewcells.xml.gz 14 15 #VIEWCELLS=../data/vienna/vienna_cropped-57000-viewcells.xml.gz 16 VIEWPOINTS=../data/vienna/change.vp 15 17 16 18 … … 24 26 25 27 DISTRIBUTIONS=mutation+object_direction+spatial 28 #DISTRIBUTIONS=spatial 26 29 27 30 $COMMAND -preprocessor=combined \ … … 32 35 -preprocessor_visibility_file=$PREFIX-i-mixed-b1-n4a.xml \ 33 36 -preprocessor_stats=$PREFIX-i-mixed-b1-n4a.log \ 37 -preprocessor_detect_empty_viewspace- \ 34 38 -preprocessor_histogram_file=$PREFIX-i-mixed-b1-n4a.hlog \ 39 -view_cells_random_viewpoint_list=$VIEWPOINTS \ 35 40 demo1.env 36 41 -
GTP/trunk/Lib/Vis/Preprocessing/src/AxisAlignedBox3.cpp
r2609 r2686 2482 2482 } 2483 2483 2484 } 2485 2484 2485 void AxisAlignedBox3::ClampToBox(Vector3 &pt) const 2486 { 2487 if (pt.x > mMax.x) pt.x = mMax.x; 2488 if (pt.y > mMax.y) pt.y = mMax.y; 2489 if (pt.z > mMax.z) pt.z = mMax.z; 2490 2491 if (pt.x < mMin.x) pt.x = mMin.x; 2492 if (pt.y < mMin.y) pt.y = mMin.y; 2493 if (pt.z < mMin.z) pt.z = mMin.z; 2494 } 2495 2496 } 2497 -
GTP/trunk/Lib/Vis/Preprocessing/src/AxisAlignedBox3.h
r2575 r2686 81 81 float SqrRadius() const { return 0.5f*SqrMagnitude(Size()); } 82 82 83 /** Clamps the point to the box. 84 */ 85 void ClampToBox(Vector3 &pt) const; 86 83 87 // Return whether the box is unbounded. Unbounded boxes appear 84 88 // when unbounded objects such as quadric surfaces are included. -
GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp
r2647 r2686 1694 1694 "view_cells_import_random_viewcells", 1695 1695 "false"); 1696 1697 RegisterOption("ViewCells.randomViewPointsList", 1698 optString, 1699 "view_cells_random_viewpoint_list=", 1700 ""); 1701 1696 1702 1697 1703 RegisterOption("ViewCells.exportRandomViewCells", -
GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp
r2685 r2686 90 90 mSceneGraph->CollectObjects(mObjects); 91 91 92 #if 1 93 viewCellsManager->GetViewPoint(mViewPoint); 94 mViewDirection = Vector3(0,0,1); 95 #else 96 97 // for sg snapshot 98 mViewPoint = Vector3(32.8596, 9.86079, -1023.79); 99 mViewDirection = Vector3(-0.92196, 0, 0.387286); 100 101 // inside 102 mViewPoint = Vector3(14.1254, 10.9818, -1032.75); 103 mViewDirection = Vector3(-0.604798, 0, 0.796379); 104 105 // outside 106 mViewPoint = Vector3(35.092, 17.7078, -857.966); 107 mViewDirection = Vector3(-0.411287, 0, -0.911506); 108 109 // strange viewcell for error measurements (id 534) 110 mViewPoint = Vector3(1405.9, 218.284, -736.785); 111 mViewDirection = Vector3(0.989155, 0, 0.146877); 112 113 #endif 92 if (0) 93 { 94 viewCellsManager->GetViewPoint(mViewPoint); 95 mViewDirection = Vector3(0,0,1); 96 } 97 else 98 { 99 100 // for sg snapshot 101 mViewPoint = Vector3(32.8596, 9.86079, -1023.79); 102 mViewDirection = Vector3(-0.92196, 0, 0.387286); 103 104 // inside 105 mViewPoint = Vector3(14.1254, 10.9818, -1032.75); 106 mViewDirection = Vector3(-0.604798, 0, 0.796379); 107 108 // outside 109 mViewPoint = Vector3(35.092, 17.7078, -857.966); 110 mViewDirection = Vector3(-0.411287, 0, -0.911506); 111 112 // strange viewcell for error measurements (id 534) 113 mViewPoint = Vector3(1405.9, 218.284, -736.785); 114 mViewDirection = Vector3(0.989155, 0, 0.146877); 115 116 // high error for city_full 117 mViewPoint = Vector3(842.521, 194.708, -136.708); 118 mViewDirection = Vector3(0.730514, 0, -0.682897); 119 120 // also high error for city_full 121 mViewPoint = Vector3(1038.7f, 192.4f, -471.0f); 122 mViewDirection = Vector3(-0.8f, 0.0f, -0.6f); 123 } 114 124 115 125 mFrame = 0; … … 118 128 mDetectEmptyViewSpace); 119 129 120 mSnapErrorFrames = false;121 //mSnapErrorFrames = true;130 //mSnapErrorFrames = false; 131 mSnapErrorFrames = true; 122 132 123 133 mSnapPrefix = "snap/"; … … 1532 1542 1533 1543 static bool first = true; 1544 1534 1545 if (first) { 1535 1536 1546 1537 1547 bool exportRandomViewCells; … … 1900 1910 TriangleIntersectable *obj = static_cast<TriangleIntersectable *>(leaf->mGeometry[i]); 1901 1911 1912 if (obj->GetId() != i) 1913 cerr << "****\n****riesenfehler" << endl; 1902 1914 Triangle3 tri = obj->GetItem(); 1903 1915 const Vector3 n = tri.GetNormal(); … … 1916 1928 } 1917 1929 1930 cout << "\n******** created vertex arrays **********" << endl; 1931 1918 1932 if (mUseVbos) 1919 1933 { … … 1933 1947 delete [] mData; 1934 1948 mData = NULL; 1935 } 1936 1937 cout << "\n******** created vertex buffer objects **********" << endl;1949 1950 cout << "\n******** created vertex buffer objects **********" << endl; 1951 } 1938 1952 } 1939 1953 -
GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.h
r2677 r2686 212 212 Vector3 GetViewPoint() const { return mViewPoint; } 213 213 214 bool GetUseVbos() const { return mUseVbos; } 215 214 216 215 217 public: … … 245 247 void RenderKdLeaf(KdLeaf *leaf); 246 248 247 249 248 250 ////////////////// 249 251 -
GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.cpp
r2677 r2686 226 226 mTrianglePvs.push_back(obj); 227 227 228 mGenericStats = mTrianglePvs.size();228 mGenericStats = (int)mTrianglePvs.size(); 229 229 230 230 // exchange the triangle with the node in the pvs for kd pvs … … 971 971 972 972 ComputeViewCell(vc); 973 // $$ JB HACK compute just first viewcell974 // break;975 973 } 976 974 } … … 979 977 void GvsPreprocessor::PerViewCellComputation2() 980 978 { 981 ViewCell *vc;982 983 979 while (1) 984 980 { … … 1138 1134 // provide list of view cells to compute 1139 1135 CompileViewCellsList(); 1136 1140 1137 // start per view cell gvs 1141 1138 PerViewCellComputation(); -
GTP/trunk/Lib/Vis/Preprocessing/src/HavranRayCaster.cpp
r2662 r2686 392 392 #ifdef USE_HAVRAN_RAYCASTER 393 393 394 int hit_triangles[16];395 float dist[16];394 //int hit_triangles[16]; 395 //float dist[16]; 396 396 Vector3 normals[16]; 397 397 Vector3 min = sbox.Min(); … … 400 400 int packets = rays.size() / 16; 401 401 402 int i, j,k = 0;402 int i, k = 0; 403 403 Vector3 dir; 404 404 … … 413 413 414 414 for (; k < rays.size(); k++) { 415 double normal[3];415 //double normal[3]; 416 416 mKtbtree->FindNearestI(rays[k]); 417 417 // ??? What to do with the results ? These are -
GTP/trunk/Lib/Vis/Preprocessing/src/Mutation.cpp
r2606 r2686 186 186 float importance = 1.0f; 187 187 if (mUsePassImportance) 188 importance = 1.0f/(pContributingRays + 1e-5 );188 importance = 1.0f/(pContributingRays + 1e-5f); 189 189 // set this values for last contributingRays 190 190 int index = mBufferStart - 1; -
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp
r2685 r2686 30 30 31 31 #include <QVBoxLayout> 32 static GLint cubeArray[][3] = { 33 {0, 0, 0}, {0, 1, 0}, {1, 1, 0}, {1, 0, 0}, 34 {0, 0, 1}, {1, 0, 1}, {1, 1, 1}, {0, 1, 1}, 35 {0, 0, 0}, {1, 0, 0}, {1, 0, 1}, {0, 0, 1}, 36 {0, 1, 0}, {0, 1, 1}, {1, 1, 1}, {1, 1, 0}, 37 {0, 1, 0}, {0, 0, 0}, {0, 0, 1}, {0, 1, 1}, 38 {1, 0, 0}, {1, 1, 0}, {1, 1, 1}, {1, 0, 1} 39 }; 40 41 static GLint cubeTextureArray[][2] = { 42 {0, 0}, {1, 0}, {1, 1}, {0, 1}, 43 {0, 0}, {0, 1}, {1, 1}, {1, 0}, 44 {0, 0}, {1, 0}, {1, 1}, {0, 1}, 45 {1, 0}, {0, 0}, {0, 1}, {1, 1}, 46 {0, 0}, {1, 0}, {1, 1}, {0, 1}, 47 {1, 0}, {0, 0}, {0, 1}, {1, 1} 48 }; 49 50 static GLint faceArray[][2] = { 51 {1, -1}, {1, 1}, {-1, 1}, {-1, -1} 52 }; 53 54 static GLubyte colorArray[][4] = { 55 {170, 202, 0, 255}, 56 {120, 143, 0, 255}, 57 {83, 102, 0, 255}, 58 {120, 143, 0, 255} 59 }; 60 61 32 33 34 using namespace std; 62 35 63 36 … … 79 52 80 53 54 static SimpleRayContainer sViewPointsList; 55 static SimpleRayContainer::const_iterator sViewPointsListIt; 56 57 81 58 82 59 static inline bool ilt(Intersectable *obj1, Intersectable *obj2) … … 99 76 } 100 77 #endif 101 102 103 void QtGlRendererBuffer::dummyBuffer()104 {105 //QGLPixelBuffer *dummy = new QGLPixelBuffer(QSize(256, 256), format(), this);106 107 // set up the pbuffer context108 makeCurrent();109 110 glEnableClientState(GL_VERTEX_ARRAY);111 glEnableClientState(GL_TEXTURE_COORD_ARRAY);112 glVertexPointer(3, GL_INT, 0, cubeArray);113 glTexCoordPointer(2, GL_INT, 0, cubeTextureArray);114 glColorPointer(4, GL_UNSIGNED_BYTE, 0, colorArray);115 116 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);117 glEnable(GL_BLEND);118 glEnable(GL_TEXTURE_2D);119 glEnable(GL_DEPTH_TEST);120 121 glClearColor(1.0f, 1.0f, 1.0f, 1.0f);122 123 glViewport(0, 0, size().width(), size().height());124 glMatrixMode(GL_PROJECTION);125 glLoadIdentity();126 glOrtho(-1, 1, -1, 1, -99, 99);127 glTranslatef(-0.5f, -0.5f, 0.0f);128 glMatrixMode(GL_MODELVIEW);129 glLoadIdentity();130 131 132 glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);133 134 // draw cube background135 glPushMatrix();136 glLoadIdentity();137 glTranslatef(0.5f, 0.5f, -2.0f);138 glDisable(GL_TEXTURE_2D);139 glEnableClientState(GL_COLOR_ARRAY);140 glVertexPointer(2, GL_INT, 0, faceArray);141 glDrawArrays(GL_QUADS, 0, 4);142 glVertexPointer(3, GL_INT, 0, cubeArray);143 glDisableClientState(GL_COLOR_ARRAY);144 glEnable(GL_TEXTURE_2D);145 glPopMatrix();146 147 // draw cube148 glTranslatef(0.5f, 0.5f, 0.5f);149 glRotatef(3.0f, 1.0f, 1.0f, 1.0f);150 glTranslatef(-0.5f, -0.5f, -0.5f);151 glColor4f(0.9f, 0.9f, 0.9f, 1.0f);152 glDrawArrays(GL_QUADS, 0, 24);153 154 QImage im = toImage();155 QString qstr("test.png");156 157 im.save(qstr, "PNG");158 159 doneCurrent();160 }161 78 162 79 … … 210 127 { 211 128 EnableDrawArrays(); 129 130 // prepare pvs for rendering 212 131 PreparePvs(pvs); 213 132 … … 348 267 pErrorPixels = (float)pixelCount / (GetWidth() * GetHeight()); 349 268 269 const int pixelThres = 100000; 270 350 271 // some error happened 351 if (pixelCount > 0)352 { 353 cout << "frame " << mFrame << " vc id: " << viewcell->GetId() << " pvs: " << pvsSize << " pc: " << pixelCount << endl;272 if (pixelCount > pixelThres) 273 { 274 cout << "frame " << mFrame << " vc id: " << viewcell->GetId() << " pvs: " << pvsSize << " pc: " << pixelCount << " vp: " << mViewPoint << endl; 354 275 355 276 if (mSnapErrorFrames) … … 611 532 { 612 533 Intersectable *obj = it.Next(); 534 613 535 switch (obj->Type()) 614 536 { … … 620 542 break; 621 543 #if DYNAMIC_OBJECTS_HACK 622 #if USE_TRANSFORMED_MESH_INSTANCE_HACK 623 624 case Intersectable::TRANSFORMED_MESH_INSTANCE: 625 mDynamicObjects.push_back(static_cast<TransformedMeshInstance *>(obj)); 626 break; 627 628 #else 544 629 545 case Intersectable::SCENEGRAPHLEAF_INTERSECTABLE: 630 546 mDynamicObjects.push_back(static_cast<SceneGraphLeafIntersectable *>(obj)->GetItem()); 631 547 break; 632 #endif633 548 #endif 634 549 default: … … 660 575 if (viewcell) 661 576 { 662 #if 0577 #if 1 663 578 // copy the pvs so that it can be filtered ... 664 579 if (PvsChanged(viewcell)) … … 689 604 PreparePvs(mPvsCache.mPvs); 690 605 emit PvsUpdated(); 606 691 607 mCurrentPvsCost = mPvsCache.mPvs.EvalPvsCost(); 692 608 } 693 609 #else 694 610 611 // update the indices for rendering 695 612 PreparePvs(viewcell->GetPvs()); 696 613 emit PvsUpdated(); … … 721 638 mWireFrame = false; 722 639 } 723 mCurrentPvsCost = viewcell->GetPvs().EvalPvsCost(); 640 641 //mCurrentPvsCost = viewcell->GetPvs().EvalPvsCost(); 724 642 } 725 643 else … … 797 715 798 716 799 void QtGlRendererWidget::timerEvent(QTimerEvent *event) 800 { 801 //std::cout << "Timer ID:" << event->timerId(); 802 update(); 717 void QtGlRendererWidget::timerEvent(QTimerEvent *timerEvent) 718 { 719 if (mReplayMode && (timerEvent->timerId() == mReplayTimerId)) 720 { 721 if (sViewPointsListIt == sViewPointsList.end()) 722 { 723 cout << "stopping replay" << endl; 724 mReplayMode = false; 725 } 726 else 727 { 728 SimpleRay sray = *sViewPointsListIt; 729 730 mViewPoint = sray.mOrigin; 731 mViewDirection = sray.mDirection; 732 733 ++ sViewPointsListIt; 734 } 735 736 737 updateGL(); 738 } 739 740 if (timerEvent->timerId() == mUpdateTimerId) 741 update(); 803 742 } 804 743 … … 826 765 QtGlRendererWidget::mouseMoveEvent(QMouseEvent *e) 827 766 { 767 if (mReplayMode) 768 return; 769 828 770 float MOVE_SENSITIVITY = Magnitude(mSceneGraph->GetBox().Diagonal())*1e-3; 829 771 float TURN_SENSITIVITY = 0.1f; … … 838 780 839 781 const float t = 1.0f; 840 841 782 if (e->modifiers() & Qt::ControlModifier) 842 783 { … … 1079 1020 mComputeGVS = false; 1080 1021 mUseRandomColorPerPvsObject = false; 1022 //mUseRandomColorPerPvsObject = true; 1081 1023 1082 1024 mHideByCost = false; … … 1087 1029 1088 1030 const int delay = 250; // in milliseconds 1089 timerId = startTimer(delay); 1031 mUpdateTimerId = startTimer(delay); 1032 mReplayTimerId = startTimer(1); // use fastest replay rate 1090 1033 1091 1034 bool tmp; … … 1121 1064 mShowRays = false; 1122 1065 1066 mReplayMode = false; 1067 1123 1068 SetSceneCut(1000); 1124 1069 mControlWidget = new QtRendererControlWidget(NULL); … … 1133 1078 connect(mControlWidget, SIGNAL(StoreStatistics(void)), this, SLOT(StoreStatistics(void))); 1134 1079 connect(mControlWidget, SIGNAL(ComputeGVS(void)), this, SLOT(ComputeGVS(void))); 1080 connect(mControlWidget, SIGNAL(ReplayViewPoints(void)), this, SLOT(ReplayViewPoints(void))); 1135 1081 connect(mControlWidget, SIGNAL(LoadObject(void)), this, SLOT(LoadObject(void))); 1136 1082 … … 2303 2249 connect(cb, SIGNAL(toggled(bool)), SIGNAL(SetRenderFilter(bool))); 2304 2250 2305 2306 2251 /*vbox = new QGroupBox("PVS Errors", this); 2307 2252 layout()->addWidget(vbox); … … 2328 2273 #endif 2329 2274 2275 #if 0 2276 2330 2277 button = new QPushButton("Compute GVS", vbox); 2331 2278 vbox->layout()->addWidget(button); 2332 2279 connect(button, SIGNAL(clicked()), SIGNAL(ComputeGVS())); 2280 2281 #else 2282 2283 button = new QPushButton("Replay view points", vbox); 2284 vbox->layout()->addWidget(button); 2285 connect(button, SIGNAL(clicked()), SIGNAL(ReplayViewPoints())); 2286 2287 #endif 2333 2288 2334 2289 #if DYNAMIC_OBJECTS_HACK … … 2410 2365 // create the pbuffer 2411 2366 //pbuffer = new QGLPixelBuffer(QSize(512, 512), format(), this); 2412 timerId = startTimer(20);2367 //mUpdateTimerId = startTimer(20); 2413 2368 setWindowTitle(("OpenGL pbuffers")); 2414 2369 } … … 2514 2469 while (it.HasMoreEntries()) 2515 2470 { 2516 Intersectable *obj ect= it.Next(pvsData);2471 Intersectable *obj = it.Next(pvsData); 2517 2472 2518 2473 RgbColor color; 2519 2474 2520 //float visibility = mTransferFunction*log10(entry.mData.mSumPdf + 1); // /5.0f2521 // glColor3f(visibility, 0.0f, 0.0f);2522 2475 //cerr << "sumpdf: " << pvsData.mSumPdf << endl; 2523 2476 if (mUseRandomColorPerPvsObject) 2524 2477 { 2525 KdIntersectable *kdint = static_cast<KdIntersectable *>(obj ect);2478 KdIntersectable *kdint = static_cast<KdIntersectable *>(obj); 2526 2479 2527 2480 if (kdint->mGenericIdx == -1) 2528 2481 { 2529 2482 kdint->mGenericIdx = (int)mColors.size(); 2530 mColors.push_back(RandomColor( ));2483 mColors.push_back(RandomColor(0, 1)); 2531 2484 } 2532 2485 color = mColors[kdint->mGenericIdx]; … … 2540 2493 2541 2494 mUseForcedColors = true; 2542 RenderIntersectable(obj ect);2495 RenderIntersectable(obj); 2543 2496 mUseForcedColors = false; 2544 2497 } 2545 2498 } 2546 2499 2547 void 2548 QtGlRendererWidget::UpdateDynamicObjects() 2549 { 2550 preprocessor->ScheduleUpdateDynamicObjects(); 2551 2552 } 2553 2554 } 2500 2501 void QtGlRendererWidget::UpdateDynamicObjects() 2502 { 2503 preprocessor->ScheduleUpdateDynamicObjects(); 2504 } 2505 2506 2507 void QtGlRendererWidget::ReplayViewPoints() 2508 { 2509 ViewCellPointsList *vcPoints = mViewCellsManager->GetViewCellPointsList(); 2510 2511 ViewCellPointsList::const_iterator vit, vit_end = vcPoints->end(); 2512 2513 sViewPointsList.clear(); 2514 2515 for (vit = vcPoints->begin(); vit != vit_end; ++ vit) 2516 { 2517 ViewCellPoints *vp = *vit; 2518 2519 SimpleRayContainer::const_iterator rit, rit_end = vp->second.end(); 2520 2521 for (rit = vp->second.begin(); rit != rit_end; ++ rit) 2522 { 2523 sViewPointsList.push_back(*rit); 2524 } 2525 } 2526 2527 if (!sViewPointsList.empty()) 2528 { 2529 cout << "replaying " << (int)sViewPointsList.size() << " view points " << endl; 2530 2531 mReplayMode = true; 2532 sViewPointsListIt = sViewPointsList.begin(); 2533 } 2534 } 2535 2536 } -
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.h
r2679 r2686 75 75 int ComputePvs(ObjectContainer &objects, ObjectContainer &pvs) const; 76 76 77 unsigned int mydynamicTexture; 78 void dummyBuffer(); 77 79 78 public: 80 79 … … 107 106 108 107 signals: 108 109 void ReplayViewPoints(); 109 110 void UpdateDynamicObjects(); 110 111 void ComputeVisibility(); … … 195 196 float mSpatialFilterSize; 196 197 197 //LogWriter *mLogWriter;198 198 Plane3 mSceneCutPlane; 199 199 float mHidingCost; … … 213 213 214 214 int mCurrentDynamicObjectIdx; 215 216 bool mReplayMode; 215 217 216 218 // some statistics … … 236 238 237 239 bool mUseRandomColorPerPvsObject; 240 241 int mUpdateTimerId; 242 int mReplayTimerId; 238 243 239 244 #if DYNAMIC_OBJECTS_HACK … … 281 286 virtual int GetHeight() const { return height(); } 282 287 283 virtual void 284 SetupCameraProjection(const int w, const int h, const float angle = 70.0f); 288 virtual void SetupCameraProjection(const int w, 289 const int h, 290 const float angle = 70.0f); 285 291 286 292 void RenderViewCells(); … … 303 309 304 310 void AssignColorByComparison(const ViewCellContainer &viewcells, 305 //const ViewCellInfoContainer &info1,306 311 const ViewCellInfoContainer &compareInfo); 307 312 308 313 void WriteViewCellInfos(); 309 314 310 311 ///////// 312 //QMutex mMutex; 313 315 314 316 315 317 public slots: 316 318 319 /** Replay the view points stored in the view points list. 320 */ 321 void ReplayViewPoints(); 317 322 void UpdateDynamicObjects(); 318 323 void UpdateAllPvs(); … … 553 558 } 554 559 555 560 556 561 /** Prepare pvs for rendering. 557 562 */ … … 565 570 566 571 float ComputeRenderCost(ViewCell *vc); 567 568 572 569 573 -
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlViewer.cpp
r2670 r2686 67 67 GLfloat mat_shininess[] = { 1.0 }; 68 68 69 GLfloat light_ambient[] = { 0.2 , 0.2, 0.2, 1.0};70 GLfloat light_diffuse[] = { 0.4 , 0.4, 0.4, 1.0};71 GLfloat light_specular[] = { 0.3 , 0.3, 0.3, 1.0};72 73 GLfloat lmodel_ambient[] = {0.3 , 0.3, 0.3, 1.0};69 GLfloat light_ambient[] = { 0.2f, 0.2f, 0.2f, 1.0f }; 70 GLfloat light_diffuse[] = { 0.4f, 0.4f, 0.4f, 1.0f }; 71 GLfloat light_specular[] = { 0.3f, 0.3f, 0.3f, 1.0f }; 72 73 GLfloat lmodel_ambient[] = {0.3f, 0.3f, 0.3f, 1.0f}; 74 74 75 75 -
GTP/trunk/Lib/Vis/Preprocessing/src/RandomViewCellsHandler.cpp
r2648 r2686 136 136 137 137 ViewCellPoints *currentViewCell = NULL; 138 int i = 0; 139 int j = 0;138 139 AxisAlignedBox3 bbox = mViewCellsManager->GetViewSpaceBox(); 140 140 141 141 string buf; … … 152 152 currentViewCell->first = mViewCellsManager->GetViewCellById(id); 153 153 154 if (1)//i ++ < 5) 155 { 156 viewCells.push_back(currentViewCell); 157 j = 0; 158 } 154 viewCells.push_back(currentViewCell); 155 159 156 break; 160 157 } … … 164 161 sscanf(buf.c_str(), "p %f %f %f %f %f %f", &pt.x, &pt.y, &pt.z, &dir.x, &dir.y, &dir.z); 165 162 163 if (0) 164 { 165 // add new point to view space box 166 if (!bbox.IsInside(pt)) 167 bbox.Include(pt); 168 } 169 else 170 { 171 // other variant: clamp to box 172 bbox.ClampToBox(pt); 173 } 174 166 175 SimpleRay ray(pt, dir, 0, 1); 167 176 168 if (1)//j ++ < 5) 169 currentViewCell->second.push_back(ray); 177 // no view cell specified => create dummy view cell 178 if (!currentViewCell) 179 { 180 currentViewCell = new ViewCellPoints(); 181 viewCells.push_back(currentViewCell); 182 currentViewCell->first = NULL; 183 } 184 185 currentViewCell->second.push_back(ray); 170 186 171 187 break; … … 175 191 } 176 192 } 193 194 // set updated view space box containing all view points 195 mViewCellsManager->SetViewSpaceBox(bbox); 177 196 178 197 return true; -
GTP/trunk/Lib/Vis/Preprocessing/src/ReverseGvs.cpp
r2584 r2686 175 175 float importance = 1.0f; 176 176 if (mUsePassImportance) 177 importance = 1.0f/(pContributingRays + 1e-5 );177 importance = 1.0f/(pContributingRays + 1e-5f); 178 178 // set this values for last contributingRays 179 179 int index = mBufferStart - 1; -
GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor05.vcproj
r2685 r2686 157 157 LinkIncremental="1" 158 158 AdditionalLibraryDirectories=""$(QTDIR)\lib";..\src\GL;"..\lib05\$(ConfigurationName)";..\..\..\..\..\..\NonGTP\Boost\lib;..\..\..\..\..\..\NonGTP\Zlib\lib;..\..\..\..\..\..\NonGTP\Devil\lib;"..\MultiLevelRayTracing\RTScene\$(ConfigurationName)";"..\MultiLevelRayTracing\RTWorld\$(ConfigurationName)";"QtInterface\$(ConfigurationName)";"..\..\..\..\..\..\NonGTP\Xerces\xerces-c_2_8_0\lib";"$(CG_LIB_PATH)"" 159 GenerateDebugInformation=" false"159 GenerateDebugInformation="true" 160 160 SubSystem="1" 161 161 LargeAddressAware="2" -
GTP/trunk/Lib/Vis/Preprocessing/src/havran/ktball.cpp
r2629 r2686 462 462 stack[stackTop].depth = 0; 463 463 stack[stackTop].bbox = bbox; 464 int tmpdir;464 //int tmpdir; 465 465 #ifdef __TAGGED_KDR 466 466 int taggedLists = 0; -
GTP/trunk/Lib/Vis/Preprocessing/src/havran/ktbs.cpp
r2632 r2686 189 189 CKTBSBuildUp::ProvideID(ostream &app) 190 190 { 191 bool tempvar;191 //bool tempvar; 192 192 193 193 string termCrit; -
GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp
r2681 r2686 59 59 60 60 61 static string GetViewPointsListName(const string &filename) 62 { 63 string viewCellPointsFile; 64 65 char buff[200]; 66 Environment::GetSingleton()->GetStringValue("ViewCells.randomViewPointsList", buff); 67 68 string vpList(buff); 69 70 if (vpList == "") 71 { 72 // if not specified, take file that has same prefix as scene file 73 if (strstr(filename.c_str(), ".obj")) 74 viewCellPointsFile = ReplaceSuffix(filename, ".obj", ".vc"); 75 else if (strstr(filename.c_str(), ".dat")) 76 viewCellPointsFile = ReplaceSuffix(filename, ".dat", ".vc"); 77 else if (strstr(filename.c_str(), ".x3d")) 78 viewCellPointsFile = ReplaceSuffix(filename, ".x3d", ".vc"); 79 } 80 else 81 { 82 viewCellPointsFile = vpList; 83 } 84 85 return viewCellPointsFile; 86 } 87 61 88 62 89 void Cleanup() … … 240 267 cout << "view cells successfully loaded" << endl; 241 268 242 string viewCellPointsFile; 243 244 if (strstr(filename.c_str(), ".obj")) 245 viewCellPointsFile = ReplaceSuffix(filename, ".obj", ".vc"); 246 else if (strstr(filename.c_str(), ".dat")) 247 viewCellPointsFile = ReplaceSuffix(filename, ".dat", ".vc"); 248 else if (strstr(filename.c_str(), ".x3d")) 249 viewCellPointsFile = ReplaceSuffix(filename, ".x3d", ".vc"); 269 270 const string viewCellPointsFile = GetViewPointsListName(filename); 250 271 251 272 bool importRandomViewCells; 252 Environment::GetSingleton()->GetBoolValue("ViewCells.importRandomViewCells", 253 importRandomViewCells); 273 Environment::GetSingleton()->GetBoolValue("ViewCells.importRandomViewCells", importRandomViewCells); 254 274 255 275 if (importRandomViewCells) 256 276 { 257 cout << "importing random view cells" << endl; 277 cout << "importing random view points" << endl; 278 258 279 if (preprocessor->mViewCellsManager->ImportViewCellsList(viewCellPointsFile)) 259 280 cout << "successfully loaded " << viewCellPointsFile << endl; 260 281 else 261 cerr << "error: file << " << viewCellPointsFile << " not found , generating random view points!" << endl;282 cerr << "error: file << " << viewCellPointsFile << " not found" << endl; 262 283 } 263 284 … … 369 390 //rendererWidget->SetWindowTitle("Global Visualization"); 370 391 371 if ( 1) //not working with vbo392 if (0 && !rendererWidget->GetUseVbos()) // viewer not working with vbo 372 393 { 373 394 cout << "starting the qt viewer" << endl;
Note: See TracChangeset
for help on using the changeset viewer.