Changeset 2619 for GTP/trunk/Lib/Vis
- Timestamp:
- 01/20/08 22:11:30 (17 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp
r2616 r2619 26 26 27 27 // if 1 = SAFE RENDERING OF PVS primitives without VBOs for Pvs error estimation 28 #define EVAL_ERROR 028 #define EVAL_ERROR 1 29 29 30 30 namespace GtpVisibilityPreprocessor { … … 89 89 mSceneGraph->CollectObjects(mObjects); 90 90 91 #if 191 #if 0 92 92 viewCellsManager->GetViewPoint(mViewPoint); 93 93 mViewDirection = Vector3(0,0,1); 94 94 #else 95 mViewPoint = Vector3(1099.9,183.0,-387); 96 mViewDirection = Vector3(-0.6,0,-0.8); 95 96 mViewPoint = Vector3(1213.85, 176.988, -437.364); 97 mViewDirection = Vector3(0.433884, 0, -0.900969); 98 99 //mViewPoint = Vector3(1099.9,183.0,-387); 100 //mViewDirection = Vector3(-0.6,0,-0.8); 97 101 #endif 98 102 mFrame = 0; … … 151 155 void GlRenderer::RenderIntersectable(Intersectable *object) 152 156 { 153 154 157 if (!object || (object->mRenderedFrame == mCurrentFrame)) 158 return; 155 159 156 160 object->mRenderedFrame = mCurrentFrame; … … 448 452 GlRenderer::_RenderScene() 449 453 { 450 ObjectContainer::const_iterator oi = mObjects.begin(); 451 for (; oi != mObjects.end(); oi++) 452 RenderIntersectable(*oi); 454 455 ObjectContainer::const_iterator oi = mObjects.begin(); 456 for (; oi != mObjects.end(); oi++) 457 RenderIntersectable(*oi); 453 458 } 454 459 … … 531 536 GlRenderer::RenderScene() 532 537 { 533 Intersectable::NewMail(); 538 mCurrentFrame++; 539 540 Intersectable::NewMail(); 534 541 #if DYNAMIC_OBJECTS_HACK 535 542 Preprocessor *p = mViewCellsManager->GetPreprocessor(); … … 832 839 RenderKdLeaf(static_cast<KdLeaf *>(node)); 833 840 #else 834 KdLeaf *leaf = (KdLeaf *)node;841 KdLeaf *leaf = static_cast<KdLeaf *>(node); 835 842 for (int i=0; i < leaf->mObjects.size(); i++) 836 {843 { 837 844 RenderIntersectable(leaf->mObjects[i]); 838 }845 } 839 846 #endif 840 847 } 841 848 else 842 849 { 843 KdInterior *in = (KdInterior *)node;844 RenderKdNode(in ->mBack);845 RenderKdNode(in ->mFront);850 KdInterior *inter = static_cast<KdInterior *>(node); 851 RenderKdNode(inter->mBack); 852 RenderKdNode(inter->mFront); 846 853 } 847 854 } … … 1477 1484 // set frame id for saving the error buffer 1478 1485 mFrame = i; 1486 1479 1487 // cerr<<"RV"<<endl; 1480 1488 RandomViewPoint(); … … 1516 1524 // emit UpdatePvsErrorItem(i, 1517 1525 // mPvsErrorBuffer[i]); 1518 cout<<"("<<i<<" ,"<<mPvsErrorBuffer[i].mError<<")";1526 cout<<"("<<i<<" ["<<mViewPoint<<"]["<<mViewDirection<<"] "<<mPvsErrorBuffer[i].mError<<")"; 1519 1527 // swapBuffers(); 1520 1528 } -
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp
r2617 r2619 21 21 #define USE_CG 1 22 22 23 #define TEST_PVS_RENDERING 1 23 24 24 25 #if USE_CG … … 132 133 glStencilOp(GL_KEEP, GL_KEEP, GL_INCR); 133 134 135 134 136 // Render PVS 135 137 ObjectPvsIterator it = pvs.GetIterator(); … … 139 141 140 142 Intersectable::NewMail(); 143 mCurrentFrame++; 141 144 while (it.HasMoreEntries()) 142 145 { … … 176 179 177 180 178 if (mSnapErrorFrames && ( 0 &&pErrorPixels >= 0.01f)) {181 if (mSnapErrorFrames && (pErrorPixels >= 0.01f)) { 179 182 glReadBuffer(GL_BACK); 180 183 //glReadBuffer(GL_FRONT); … … 211 214 // Render PVS 212 215 Intersectable::NewMail(); 216 mCurrentFrame++; 213 217 214 218 … … 220 224 221 225 mUseForcedColors = false; 222 223 226 im = toImage(); 224 227 sprintf(filename, "error-frame-%04d-%0.5f-pvs.png", mFrame, pErrorPixels); … … 371 374 void QtGlRendererWidget::_RenderPvs() 372 375 { 373 mUseFalseColors = false; 376 377 #if TEST_PVS_RENDERING 378 379 ObjectPvsIterator it = mPvsCache.mPvs.GetIterator(); 380 381 int pvsSize = mPvsCache.mPvs.GetSize(); 382 383 Intersectable::NewMail(); 384 mCurrentFrame++; 385 while (it.HasMoreEntries()) 386 { 387 RenderIntersectable(it.Next()); 388 } 389 390 391 return; 392 #endif 393 394 mUseFalseColors = false; 374 395 375 396 int offset = (int)mObjects.size() * 3; -
GTP/trunk/Lib/Vis/Preprocessing/src/SG08/run_test_pixel
r2613 r2619 4 4 #COMMAND="./release/preprocessor.exe -preprocessor_quit_on_finish+" 5 5 #COMMAND="../scripts/preprocessor.sh -preprocessor_quit_on_finish+ -preprocessor_use_gl_renderer- -preprocessor_evaluate_filter- -samples_per_pass=500000 -samples_per_evaluation=10000000 -total_samples=500000000 -preprocessor_pvs_rendererror_samples=10000 -preprocessor_evaluatePixelError+" 6 COMMAND="../scripts/preprocessor.sh -preprocessor_quit_on_finish+ -preprocessor_use_gl_renderer - -preprocessor_evaluate_filter- -samples_per_pass=1000000 -samples_per_evaluation=10000000 -total_samples=500000000 -preprocessor_pvs_rendererror_samples=10000 -preprocessor_evaluatePixelError+ -preprocessor_detect_empty_viewspace+ -kd_pvs_area=1e-4"6 COMMAND="../scripts/preprocessor.sh -preprocessor_quit_on_finish+ -preprocessor_use_gl_renderer+ -preprocessor_evaluate_filter- -samples_per_pass=500000 -samples_per_evaluation=100000 -total_samples=500000000 -preprocessor_pvs_rendererror_samples=100 -preprocessor_evaluatePixelError+ -preprocessor_detect_empty_viewspace+ -kd_pvs_area=1e-5 -view_cells_use_kd_pvs+ -af_use_kd_pvs+" 7 7 8 8 #SCENE="../data/vienna/vienna-buildings.x3d;../data/vienna/vienna-roofs.x3d;../data/vienna/vienna-roads.x3d" … … 35 35 #VIEWCELLS=../data/vienna/vienna-seq-viewcells-20000.xml.gz 36 36 37 PREFIX=../work/plots/osp-vienna-SG08 -PIXEL37 PREFIX=../work/plots/osp-vienna-SG08c-PIXEL 38 38 39 39 #SCENE=../data/atlanta/atlanta2.x3d … … 43 43 $COMMAND -preprocessor=combined -scene_filename=$SCENE -view_cells_filename=$VIEWCELLS \ 44 44 -rss_distributions=mutation+object_direction+spatial -view_cells_filter_max_size=1 \ 45 -view_cells_use_kd_pvs+ -af_use_kd_pvs+ \46 45 -preprocessor_visibility_file=$PREFIX-i-mixed-b1-n4l.xml \ 47 46 -preprocessor_stats=$PREFIX-i-mixed-b1-n4l.log \ -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r2618 r2619 2591 2591 2592 2592 // check if last ray was not same ray with reverse direction 2593 //if (1)2593 if (1) 2594 2594 // tmp matt: don't use when origin objects are not accounted for, currently the second ray is lost!! 2595 2595 // $$JB: reenabled again - should use the same viewcells for the next ray ray if 2596 2596 // it goes in the oposite direction 2597 if (!lastVssRay ||2598 !(ray.mOrigin == lastVssRay->mTermination) ||2599 !(ray.mTermination == lastVssRay->mOrigin))2597 // if (!lastVssRay || 2598 // !(ray.mOrigin == lastVssRay->mTermination) || 2599 // !(ray.mTermination == lastVssRay->mOrigin)) 2600 2600 { 2601 2601 #ifdef USE_PERFTIMER
Note: See TracChangeset
for help on using the changeset viewer.