Changeset 2633 for GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface
- Timestamp:
- 01/23/08 01:38:11 (17 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp
r2627 r2633 304 304 GlRenderer::InitGL(); 305 305 306 GLfloat light_ambient[] = {0.3, 0.3, 0.3, 1.0}; 307 GLfloat light_diffuse[] = {0.6, 0.6, 0.6, 1.0}; 308 GLfloat light_specular[] = {1.0, 1.0, 1.0, 1.0}; 309 GLfloat light_position[] = //{278.0f, 548.8f,279.0f, 1.0f }; 310 { 0.f,0.f,0.f,1.0f }; 311 312 /*glLightfv(GL_LIGHT0, GL_AMBIENT, light_ambient); 313 glLightfv(GL_LIGHT0, GL_DIFFUSE, light_diffuse); 314 glLightfv(GL_LIGHT0, GL_SPECULAR, light_specular); 315 glLightfv(GL_LIGHT0, GL_POSITION, light_position); 316 */ 317 glEnable(GL_LIGHT0); 318 306 319 GLfloat mat_ambient[] = {0.5f, 0.5f, 0.5f, 1.0f}; 307 320 … … 311 324 GLfloat mat_shininess[] = {1.0f}; 312 325 313 GLfloat light_ambient[] = {0.2f, 0.2f, 0.2f, 1.0f};326 /* GLfloat light_ambient[] = {0.2f, 0.2f, 0.2f, 1.0f}; 314 327 GLfloat light_diffuse[] = {0.4f, 0.4f, 0.4f, 1.0f}; 315 328 GLfloat light_specular[] = {0.3f, 0.3f, 0.3f, 1.0f}; 316 329 317 330 GLfloat lmodel_ambient[] = {0.3f, 0.3f, 0.3f, 1.0f}; 318 331 */ 319 332 320 333 // default Material … … 329 342 glLightfv(GL_LIGHT0, GL_SPECULAR, light_specular); 330 343 331 glLightfv(GL_LIGHT1, GL_AMBIENT, light_ambient);344 /*glLightfv(GL_LIGHT1, GL_AMBIENT, light_ambient); 332 345 glLightfv(GL_LIGHT1, GL_DIFFUSE, light_diffuse); 333 346 glLightfv(GL_LIGHT1, GL_SPECULAR, light_specular); 334 335 glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient);347 */ 348 //glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient); 336 349 337 350 glEnable(GL_LIGHTING); 338 351 glEnable(GL_LIGHT0); 339 glEnable(GL_LIGHT1);352 // glEnable(GL_LIGHT1); 340 353 341 354 // set position of the light 342 GLfloat infinite_light[] = { 1.0, 0.8, 1.0, 0.0 };355 /*GLfloat infinite_light[] = { 1.0, 0.8, 1.0, 0.0 }; 343 356 glLightfv (GL_LIGHT0, GL_POSITION, infinite_light); 344 357 … … 346 359 GLfloat infinite_light2[] = { -0.3, 1.5, 1.0, 0.0 }; 347 360 glLightfv (GL_LIGHT1, GL_POSITION, infinite_light2); 361 */ 362 glLightfv (GL_LIGHT0, GL_POSITION, light_position); 348 363 349 364 glColorMaterial( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE); … … 351 366 glEnable(GL_COLOR_MATERIAL); 352 367 353 glShadeModel(GL_ FLAT);368 glShadeModel(GL_SMOOTH); 354 369 } 355 370 … … 392 407 void QtGlRendererWidget::_RenderPvs() 393 408 { 394 395 #if TEST_PVS_RENDERING 396 397 ObjectPvsIterator it = mPvsCache.mPvs.GetIterator(); 398 399 int pvsSize = mPvsCache.mPvs.GetSize(); 400 401 Intersectable::NewMail(); 402 mCurrentFrame++; 403 while (it.HasMoreEntries()) 404 { 405 RenderIntersectable(it.Next()); 406 } 407 408 409 return; 410 #endif 411 412 mUseFalseColors = false; 409 mUseFalseColors = false; 413 410 414 411 int offset = (int)mObjects.size() * 3; … … 436 433 437 434 438 void QtGlRendererWidget::PreparePvs ()435 void QtGlRendererWidget::PreparePvs2(const ObjectPvs &pvs) 439 436 { 440 437 int indexBufferSize = 0; … … 443 440 //Intersectable::NewMail(); 444 441 445 mPvsSize = mPvsCache.mPvs.GetSize(); 442 mPvsSize = pvs.GetSize(); 443 446 444 #if DYNAMIC_OBJECTS_HACK 447 445 mDynamicObjects.clear(); 448 446 #endif 449 ObjectPvsIterator it = mPvsCache.mPvs.GetIterator(); 447 448 ObjectPvsIterator it = pvs.GetIterator(); 450 449 451 450 while (it.HasMoreEntries()) … … 492 491 493 492 EnableDrawArrays(); 494 495 493 //Intersectable::NewMail(); 496 494 … … 505 503 if (viewcell) 506 504 { 505 #if 1 507 506 // copy the pvs so that it can be filtered ... 508 507 if (PvsChanged(viewcell)) … … 524 523 //mPvsCache.mPvs = pvs; 525 524 //mMutex.unlock(); 526 cout << "pvs size: " << mPvsCache.mPvs.GetSize() << endl;525 //cout << "pvs size: " << mPvsCache.mPvs.GetSize() << endl; 527 526 } 528 527 else … … 530 529 mPvsCache.mPvs = viewcell->GetPvs(); 531 530 } 532 533 // /update the indices for rendering534 PreparePvs ();535 531 532 // update the indices for rendering 533 PreparePvs2(mPvsCache.mPvs); 534 536 535 emit PvsUpdated(); 537 536 } 537 #else 538 PreparePvs2(viewcell->GetPvs()); 539 emit PvsUpdated(); 540 #endif 538 541 539 542 … … 898 901 ) 899 902 : 900 GlRendererWidget(sceneGraph, viewcells, tree), QGLWidget( parent, shareWidget, f)903 GlRendererWidget(sceneGraph, viewcells, tree), QGLWidget(QGLFormat(QGL::SampleBuffers), parent, shareWidget, f) 901 904 { 902 905 mPreprocessorThread = NULL; … … 910 913 mRenderFilter = true; 911 914 mRenderVisibilityEstimates = false; 915 //mRenderVisibilityEstimates = true; 912 916 913 917 mUseRandomColorPerPvsObject = false; … … 918 922 mTransferFunction = 1.0f; 919 923 mIndexBufferSize = 0; 920 921 //mCurrentFrame = 0;922 924 923 925 const int delay = 250; // in milliseconds … … 956 958 mShowRays = false; 957 959 960 SetSceneCut(0); 958 961 mControlWidget = new QtRendererControlWidget(NULL); 959 962 … … 1242 1245 s.sprintf("PVS: %04d", mPvsSize); 1243 1246 renderText(20, 40, s, font40); 1247 1248 /* QFont font40; font40.setPointSize(30); 1249 s.sprintf("New triangles: %04d", 100); 1250 renderText(200, 40, s, font40);*/ 1244 1251 } 1245 1252 … … 1362 1369 float renderCost = 0; 1363 1370 1364 #if ndef USE_BIT_PVS1371 #ifdef USE_VERBOSE_PVS 1365 1372 if (mShowDistanceWeightedPvs) 1366 1373 { … … 1461 1468 1462 1469 ComputeMaxValues(viewcells, maxPvs, maxPiercingRays, maxRelativeRays, maxRcCost); 1470 1463 1471 // matt: temp hack 1464 maxRcCost = 200.0f;1472 //maxRcCost = 5000.0f; 1465 1473 //cout << "maxRcCost: " << maxRcCost << endl; 1474 1466 1475 int i; 1467 1476 … … 1982 1991 1983 1992 1984 1985 1993 cb = new QCheckBox("Cut view cells", vbox); 1986 1994 vbox->layout()->addWidget(cb); -
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.h
r2621 r2633 538 538 } 539 539 540 void PreparePvs ();540 void PreparePvs2(const ObjectPvs &pvs); 541 541 542 542 void _RenderPvs(); -
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtInterface.vcproj
r2576 r2633 165 165 <Tool 166 166 Name="VCCLCompilerTool" 167 AdditionalIncludeDirectories="..\..\src;"$(QTDIR)\include\QtCore";"$(QTDIR)\include\QtGui";"$(QTDIR)\include";"$(QTDIR)\include\QtOpenGl";..\..\..\..\..\..\..\NonGTP\Zlib\include;"$(CG_INC_PATH)" "168 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;QTGLRENDERER_EXPORTS;USE_ VERBOSE_PVS;USE_QT;USE_CG;GTP_INTERNAL"167 AdditionalIncludeDirectories="..\..\src;"$(QTDIR)\include\QtCore";"$(QTDIR)\include\QtGui";"$(QTDIR)\include";"$(QTDIR)\include\QtOpenGl";..\..\..\..\..\..\..\NonGTP\Zlib\include;"$(CG_INC_PATH)";..\..\src\sparsehash\src;..\..\src\sparsehash\src\google;..\..\src\sparsehash\src\windows;..\..\src\sparsehash\src\google\sparsehash" 168 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;QTGLRENDERER_EXPORTS;USE_HASH_PVS;USE_QT;USE_CG;GTP_INTERNAL" 169 169 RuntimeLibrary="2" 170 170 UsePrecompiledHeader="0"
Note: See TracChangeset
for help on using the changeset viewer.