Changeset 2671 for GTP/trunk/Lib/Vis
- Timestamp:
- 04/30/08 18:53:06 (17 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/scripts/run_gvs_vps.sh
r2668 r2671 27 27 -preprocessor=gvs \ 28 28 -gvs_epsilon=0.0001 \ 29 -gvs_total_samples= 500000 \30 -gvs_samples_per_pass= 50000 \29 -gvs_total_samples=1000000 \ 30 -gvs_samples_per_pass=1000000 \ 31 31 -gvs_initial_samples=16 \ 32 -gvs_max_viewcells=2 \32 -gvs_max_viewcells=200 \ 33 33 -gvs_min_contribution=50 \ 34 34 -gvs_per_viewcell=true \ -
GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp
r2670 r2671 466 466 467 467 468 469 void 470 GlRenderer::_RenderScene() 471 { 472 473 ObjectContainer::const_iterator oi = mObjects.begin(); 474 for (; oi != mObjects.end(); oi++) 475 RenderIntersectable(*oi); 476 } 468 void GlRenderer::_RenderScene() 469 { 470 ObjectContainer::const_iterator oi = mObjects.begin(); 471 472 for (; oi != mObjects.end(); oi++) 473 RenderIntersectable(*oi); 474 } 475 477 476 478 477 void GlRenderer::_RenderSceneTrianglesWithDrawArrays() … … 483 482 glBindBufferARB(GL_ARRAY_BUFFER_ARB, mVboId); 484 483 485 int offset = (int)mObjects.size() * 3;484 const int offset = (int)mObjects.size() * 3; 486 485 char *arrayPtr = mUseVbos ? NULL : (char *)mData; 487 486 … … 489 488 glNormalPointer(GL_FLOAT, 0, (char *)arrayPtr + offset * sizeof(Vector3)); 490 489 491 glDrawArrays(GL_TRIANGLES, 0, (int)mObjects.size() * 3); 492 //DisableDrawArrays(); 490 glDrawArrays(GL_TRIANGLES, 0, offset); 493 491 } 494 492 … … 556 554 557 555 558 bool 559 GlRenderer::RenderScene() 560 { 561 mCurrentFrame++; 562 563 Intersectable::NewMail(); 556 bool GlRenderer::RenderScene() 557 { 558 ++ mCurrentFrame; 559 560 Intersectable::NewMail(); 561 564 562 #if DYNAMIC_OBJECTS_HACK 565 563 Preprocessor *p = mViewCellsManager->GetPreprocessor(); … … 570 568 { 571 569 #if USE_TRANSFORMED_MESH_INSTANCE_HACK 572 570 RenderIntersectable(*dit); 573 571 #else 574 572 _RenderDynamicObject(*dit); … … 576 574 } 577 575 #endif 576 578 577 #if 1 579 578 _RenderSceneTrianglesWithDrawArrays(); … … 603 602 // read back the texture 604 603 glReadPixels(0, 0, 605 606 607 608 609 610 604 GetWidth(), GetHeight(), 605 GL_RGBA, 606 GL_UNSIGNED_BYTE, 607 mPixelBuffer); 608 609 611 610 unsigned int *p = mPixelBuffer; 612 611 613 612 for (int y = 0; y < GetHeight(); y++) 614 613 { … … 1837 1836 { 1838 1837 int indexBufferSize = 0; 1839 1838 mRenderedNodes = 0; 1839 1840 1840 KdNode::NewMail2(); 1841 1841 … … 1898 1898 } 1899 1899 1900 ++ mRenderedNodes; 1901 1900 1902 leaf->mIndexBufferSize = indexBufferSize - leaf->mIndexBufferStart; 1901 1903 } 1902 1904 } 1905 1903 1906 1904 1907 void GlRenderer::CreateVertexArrays(SceneGraphLeaf *leaf) -
GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.h
r2670 r2671 233 233 234 234 vector<PvsErrorEntry> mPvsErrorBuffer; 235 235 236 bool mComputeGVS; 236 237 … … 281 282 282 283 bool mUseVbos; 284 285 int mRenderedNodes; 283 286 }; 284 287 -
GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.cpp
r2670 r2671 1168 1168 { 1169 1169 ComputeRenderError(); 1170 // and second time1171 ComputeRenderError();1172 // and third time1173 ComputeRenderError();1174 1170 } 1175 1171 -
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp
r2670 r2671 113 113 void QtGlRendererBuffer::RenderPvs(const ObjectPvs &pvs) 114 114 { 115 EnableDrawArrays(); 115 116 PreparePvs(pvs); 117 118 if (mUseVbos) 119 glBindBufferARB(GL_ARRAY_BUFFER_ARB, mVboId); 116 120 117 121 int offset = (int)mObjects.size() * 3; … … 128 132 { 129 133 MakeCurrent(); 130 134 131 135 if (0) 132 136 { … … 213 217 Intersectable::NewMail(); 214 218 215 KdNode::NewMail2();216 Intersectable::NewMail();217 KdNode::NewMail2();218 Intersectable::NewMail();219 220 219 // render pvs once 221 220 RenderPvs(pvs); 221 222 //cout << "rendered nodes: " << mRenderedNodes << endl; 222 223 223 224 //glColorMask(GL_TRUE, GL_FALSE, GL_FALSE, GL_FALSE); … … 226 227 227 228 glEnable(GL_STENCIL_TEST); 228 glColor3f(1, 0,0);229 glColor3f(1, 0, 0); 229 230 230 231 … … 250 251 if (pixelCount > 0) 251 252 { 252 cout << " vc id: " << viewcell->GetId() << " pvs: " << pvsSize << " pc: " << pixelCount << endl;253 cout << "frame " << mFrame << " vc id: " << viewcell->GetId() << " pvs: " << pvsSize << " pc: " << pixelCount << endl; 253 254 254 255 if (mSnapErrorFrames) … … 256 257 glReadBuffer(GL_BACK); 257 258 //glReadBuffer(GL_FRONT); 259 258 260 259 261 ////////////// … … 284 286 285 287 ++ mCurrentFrame; 288 286 289 // render pvs once 287 290 RenderPvs(pvs); … … 290 293 291 294 im = toImage(); 292 sprintf(filename, "error-frame-%04d-%0 .5f-pvs.png", mFrame, pErrorPixels);295 sprintf(filename, "error-frame-%04d-%04d-%0.5f-pvs.png", mFrame, viewcell->GetId(), pErrorPixels); 293 296 str = mSnapPrefix + filename; 294 297 qstr = str.c_str(); … … 331 334 ObjectContainer::iterator oit = 332 335 lower_bound(objects.begin(), objects.end(), &dummy, ilt); 333 334 336 335 337 if (//(oit != oit.end()) && … … 464 466 void QtGlRendererWidget::_RenderPvs() 465 467 { 468 EnableDrawArrays(); 469 if (mUseVbos) 470 glBindBufferARB(GL_ARRAY_BUFFER_ARB, mVboId); 471 466 472 mUseFalseColors = false; 467 473 … … 583 589 584 590 // update the indices for rendering 585 PreparePvs 2(mPvsCache.mPvs);591 PreparePvs(mPvsCache.mPvs); 586 592 emit PvsUpdated(); 587 593 mCurrentPvsCost = mPvsCache.mPvs.EvalPvsCost(); -
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.h
r2670 r2671 74 74 75 75 int ComputePvs(ObjectContainer &objects, ObjectContainer &pvs) const; 76 76 77 77 78 public:
Note: See TracChangeset
for help on using the changeset viewer.