Changeset 2145
- Timestamp:
- 02/20/07 15:37:34 (18 years ago)
- Location:
- GTP/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TerrainFrameListener.cpp
r2121 r2145 162 162 mViewCellsLoaded(false), 163 163 mUseVisibilityFilter(false), 164 mFloorDist(2) 164 mFloorDist(2), 165 mFlushQueue(false) 165 166 { 166 167 //mInputDevice = PlatformManager::getSingleton().createInputReader(); … … 261 262 setTestGeometryForVisibleLeaves(mTestGeometryForVisibleLeaves); 262 263 263 mSceneMgr->setOption("UseDepthPass", &mUseDepthPass); 264 264 //mSceneMgr->setOption("UseDepthPass", &mUseDepthPass); 265 mSceneMgr->getOption("UseDepthPass", &mUseDepthPass); 266 267 if (mUseDepthPass) 268 mUseDepthPassInfo->setCaption(": true"); 269 else 270 mUseDepthPassInfo->setCaption(": false"); 271 272 mSceneMgr->getOption("FlushQueue", &mFlushQueue); 273 274 if (mFlushQueue) 275 LogManager::getSingleton().logMessage("initial setting: flushing queue"); 276 else 277 LogManager::getSingleton().logMessage("initial setting: not flushing queue"); 278 265 279 mSceneMgr->setOption("ShowOctree", &mShowOctree); 266 280 mSceneMgr->setOption("ShowViewCells", &mShowViewCells); … … 1289 1303 } 1290 1304 //----------------------------------------------------------------------- 1305 void TerrainFrameListener::toggleFlushQueue() 1306 { 1307 mFlushQueue = !mFlushQueue; 1308 1309 mSceneMgr->setOption("FlushQueue", &mFlushQueue); 1310 1311 if (mFlushQueue) 1312 { 1313 LogManager::getSingleton().logMessage("flushing queue"); 1314 //mFlushQueueInfo->setCaption(": true"); 1315 } 1316 else 1317 { 1318 LogManager::getSingleton().logMessage("not flushing queue"); 1319 //mFlushQueueInfo->setCaption(": false"); 1320 } 1321 } 1322 1323 //----------------------------------------------------------------------- 1291 1324 void TerrainFrameListener::toggleShowViz() 1292 1325 { … … 1363 1396 switch(e->getKey()) 1364 1397 { 1398 1399 case KC_SUBTRACT: 1400 changeThreshold(-10); 1401 break; 1402 case KC_ADD: 1403 changeThreshold(10); 1404 break; 1405 1365 1406 case KC_ESCAPE: 1366 1407 mShutdownRequested = true; … … 1371 1412 nextAlgorithm(); 1372 1413 break; 1373 1374 case KC_F: 1375 nextFilter(); 1376 break; 1377 case KC_R: 1378 nextSceneDetailLevel(); 1379 break; 1380 case KC_P: 1381 toggleDisplayCameraDetails(); 1382 break; 1383 case KC_G: 1384 mTestGeometryForVisibleLeaves = !mTestGeometryForVisibleLeaves; 1385 setTestGeometryForVisibleLeaves(mTestGeometryForVisibleLeaves); 1386 break; 1387 case KC_T: 1388 toggleShowOctree(); 1389 break; 1390 case KC_X: 1391 toggleUseDepthPass(); 1392 break; 1393 case KC_H: 1394 toggleShowShadows(); 1395 break; 1396 1397 case KC_I: 1398 mUseItemBuffer = !mUseItemBuffer; 1399 break; 1400 case KC_Z: 1401 mCamNode->resetOrientation(); 1402 break; 1403 case KC_U: 1404 mCamNode->resetOrientation(); 1405 mCamNode->setPosition(mApplication->mInitialPosition); 1406 break; 1414 1415 case KC_LSHIFT: 1416 mShiftPressed = true; 1417 break; 1418 case KC_DELETE: 1419 mDeleteObjects = true; 1420 break; 1421 1407 1422 case KC_C: 1408 1423 if (mItemBufferMode != GtpVisibility::QueryManager::GEOMETRY_VISIBILITY) … … 1415 1430 } 1416 1431 break; 1417 1418 case KC_SUBTRACT: 1419 changeThreshold(-10); 1420 break; 1421 case KC_ADD: 1422 changeThreshold(10); 1423 break; 1432 case KC_E: // hack for recording demo using precomputed fps 1433 mSavePrecomputedFps = !mSavePrecomputedFps; 1434 break; 1435 1436 case KC_F: 1437 nextFilter(); 1438 break; 1439 case KC_G: 1440 mTestGeometryForVisibleLeaves = !mTestGeometryForVisibleLeaves; 1441 setTestGeometryForVisibleLeaves(mTestGeometryForVisibleLeaves); 1442 break; 1443 case KC_H: 1444 toggleShowShadows(); 1445 break; 1446 case KC_L: 1447 toggleShowViewCells(); 1448 break; 1449 case KC_M: // hack for recording demo using precomputed fps 1450 mRecordDemo = !mRecordDemo; 1451 break; 1452 case KC_O: 1453 switchMouseMode(); 1454 break; 1455 case KC_P: 1456 toggleDisplayCameraDetails(); 1457 break; 1458 case KC_V: 1459 toggleUseViewCells(); 1460 break; 1461 case KC_Q: 1462 toggleUseVisibilityFilter(); 1463 break; 1464 case KC_R: 1465 nextSceneDetailLevel(); 1466 break; 1467 case KC_T: 1468 toggleShowOctree(); 1469 break; 1470 case KC_U: 1471 mCamNode->resetOrientation(); 1472 mCamNode->setPosition(mApplication->mInitialPosition); 1473 break; 1474 case KC_X: 1475 toggleUseDepthPass(); 1476 break; 1477 case KC_I: 1478 toggleFlushQueue(); 1479 break; 1480 case KC_Z: 1481 mCamNode->resetOrientation(); 1482 break; 1483 1424 1484 1425 1485 /////////////// 1426 1486 //-- visualization 1487 1427 1488 case KC_1: 1428 1489 toggleShowViz(); … … 1431 1492 nextNodeVizMode(); 1432 1493 break; 1433 1494 case KC_7: 1495 mTerrainContentGenerator->WriteObjects(objects_out_filename); 1496 break; 1497 case KC_8: 1498 changeAssumedVisibility(-5); 1499 // changeAssumedVisibility(-500); 1500 break; 1501 case KC_9: 1502 changeAssumedVisibility(5); 1503 // changeAssumedVisibility(500); 1504 break; 1505 1506 //#if USE_PERFHUD 1507 case KC_F1: 1508 toggleShowHelp(); 1509 break; 1434 1510 case KC_F2: 1435 1511 mStatsOn = !mStatsOn; … … 1441 1517 case KC_F4: 1442 1518 toggleRecord(); 1443 break;1444 //#if USE_PERFHUD1445 case KC_F1:1446 toggleShowHelp();1447 1519 break; 1448 1520 … … 1477 1549 takeScreenshot(); 1478 1550 break; 1479 case KC_7: 1480 mTerrainContentGenerator->WriteObjects(objects_out_filename); 1481 break; 1482 case KC_8: 1483 changeAssumedVisibility(-5); 1484 // changeAssumedVisibility(-500); 1485 break; 1486 case KC_9: 1487 changeAssumedVisibility(5); 1488 // changeAssumedVisibility(500); 1489 break; 1490 case KC_LSHIFT: 1491 mShiftPressed = true; 1492 break; 1493 case KC_DELETE: 1494 mDeleteObjects = true; 1495 break; 1496 case KC_M: // hack for recording demo using precomputed fps 1497 mRecordDemo = !mRecordDemo; 1498 break; 1499 case KC_E: // hack for recording demo using precomputed fps 1500 mSavePrecomputedFps = !mSavePrecomputedFps; 1501 break; 1502 case KC_O: 1503 switchMouseMode(); 1504 break; 1505 case KC_V: 1506 toggleUseViewCells(); 1507 break; 1508 case KC_L: 1509 toggleShowViewCells(); 1510 break; 1511 case KC_Q: 1512 toggleUseVisibilityFilter(); 1513 break; 1551 1552 1514 1553 //KEY_PRESSED(KC_F3, 0.3, writeFrames()); 1515 1554 //KEY_PRESSED(KC_F4, 0.3, loadFrames()); -
GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TerrainFrameListener.h
r2108 r2145 225 225 */ 226 226 void toggleUseDepthPass(); 227 228 void toggleFlushQueue(); 229 227 230 /** Toggles whether the visualization is shown. 228 231 */ 229 232 void toggleShowViz(); 233 230 234 /** Toggles whether the frames are recorded. 231 235 */ … … 360 364 bool mShowViewCells; 361 365 bool mUseDepthPass; 366 bool mFlushQueue; 362 367 bool mShowVisualization; 363 368 bool mCullCamera; -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreOcclusionCullingSceneManager.h
r2123 r2145 273 273 274 274 bool mShowTerrain; 275 276 int mFlushRate; 277 int mCurrentFrame; 275 278 276 279 ObjReader *mObjReader; -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionCullingSceneManager.cpp
r2130 r2145 62 62 mShowTerrain(false), 63 63 mViewCellsFilename(""), 64 mFilename("terrain") 64 mFilename("terrain"), 65 mFlushRate(10), 66 mCurrentFrame(0) 65 67 { 66 68 Ogre::LogManager::getSingleton(). … … 192 194 String val; 193 195 196 LogManager::getSingleton().logMessage("****** OcclusionCullingSceneManager Options ********"); 194 197 config.load(stream); 195 198 … … 203 206 } 204 207 208 if (mUseDepthPass) 209 LogManager::getSingleton().logMessage("using depth"); 210 else 211 LogManager::getSingleton().logMessage("not using depth"); 212 205 213 val = config.getSetting("FlushQueue"); 206 214 … … 210 218 } 211 219 220 if (mDeleteQueueAfterRendering) 221 LogManager::getSingleton().logMessage("flushing queue"); 222 else 223 LogManager::getSingleton().logMessage("not flushing queue"); 224 212 225 val = config.getSetting("Scene"); 213 226 … … 382 395 // set the page source 383 396 selectPageSource(pageSourceName, optlist); 397 398 LogManager::getSingleton().logMessage("****** Finished OcclusionCullingSceneManager Options ********"); 384 399 } 385 400 … … 675 690 676 691 // for the shadow pass we use only standard rendering 677 // because shadows have low occlusion snyway692 // because shadows have low occlusion anyway 678 693 if (mShadowTechnique == SHADOWTYPE_TEXTURE_MODULATIVE && 679 694 mIlluminationStage == IRS_RENDER_TO_TEXTURE) … … 704 719 void OcclusionCullingSceneManager::_renderVisibleObjects() 705 720 { 706 // $$matt temp: Remove this!! 707 if (0) 708 { 709 getDestinationRenderSystem()->_setCullingMode(CULL_NONE); 710 //LogManager::getSingleton().logMessage("warning: culling mode"); 711 } 721 const bool flushQueue = mDeleteQueueAfterRendering && ((mCurrentFrame % mFlushRate) == 0); 722 ++ mCurrentFrame; 712 723 713 724 if (mNormalExecution) … … 715 726 // the standard octree rendering mode 716 727 TerrainSceneManager::_renderVisibleObjects(); 717 getRenderQueue()->clear( mDeleteQueueAfterRendering);728 getRenderQueue()->clear(flushQueue); 718 729 return; 719 730 } … … 847 858 848 859 // almost same effect as below 849 getRenderQueue()->clear( mDeleteQueueAfterRendering);860 getRenderQueue()->clear(flushQueue); 850 861 851 862 if (0) WriteLog(); // write out stats … … 935 946 return true; 936 947 } 937 else if (key == " DeleteRenderQueue")948 else if (key == "FlushQueue") 938 949 { 939 950 mDeleteQueueAfterRendering = (*static_cast<const bool *>(val)); … … 1052 1063 return true; 1053 1064 } 1065 if (key == "FlushQueue") 1066 { 1067 * static_cast<bool *>(val) = (bool *)mDeleteQueueAfterRendering; 1068 return true; 1069 } 1054 1070 if (key == "NormalExecution") 1055 1071 { … … 1062 1078 mVisibilityManager->GetCullingManagerType(); 1063 1079 1064 * static_cast<unsigned int *>(val) = 1065 (unsigned int)algorithm; 1080 * static_cast<unsigned int *>(val) = (unsigned int)algorithm; 1081 1082 getRenderQueue()->clear(true); 1083 1066 1084 return true; 1067 1085 }
Note: See TracChangeset
for help on using the changeset viewer.