Changeset 2254 for GTP/trunk/Lib
- Timestamp:
- 03/16/07 13:08:00 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/OnlineCullingCHC
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/OnlineCullingCHC/IVReader/src/IVReader.vcproj
r2228 r2254 96 96 Name="VCMIDLTool"/> 97 97 <Tool 98 Name="VCPostBuildEventTool" 99 CommandLine="copy $(OutDir)\$(TargetFileName) "$(OGRE_PATH)\Samples\Common\bin\$(ConfigurationName)""/> 98 Name="VCPostBuildEventTool"/> 100 99 <Tool 101 100 Name="VCPreBuildEventTool"/> -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreOcclusionCullingSceneManager.h
r2184 r2254 187 187 void loadConfig(DataStreamPtr& stream); 188 188 189 void Render DepthPass(const bool fillRenderQueue = true);189 void RenderHierarchicalCulling(const bool fillRenderQueue = true); 190 190 191 191 void _renderScene(Camera* camera, Viewport* vp, bool includeOverlays); … … 196 196 const bool nodeVisibility); 197 197 198 void AddVisibleMeshGeometryToQueue(const GtpVisibility::MeshInfoContainer &visibleGeometry, Camera *cam); 199 void AddVisibleNodeGeometryToQueue(const GtpVisibility::NodeInfoContainer &visibleNodes, Camera *cam); 198 void AddVisibleMeshGeometryToQueue(const GtpVisibility::MeshInfoContainer &visibleGeometry, 199 Camera *cam); 200 void AddVisibleNodeGeometryToQueue(const GtpVisibility::NodeInfoContainer &visibleNodes, 201 Camera *cam); 200 202 201 203 ////////////////////////////////////////// … … 299 301 ObjReader *mObjReader; 300 302 301 Camera *mDummyCamera; 303 bool mUseVisibilityQueries; 304 305 bool mUseFromPointQueries; 306 307 bool mUseExactQueries; 308 309 bool mUseDepthPassForQueries; 302 310 }; 303 311 -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionCullingSceneManager.cpp
r2253 r2254 59 59 mElementaryViewCell(NULL), 60 60 mDeleteQueueAfterRendering(true), 61 mNormalExecution( true),61 mNormalExecution(false), 62 62 mShowViewCells(false), 63 63 mViewCellsGeometryLoaded(false), … … 66 66 mFilename("terrain"), 67 67 mFlushRate(10), 68 mCurrentFrame(0) 68 mCurrentFrame(0), 69 mUseVisibilityQueries(false), 70 mUseFromPointQueries(false), 71 mUseExactQueries(false), 72 mUseDepthPassForQueries(false) 69 73 { 70 74 Ogre::LogManager::getSingleton(). … … 80 84 } 81 85 82 // TODO:set maxdepth to reasonable value86 // set maxdepth to reasonable value 83 87 mMaxDepth = 50; 84 88 … … 110 114 OcclusionCullingSceneManager::~OcclusionCullingSceneManager() 111 115 { 116 CLEAR_CONTAINER(mObjects); 117 112 118 OGRE_DELETE(mHierarchyInterface); 113 CLEAR_CONTAINER(mObjects);114 119 OGRE_DELETE(mCurrentViewCell); 115 120 … … 195 200 ConfigFile config; 196 201 String val; 197 198 LogManager::getSingleton(). 199 logMessage("****** OcclusionCullingSceneManager Options ********"); 202 200 203 config.load(stream); 201 202 std::stringstream d;203 204 205 LogManager::getSingleton().logMessage("****** OcclusionCullingSceneManager Options ********"); 206 204 207 val = config.getSetting("DepthPass"); 205 208 206 209 if (!val.empty()) 207 210 { 208 mUseDepthPass = atoi(val.c_str()); 209 } 210 211 if (mUseDepthPass) 212 LogManager::getSingleton().logMessage("using depth"); 213 else 214 LogManager::getSingleton().logMessage("not using depth"); 215 211 if ( val == "yes" ) 212 mUseDepthPass = true; 213 else 214 mUseDepthPass = false; 215 } 216 217 val = config.getSetting("ExecuteVertexProgramForDepth"); 218 219 if (!val.empty()) 220 { 221 if ( val == "yes" ) 222 mExecuteVertexProgramForAllPasses = true; 223 else 224 mExecuteVertexProgramForAllPasses = false; 225 } 226 227 val = config.getSetting("UseVisibilityQueries"); 228 229 if (!val.empty()) 230 { 231 if ( val == "yes" ) 232 mUseVisibilityQueries = true; 233 else 234 mUseVisibilityQueries = false; 235 } 236 237 val = config.getSetting("UseFromPointQueries"); 238 239 if (!val.empty()) 240 { 241 if (val == "yes") 242 mUseFromPointQueries = true; 243 else 244 mUseFromPointQueries = false; 245 } 246 247 val = config.getSetting("UseExactQueries"); 248 249 if (!val.empty()) 250 { 251 if (val == "yes") 252 mUseExactQueries = true; 253 else 254 mUseExactQueries = false; 255 } 256 257 val = config.getSetting("UseDepthPassForQueries"); 258 259 if (!val.empty()) 260 { 261 if (val == "yes") 262 mUseDepthPassForQueries = true; 263 else 264 mUseDepthPassForQueries = false; 265 } 266 216 267 val = config.getSetting("FlushQueue"); 217 268 218 269 if (!val.empty()) 219 270 { 220 mDeleteQueueAfterRendering = atoi(val.c_str()); 221 } 222 223 if (mDeleteQueueAfterRendering) 224 LogManager::getSingleton().logMessage("flushing queue"); 225 else 226 LogManager::getSingleton().logMessage("not flushing queue"); 227 228 val = config.getSetting("Scene"); 271 if ( val == "yes" ) 272 mDeleteQueueAfterRendering = true; 273 else 274 mDeleteQueueAfterRendering = false; 275 } 276 277 val = config.getSetting("Scene"); 229 278 230 279 if (!val.empty()) … … 286 335 mVisibilityManager->SetCullingManager(algorithm); 287 336 337 stringstream d; 288 338 d << "setting algorithm to: " << algorithm; 289 339 LogManager::getSingleton().logMessage(d.str()); … … 399 449 selectPageSource(pageSourceName, optlist); 400 450 401 LogManager::getSingleton().logMessage("****** Finished OcclusionCullingSceneManager Options ********"); 451 if (mUseDepthPass) 452 LogManager::getSingleton().logMessage("using depth"); 453 else 454 LogManager::getSingleton().logMessage("not using depth"); 455 456 if (mExecuteVertexProgramForAllPasses) 457 LogManager::getSingleton().logMessage("executing vertex program for passes"); 458 else 459 LogManager::getSingleton().logMessage("not executing vertex program for passes"); 460 461 if (mUseVisibilityQueries) 462 LogManager::getSingleton().logMessage("using visibility queries"); 463 else 464 LogManager::getSingleton().logMessage("not using visibility queries"); 465 466 if (mUseFromPointQueries) 467 LogManager::getSingleton().logMessage("using from point queries"); 468 else 469 LogManager::getSingleton().logMessage("not using from point queries"); 470 471 if (mUseExactQueries) 472 LogManager::getSingleton().logMessage("using exact queries"); 473 else 474 LogManager::getSingleton().logMessage("not using exact queries"); 475 476 if (mUseDepthPassForQueries) 477 LogManager::getSingleton().logMessage("using depth pass for queries"); 478 else 479 LogManager::getSingleton().logMessage("not using depth pass for queries"); 480 481 if (mDeleteQueueAfterRendering) 482 LogManager::getSingleton().logMessage("flushing queue after rendering"); 483 else 484 LogManager::getSingleton().logMessage("not flushing queue after rendering"); 485 486 LogManager::getSingleton().logMessage("****** OcclusionCullingSceneManager Options Finished ********"); 402 487 } 403 488 //----------------------------------------------------------------------- … … 588 673 589 674 // add bounding boxes instead of node itself 590 if (0) 591 (*it)->_addBoundingBoxToQueue(getRenderQueue()); 675 if (0) (*it)->_addBoundingBoxToQueue(getRenderQueue()); 592 676 } 593 677 … … 606 690 if (mNormalExecution) 607 691 { 608 return TerrainSceneManager::_setPass(pass );609 } 610 611 // TODO: setting vertex program is not efficient692 return TerrainSceneManager::_setPass(pass, evenIfSuppressed); 693 } 694 695 // problem: setting vertex program is not efficient 612 696 //Pass *usedPass = ((mIsDepthPassPhase && !pass->hasVertexProgram()) ? mDepthPass : pass); 613 697 … … 627 711 } 628 712 629 //--- set vertex program of current pass in order to set correct depth 713 ////////////////// 714 //-- set vertex program of current pass in order to set correct depth 630 715 if (mExecuteVertexProgramForAllPasses && 631 716 mIsDepthPassPhase && … … 651 736 } 652 737 738 // using depth pass instead 653 739 const Pass *usedPass = useDepthPass ? mDepthPass : pass; 654 740 741 #if 0 // tmp matt: pass is now const 655 742 // save old depth write: needed for item buffer 656 const bool IsDepthWrite = usedPass->getDepthWriteEnabled();743 const bool isDepthWrite = usedPass->getDepthWriteEnabled(); 657 744 658 745 // global option which enables / disables depth writes 659 746 if (!mEnableDepthWrite) 660 { 661 //usedPass->setDepthWriteEnabled(false); 662 } 663 //else if (mIsItemBufferPass) {usedPass = mItemBufferPass;} 664 747 usedPass->setDepthWriteEnabled(false); 748 #endif 749 750 /////////////// 665 751 //-- set actual pass here 666 const Pass *result = SceneManager::_setPass(usedPass); 752 753 const Pass *result = SceneManager::_setPass(usedPass, evenIfSuppressed); 667 754 668 755 669 756 // reset depth write 757 #if 0 // tmp matt: this is now a const function 670 758 if (!mEnableDepthWrite) 671 { 672 //usedPass->setDepthWriteEnabled(IsDepthWrite); 673 } 674 759 usedPass->setDepthWriteEnabled(isDepthWrite); 760 #endif 675 761 // reset illumination stage 676 762 mIlluminationStage = savedStage; … … 682 768 bool onlyShadowCasters) 683 769 { 770 // clear render queue 771 // fully reset it after some frames 772 const bool flushQueue = 773 mDeleteQueueAfterRendering && ((mCurrentFrame % mFlushRate) == 0); 774 getRenderQueue()->clear(flushQueue); 775 776 ++ mCurrentFrame; 777 684 778 if (mShowVisualization) 685 779 { … … 689 783 PrepareVisualization(cam); 690 784 691 // lists only used for visualization785 // lists only used for visualization 692 786 mVisible.clear(); 693 787 mBoxes.clear(); … … 696 790 } 697 791 698 // lists only used for visualization 792 699 793 mVisible.clear(); 700 794 mBoxes.clear(); … … 719 813 else if (mUseDepthPass) 720 814 { 721 RenderDepthPass(); 815 // render scene once in order to fill depth buffer 816 RenderHierarchicalCulling(); 722 817 } 723 818 … … 736 831 } 737 832 738 const bool flushQueue = 739 mDeleteQueueAfterRendering && ((mCurrentFrame % mFlushRate) == 0); 740 ++ mCurrentFrame; 833 //const bool flushQueue = mDeleteQueueAfterRendering && ((mCurrentFrame % mFlushRate) == 0); 834 //++ mCurrentFrame; 741 835 742 836 // create material for item buffer pass … … 750 844 //-- (e.g., the visualization mode, the shadow pass) 751 845 752 if (//!mFindVisibleObjects || 846 // also go here if find visible object is disabled 847 // (then the render queue is already filled) 848 if (!mFindVisibleObjects || 753 849 mUseDepthPass || mShowVisualization || 754 850 (mShadowTechnique == SHADOWTYPE_TEXTURE_MODULATIVE && … … 758 854 759 855 if (mShowVisualization) 760 {761 856 // disable illumination stage to prevent rendering shadows 762 857 mIlluminationStage = IRS_NONE; 763 } 764 858 765 859 // standard rendering for shadow maps because of performance 766 860 TerrainSceneManager::_renderVisibleObjects(); … … 811 905 // set all necessary parameters for 812 906 // hierarchical visibility culling and rendering 813 InitVisibilityCulling(m DummyCamera);907 InitVisibilityCulling(mCameraInProgress); 814 908 815 909 … … 854 948 setAmbientLight(savedAmbient); 855 949 856 // almost same effect as below 950 // remove rest from queue 951 #if 0 857 952 getRenderQueue()->clear(flushQueue); 953 #endif 858 954 859 955 if (0) WriteLog(); // write out stats … … 1018 1114 return true; 1019 1115 } 1020 if (key == "ViewCellsLoaded") 1116 if (key == "UseVisibilityQueries") 1117 { 1118 mUseVisibilityQueries = *static_cast<const bool *>(val); 1119 1120 return true; 1121 } 1122 if (key == "UseFromPointQueries") 1123 { 1124 mUseFromPointQueries = *static_cast<const bool *>(val); 1125 1126 return true; 1127 } 1128 if (key == "UseExactQueries") 1129 { 1130 mUseExactQueries = *static_cast<const bool *>(val); 1131 1132 return true; 1133 } 1134 if (key == "UseDepthPassForQueries") 1135 { 1136 mUseDepthPassForQueries = *static_cast<const bool *>(val); 1137 } 1138 if (key == "UseFromPointQueries") 1021 1139 { 1022 return mViewCellsLoaded; 1140 mUseFromPointQueries = *static_cast<const bool *>(val); 1141 return true; 1023 1142 } 1024 1143 … … 1142 1261 return TerrainSceneManager::renderBasicQueueGroupObjects(pGroup, om); 1143 1262 } 1263 1144 1264 // Basic render loop 1145 1265 // Iterate through priorities … … 1159 1279 // after hierarchical culling => don't render them now 1160 1280 1161 if ( mNormalExecution ||!mSkipTransparents)1281 if (!mSkipTransparents) 1162 1282 { 1163 1283 // Do transparents (always descending) … … 1167 1287 } // for each priority 1168 1288 } 1169 1170 1289 //----------------------------------------------------------------------- 1171 1290 bool OcclusionCullingSceneManager::validatePassForRendering(Pass* pass) … … 1177 1296 1178 1297 // skip all but first pass if we are doing the depth pass 1179 if ((mIsDepthPassPhase || mIsItemBufferPhase) && (pass->getIndex() > 0)) 1298 if ((mIsDepthPassPhase || mIsItemBufferPhase) && 1299 (pass->getIndex() > 0)) 1180 1300 { 1181 1301 return false; … … 1198 1318 return; 1199 1319 } 1320 1200 1321 #ifdef ITEM_BUFFER 1201 //-- item buffer 1202 //-- render objects using false colors 1322 1323 /////////////////// 1324 //-- item buffer: render objects using false colors 1203 1325 1204 1326 // Iterate through priorities … … 1350 1472 1351 1473 // if we have the depth pass or use an item buffer, we leave no passes in the queue 1352 if ( 1 &&!mUseDepthPass && !mUseItemBuffer)1474 if (!mUseDepthPass && !mUseItemBuffer) 1353 1475 { 1354 1476 if (mShadowTechnique == SHADOWTYPE_STENCIL_ADDITIVE) … … 1425 1547 RenderQueueGroup* pGroup, QueuedRenderableCollection::OrganisationMode om) 1426 1548 { 1549 if (mNormalExecution || !mIsHierarchicalCulling) 1550 { 1551 // render the rest of the passes 1552 TerrainSceneManager::renderAdditiveStencilShadowedQueueGroupObjects(pGroup, om); 1553 return; 1554 } 1555 1427 1556 // only render solid passes during hierarchical culling 1428 if (mNormalExecution || mIsHierarchicalCulling) 1429 { 1430 RenderQueueGroup::PriorityMapIterator groupIt = pGroup->getIterator(); 1431 LightList lightList; 1432 1433 while (groupIt.hasMoreElements()) 1434 { 1435 RenderPriorityGroup* pPriorityGrp = groupIt.getNext(); 1436 1437 // Sort the queue first 1438 pPriorityGrp->sort(mCameraInProgress); 1439 1440 // Clear light list 1441 lightList.clear(); 1442 1443 // Render all the ambient passes first, no light iteration, no lights 1444 /*** msz: no more IRS_AMBIENT, see OgreSceneManager.h ***/ 1445 // mIlluminationStage = IRS_AMBIENT; 1446 1447 OctreeSceneManager::renderObjects(pPriorityGrp->getSolidsBasic(), om, false, &lightList); 1448 // Also render any objects which have receive shadows disabled 1449 OctreeSceneManager::renderObjects(pPriorityGrp->getSolidsNoShadowReceive(), om, true); 1557 RenderQueueGroup::PriorityMapIterator groupIt = pGroup->getIterator(); 1558 LightList lightList; 1559 1560 while (groupIt.hasMoreElements()) 1561 { 1562 RenderPriorityGroup* pPriorityGrp = groupIt.getNext(); 1563 1564 // Sort the queue first 1565 pPriorityGrp->sort(mCameraInProgress); 1566 1567 // Clear light list 1568 lightList.clear(); 1569 1570 // Render all the ambient passes first, no light iteration, no lights 1571 /*** msz: no more IRS_AMBIENT, see OgreSceneManager.h ***/ 1572 // mIlluminationStage = IRS_AMBIENT; 1573 1574 OctreeSceneManager::renderObjects(pPriorityGrp->getSolidsBasic(), om, false, &lightList); 1575 // Also render any objects which have receive shadows disabled 1576 OctreeSceneManager::renderObjects(pPriorityGrp->getSolidsNoShadowReceive(), om, true); 1450 1577 #if 0 1451 1452 1453 1454 1455 1456 1578 std::stringstream d; 1579 d << " solid size: " << (int)pPriorityGrp->_getSolidPasses().size() 1580 << " solid no shadow size: " << (int)pPriorityGrp->_getSolidPassesNoShadow().size() 1581 << "difspec size: " << (int)pPriorityGrp->_getSolidPassesDiffuseSpecular().size() 1582 << " decal size: " << (int)pPriorityGrp->_getSolidPassesDecal().size(); 1583 LogManager::getSingleton().logMessage(d.str()); 1457 1584 #endif 1458 }1459 }1460 else // render the rest of the passes1461 {1462 OctreeSceneManager::renderAdditiveStencilShadowedQueueGroupObjects(pGroup, om);1463 1585 } 1464 1586 } … … 1467 1589 RenderQueueGroup* pGroup, QueuedRenderableCollection::OrganisationMode om) 1468 1590 { 1469 if (mNormalExecution || mIsHierarchicalCulling) 1470 { 1471 // Iterate through priorities 1472 RenderQueueGroup::PriorityMapIterator groupIt = pGroup->getIterator(); 1473 1474 while (groupIt.hasMoreElements()) 1475 { 1476 RenderPriorityGroup* pPriorityGrp = groupIt.getNext(); 1477 1478 // Sort the queue first 1479 pPriorityGrp->sort(mCameraInProgress); 1480 // Do (shadowable) solids 1481 OctreeSceneManager::renderObjects(pPriorityGrp->getSolidsBasic(), om, true); 1482 } 1483 } 1484 else 1591 if (mNormalExecution || !mIsHierarchicalCulling) 1485 1592 { 1486 1593 TerrainSceneManager::renderModulativeStencilShadowedQueueGroupObjects(pGroup, om); 1594 return; 1595 } 1596 1597 // Iterate through priorities 1598 RenderQueueGroup::PriorityMapIterator groupIt = pGroup->getIterator(); 1599 1600 while (groupIt.hasMoreElements()) 1601 { 1602 RenderPriorityGroup* pPriorityGrp = groupIt.getNext(); 1603 1604 // Sort the queue first 1605 pPriorityGrp->sort(mCameraInProgress); 1606 // Do (shadowable) solids 1607 OctreeSceneManager::renderObjects(pPriorityGrp->getSolidsBasic(), om, true); 1487 1608 } 1488 1609 } … … 1827 1948 } 1828 1949 //----------------------------------------------------------------------- 1829 void OcclusionCullingSceneManager::RenderDepthPass(const bool fillRenderQueue) 1830 { 1831 if (mNormalExecution) 1832 { 1833 // problems using this function in the normal workflow 1834 return; 1835 } 1836 1950 void OcclusionCullingSceneManager::RenderHierarchicalCulling(const bool fillRenderQueue) 1951 { 1837 1952 // create material for depth pass 1838 1953 InitDepthPass(); … … 1907 2022 bool includeOverlays) 1908 2023 { 1909 if ( 0 &&mNormalExecution)2024 if (mNormalExecution) 1910 2025 { 1911 2026 TerrainSceneManager::_renderScene(camera, vp, includeOverlays); … … 2040 2155 2041 2156 // Prepare render queue for receiving new objects 2042 prepareRenderQueue();2157 //prepareRenderQueue(); 2043 2158 2044 2159 mDestRenderSystem->_beginGeometryCount(); … … 2053 2168 mDestRenderSystem->_setViewMatrix(mCameraInProgress->getViewMatrix(true)); 2054 2169 2170 // Prepare render queue for receiving new objects 2171 #ifdef GAMETOOLS_ILLUMINATION_MODULE 2172 if (mFindVisibleObjects) 2173 prepareRenderQueue(); 2174 #else 2175 prepareRenderQueue(); 2176 #endif 2055 2177 2056 2178 if (mFindVisibleObjects) 2057 2179 { 2058 2180 // Parse the scene and tag visibles 2059 _findVisibleObjects(camera,2181 myFindVisibleObjects(camera, 2060 2182 mIlluminationStage == IRS_RENDER_TO_TEXTURE? true : false); 2061 2183 } … … 2071 2193 } 2072 2194 2073 mDummyCamera = camera;2074 2195 // Render scene content 2075 2196 _renderVisibleObjects(); … … 2271 2392 mDestRenderSystem->_setViewMatrix(mCameraInProgress->getViewMatrix(true)); 2272 2393 2273 // // Render scene content in order fill depth buffer 2274 bool savedUseDepthPass = mUseDepthPass; 2275 if (1) mUseDepthPass = true; 2276 2277 // don't need shading, render only depth pass 2394 ////////////// 2395 //-- Render scene in order fill depth buffer 2396 2397 // don't have to fill queue, just render depth 2278 2398 const bool fillQueue = false; 2279 RenderDepthPass(fillQueue); 2399 2400 RenderHierarchicalCulling(fillQueue); 2280 2401 // _renderVisibleObjects(); 2281 2282 mUseDepthPass = savedUseDepthPass;2283 2402 2284 2403 // End frame … … 2310 2429 } 2311 2430 //----------------------------------------------------------------------- 2312 void OcclusionCullingSceneManager::AddVisibleMeshGeometryToQueue(const GtpVisibility::MeshInfoContainer &visibleGeometry, 2313 Camera *cam) 2431 void OcclusionCullingSceneManager::AddVisibleMeshGeometryToQueue( 2432 const GtpVisibility::MeshInfoContainer &visibleGeometry, 2433 Camera *cam) 2314 2434 { 2315 2435 GtpVisibility::MeshInfoContainer::const_iterator geomIt, geomIt_end = visibleGeometry.end(); … … 2332 2452 } 2333 2453 //----------------------------------------------------------------------- 2334 void OcclusionCullingSceneManager::AddVisibleNodeGeometryToQueue(const GtpVisibility::NodeInfoContainer &visibleNodes, 2335 Camera *cam) 2454 void OcclusionCullingSceneManager::AddVisibleNodeGeometryToQueue( 2455 const GtpVisibility::NodeInfoContainer &visibleNodes, 2456 Camera *cam) 2336 2457 { 2337 2458 //////////////// … … 2359 2480 bool onlyShadowCasters) 2360 2481 { 2361 if (mNormalExecution )2482 if (mNormalExecution || (!mUseVisibilityQueries == 0)) 2362 2483 { 2363 2484 TerrainSceneManager::_findVisibleObjects(cam, onlyShadowCasters); … … 2365 2486 } 2366 2487 2488 // don't need shading, render only depth 2489 // note:have to disable deph write for nodes! 2490 bool savedUseDepthPass = mUseDepthPass; 2491 if (mUseDepthPassForQueries) mUseDepthPass = true; 2492 2367 2493 // lists only used for visualization 2494 getRenderQueue()->clear(); 2368 2495 mVisible.clear(); 2369 2496 mBoxes.clear(); 2370 2497 2371 const bool fromPoint = false;2372 const bool nodeVisibility = false;2373 2374 2498 const int itemBufferMode = 0; 2375 2499 const bool relativeVisibility = false; … … 2377 2501 int queryModes = 0; 2378 2502 2379 if (nodeVisibility) 2503 if (mUseExactQueries) 2504 queryModes |= GtpVisibility::QueryManager::GEOMETRY_VISIBILITY; 2505 else 2380 2506 queryModes |= GtpVisibility::QueryManager::NODE_VISIBILITY; 2381 else 2382 queryModes |= GtpVisibility::QueryManager::GEOMETRY_VISIBILITY; 2507 2383 2508 2384 2509 OcclusionQueriesQueryManager *queryManager = 2385 2510 new OcclusionQueriesQueryManager(mHierarchyInterface, 2386 cam->getViewport(),//mCurrentViewport, 2511 cam->getViewport(), 2512 //mCurrentViewport, 2387 2513 queryModes, 2388 2514 itemBufferMode); … … 2394 2520 GtpVisibility::PatchInfoContainer visiblePatches; 2395 2521 2396 if ( fromPoint)2522 if (mUseFromPointQueries) 2397 2523 { 2398 2524 queryManager->ComputeFromPointVisibility(cam->getDerivedPosition(), … … 2423 2549 /////////////////////// 2424 2550 //-- put items in render queue 2425 ////////// 2426 2427 //getRenderQueue()->clear(); 2428 2429 ////////////////////// 2430 //-- apply queries on geometry level 2431 2432 if (!nodeVisibility) 2433 { 2551 2552 if (mUseExactQueries) 2553 { 2554 //////////// 2555 //-- apply queries on geometry level 2556 2434 2557 AddVisibleMeshGeometryToQueue(visibleGeometry, cam); 2435 2558 } … … 2438 2561 AddVisibleNodeGeometryToQueue(visibleNodes, cam); 2439 2562 } 2440 2563 2564 // reset depth pass 2565 mUseDepthPass = savedUseDepthPass; 2566 2441 2567 delete queryManager; 2442 2568 } -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionQueriesQueryManager.cpp
r2183 r2254 94 94 95 95 96 /* Two query lists for projected pixels and for visibile pixels:96 /** Two query lists for projected pixels and for visibile pixels: 97 97 We test queries after a rendering pass 98 98 to get exact visibility with regard to the current camera. … … 191 191 } 192 192 193 //////////////////////////// 194 //-- queries for geometry: if item buffer, capture only projected visibility 193 /////////////// 194 //-- queries for geometry 195 196 // note: for item buffer we can capture only projected visibility 195 197 196 198 if ((mItemBufferMode != GEOMETRY_VISIBILITY) || (i == 1)) … … 202 204 } 203 205 204 /////////////// /////////205 //-- queries for patches : if item buffer, capture only projected visibility206 /////////////// 207 //-- queries for patches 206 208 207 209 if ((mItemBufferMode != PATCH_VISIBILITY) || (i == 1)) … … 421 423 422 424 // WARNING: approximate depth ordering during rendering => 423 // geometry maybe occluded425 // visibility approximate 424 426 if (visiblePixels > 0) 425 427 { -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgrePlatformHierarchyInterface.cpp
r2184 r2254 229 229 //----------------------------------------------------------------------- 230 230 GtpVisibility::OcclusionQuery *PlatformHierarchyInterface::IssueMeshOcclusionQuery( 231 GtpVisibility::Mesh *mesh)231 GtpVisibility::Mesh *mesh) 232 232 { 233 233 // get next available test id -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/Plugin_VisibilitySceneManager.vcproj
r2253 r2254 53 53 Name="VCPostBuildEventTool" 54 54 CommandLine="copy $(OutDir)\$(TargetFileName) $(OGRE_PATH)\Samples\Common\bin\$(ConfigurationName) 55 copy $(OutDir)\$(TargetFileName) D:\svn\gametools\GTP\trunk\App\Demos\Illum\Ogre\bin\$(ConfigurationName)55 copy $(OutDir)\$(TargetFileName) E:\svn\gametools\GTP\trunk\App\Demos\Illum\Ogre\bin\$(ConfigurationName) 56 56 "/> 57 57 <Tool … … 89 89 OmitFramePointers="TRUE" 90 90 EnableFiberSafeOptimizations="TRUE" 91 OptimizeForProcessor=" 3"91 OptimizeForProcessor="0" 92 92 OptimizeForWindowsApplication="TRUE" 93 93 AdditionalIncludeDirectories=""$(OGRE_PATH)\PlugIns\OctreeSceneManager\include";"$(OGRE_PATH)\Samples\Common\include";"$(OGRE_PATH)\Dependencies\include\CEGUI";"$(OGRE_PATH)\Samples\Common\CEGUIRenderer\include";"$(OGRE_PATH)\OgreMain\include";"$(OGRE_PATH)\Dependencies\include";..\include;..\..\..\OnlineCullingCHC\include;..\..\..\Preprocessing\src;..\..\..\..\..\Lib\Vis\OnlineCullingCHC\IVReader\include;..\..\..\Preprocessing\src\Timer;..\..\..\..\..\Lib\Vis\OnlineCullingCHC\ObjReader\include" … … 124 124 <Tool 125 125 Name="VCPostBuildEventTool" 126 CommandLine="copy $(OutDir)\$(TargetFileName) $(OGRE_PATH)\Samples\Common\bin\$(ConfigurationName)"/> 126 CommandLine="copy $(OutDir)\$(TargetFileName) $(OGRE_PATH)\Samples\Common\bin\$(ConfigurationName) 127 copy $(OutDir)\$(TargetFileName) E:\svn\gametools\GTP\trunk\App\Demos\Illum\Ogre\bin\$(ConfigurationName) 128 "/> 127 129 <Tool 128 130 Name="VCPreBuildEventTool"/> … … 299 301 OptimizeForProcessor="3" 300 302 OptimizeForWindowsApplication="TRUE" 301 AdditionalIncludeDirectories=""$(OGRE_PATH)\PlugIns\OctreeSceneManager\include";"$(OGRE_PATH)\Samples\Common\include";"$(OGRE_PATH)\Dependencies\include\CEGUI";"$(OGRE_PATH)\Samples\Common\CEGUIRenderer\include";"$(OGRE_PATH)\OgreMain\include";"$(OGRE_PATH)\Dependencies\include";..\include;..\..\..\OnlineCullingCHC\include;..\..\..\Preprocessing\src;..\..\..\..\..\Lib\Vis\OnlineCullingCHC\IVReader\include;..\..\..\..\..\Lib\Vis\OnlineCullingCHC\ObjReader\include ;Timer"303 AdditionalIncludeDirectories=""$(OGRE_PATH)\PlugIns\OctreeSceneManager\include";"$(OGRE_PATH)\Samples\Common\include";"$(OGRE_PATH)\Dependencies\include\CEGUI";"$(OGRE_PATH)\Samples\Common\CEGUIRenderer\include";"$(OGRE_PATH)\OgreMain\include";"$(OGRE_PATH)\Dependencies\include";..\include;..\..\..\OnlineCullingCHC\include;..\..\..\Preprocessing\src;..\..\..\..\..\Lib\Vis\OnlineCullingCHC\IVReader\include;..\..\..\..\..\Lib\Vis\OnlineCullingCHC\ObjReader\include" 302 304 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;GTP_VISIBILITY_MODIFIED_OGRE;PLUGIN_KD_TERRAIN_EXPORTS" 303 305 StringPooling="TRUE" -
GTP/trunk/Lib/Vis/OnlineCullingCHC/ObjReader/src/ObjReader.vcproj
r2199 r2254 96 96 Name="VCMIDLTool"/> 97 97 <Tool 98 Name="VCPostBuildEventTool" 99 CommandLine="copy $(OutDir)\$(TargetFileName) "$(OGRE_PATH)\Samples\Common\bin\$(ConfigurationName)""/> 98 Name="VCPostBuildEventTool"/> 100 99 <Tool 101 100 Name="VCPreBuildEventTool"/> -
GTP/trunk/Lib/Vis/OnlineCullingCHC/scripts/terrainCulling.cfg
r2177 r2254 9 9 10 10 # 11 # Should depth first pass be used? 11 # Should depth first pass be used? depth pass renders depth first, then rerenders geometry with all parameters 12 12 # 13 13 14 DepthPass=1 14 DepthPass=0 15 16 # 17 # render queue is flushed after some frames 18 # 19 20 FlushQueue=1 21 22 15 23 16 24 ###################################################################### … … 29 37 #Scene=../../../../../resources/media/city1.iv;../../../../../resources/media/roofs_1500.iv;../../../../../resources/media/CityRoads60.iv;../../../../../resources/media/CityPlane60.iv 30 38 39 #Scene=vienna_cropped.obj 40 31 41 # 32 # The view cells42 # Visibility solution 33 43 # 34 44 35 45 #ViewCells=../../../../../../../GTP/trunk/Lib/Vis/Preprocessing/scripts/vienna-visibility.xml.gz 36 37 38 #39 # render queue is flushed after some frames40 #41 42 FlushQueue=143 44 #45 # depth pass must be used together with illumination model46 #47 48 UseDepthPass=049 46 50 47
Note: See TracChangeset
for help on using the changeset viewer.