Changeset 2555 for GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE
- Timestamp:
- 10/05/07 15:36:52 (17 years ago)
- Location:
- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreOctreeHierarchyInterface.h
r2455 r2555 33 33 */ 34 34 void TraverseNode(GtpVisibility::HierarchyNode *node); 35 void TraverseNode2(GtpVisibility::HierarchyNode *node); 35 36 /** @copydoc HierarchyInterface::RenderNode */ 36 37 void RenderNode(GtpVisibility::HierarchyNode *node); … … 83 84 void RenderGeometryBounds(GtpVisibility::HierarchyNode *node); 84 85 86 void AddToQueue(GtpVisibility::HierarchyNode *node); 87 88 void RenderQueue(); 85 89 86 90 protected: -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgrePlatformHierarchyInterface.h
r2455 r2555 140 140 int GetTestGeometryBounds(); 141 141 142 142 virtual void AddToQueue(GtpVisibility::HierarchyNode *node) {}; 143 144 virtual void RenderQueue() {}; 145 146 virtual void TraverseNode2(GtpVisibility::HierarchyNode *node) {}; 147 143 148 protected: 144 149 … … 187 192 188 193 bool mTestGeometryBounds; 194 195 bool mTestMode; 189 196 }; 190 197 -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreBiHierarchySceneManager.cpp
r2542 r2555 218 218 { 219 219 mRenderMethod = rm; 220 int cmt = GtpVisibility::VisibilityEnvironment:: RANDOM_UPDATE_CULLING;220 int cmt = GtpVisibility::VisibilityEnvironment::COHERENT_HIERARCHICAL_CULLING_PLUSPLUS; 221 221 return VisibilityOptionsManager(mVisibilityManager, mHierarchyInterface) 222 222 .setOption("Algorithm", &cmt); … … 242 242 else if (val == GtpVisibility::VisibilityEnvironment::COHERENT_HIERARCHICAL_CULLING) 243 243 mRenderMethod = BiHierarchy::BIHRM_GTP_CHC; 244 else if (val == GtpVisibility::VisibilityEnvironment:: RANDOM_UPDATE_CULLING)244 else if (val == GtpVisibility::VisibilityEnvironment::COHERENT_HIERARCHICAL_CULLING_PLUSPLUS) 245 245 mRenderMethod = BiHierarchy::BIHRM_GTP_RU; 246 246 // default, should never happen -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionCullingSceneManager.cpp
r2547 r2555 323 323 LogManager::getSingleton().logMessage("Using stop and wait algorithm"); 324 324 } 325 else if (val == " RUC")325 else if (val == "CHC++") 326 326 { 327 327 algorithm = 328 GtpVisibility::VisibilityEnvironment:: RANDOM_UPDATE_CULLING;329 330 LogManager::getSingleton().logMessage("Using random update culling");328 GtpVisibility::VisibilityEnvironment::COHERENT_HIERARCHICAL_CULLING_PLUSPLUS; 329 330 LogManager::getSingleton().logMessage("Using chc ++"); 331 331 } 332 332 else if (val == "VFC") -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOctreeHierarchyInterface.cpp
r2455 r2555 32 32 Octree *nextChild; 33 33 34 for (int z = 0; z < 2; ++ z) 35 { 36 for (int y = 0; y < 2; ++ y) 37 { 38 for (int x = 0; x < 2; ++ x) 39 { 40 nextChild = octree->mChildren[x][y][z]; 41 42 if (nextChild) 43 GetQueue()->push(nextChild); 44 } 45 } 46 } 34 nextChild = octree->mChildren[0][0][0]; if (nextChild) GetQueue()->push(nextChild); 35 nextChild = octree->mChildren[1][0][0]; if (nextChild) GetQueue()->push(nextChild); 36 nextChild = octree->mChildren[0][1][0]; if (nextChild) GetQueue()->push(nextChild); 37 nextChild = octree->mChildren[1][1][0]; if (nextChild) GetQueue()->push(nextChild); 38 nextChild = octree->mChildren[0][0][1]; if (nextChild) GetQueue()->push(nextChild); 39 nextChild = octree->mChildren[1][0][1]; if (nextChild) GetQueue()->push(nextChild); 40 nextChild = octree->mChildren[0][1][1]; if (nextChild) GetQueue()->push(nextChild); 41 nextChild = octree->mChildren[1][1][1]; if (nextChild) GetQueue()->push(nextChild); 42 } 43 } 44 //----------------------------------------------------------------------- 45 void OctreeHierarchyInterface::TraverseNode2(GtpVisibility::HierarchyNode *node) 46 { 47 ++ mNumTraversedNodes; 48 49 Octree *octree = static_cast<Octree *>(node); 50 51 // if we come across some renderable geometry => render it 52 if (!octree->mNodes.empty()) 53 { 54 AddToQueue(node); 55 } 56 57 // if not all subtrees are empty 58 if (!IsLeaf(node)) 59 { 60 Octree *nextChild; 61 62 nextChild = octree->mChildren[0][0][0]; if (nextChild) GetQueue()->push(nextChild); 63 nextChild = octree->mChildren[1][0][0]; if (nextChild) GetQueue()->push(nextChild); 64 nextChild = octree->mChildren[0][1][0]; if (nextChild) GetQueue()->push(nextChild); 65 nextChild = octree->mChildren[1][1][0]; if (nextChild) GetQueue()->push(nextChild); 66 nextChild = octree->mChildren[0][0][1]; if (nextChild) GetQueue()->push(nextChild); 67 nextChild = octree->mChildren[1][0][1]; if (nextChild) GetQueue()->push(nextChild); 68 nextChild = octree->mChildren[0][1][1]; if (nextChild) GetQueue()->push(nextChild); 69 nextChild = octree->mChildren[1][1][1]; if (nextChild) GetQueue()->push(nextChild); 47 70 } 48 71 } … … 195 218 if (octant->lastRendered() != mFrameId) 196 219 { 220 mTestMode = false; 221 197 222 octant->setLastRendered(mFrameId); 198 223 OctreeSceneManager *ocm = 199 224 static_cast<OctreeSceneManager *>(mSceneManager); 200 225 201 ocm->_ renderOctant(mCamera,226 ocm->_addOctantToQueue(mCamera, 202 227 octant, 203 228 mOnlyShadowCasters, 204 229 mLeavePassesInQueue); 205 230 231 ocm->_renderOctant(mLeavePassesInQueue); 232 206 233 mVisibleNodes.push_back(node); 207 234 } 235 #endif 236 } 237 //----------------------------------------------------------------------- 238 void OctreeHierarchyInterface::AddToQueue(GtpVisibility::HierarchyNode *node) 239 { 240 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 241 Octree *octant = static_cast<Octree *>(node); 242 243 if (octant->lastRendered() != mFrameId) 244 { 245 OctreeSceneManager *ocm = 246 static_cast<OctreeSceneManager *>(mSceneManager); 247 248 octant->setLastRendered(mFrameId); 249 250 ocm->_addOctantToQueue(mCamera, 251 octant, 252 mOnlyShadowCasters, 253 mLeavePassesInQueue); 254 255 mVisibleNodes.push_back(node); 256 } 257 #endif 258 } 259 //----------------------------------------------------------------------- 260 void OctreeHierarchyInterface::RenderQueue() 261 { 262 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 263 mTestMode = false; 264 265 OctreeSceneManager *ocm = 266 static_cast<OctreeSceneManager *>(mSceneManager); 267 ocm->_renderOctant(mLeavePassesInQueue); 208 268 #endif 209 269 } -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgrePlatformHierarchyInterface.cpp
r2497 r2555 98 98 99 99 mRenderSystem->_setWorldMatrix(Ogre::Matrix4::IDENTITY); 100 mSceneManager->useRenderableViewProjModeWrapper(solidBox);100 //mSceneManager->useRenderableViewProjModeWrapper(solidBox); 101 101 102 102 // set no depth write, no color, no lighting material 103 mSceneManager->setPassWrapper(solidBox->getTechnique()->getPass(0)); 103 if (!mTestMode) 104 { 105 mTestMode = true; 106 mSceneManager->setPassWrapper(solidBox->getTechnique()->getPass(0)); 107 } 108 104 109 solidBox->SetupBoundingBoxVertices(*box); 105 110 … … 147 152 // create materials for node visualization 148 153 CreateNodeVizMaterials(); 154 155 mTestMode = false; 149 156 } 150 157 //----------------------------------------------------------------------- -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgrePlatformOcclusionQuery.cpp
r944 r2555 29 29 const bool waitForResult) const 30 30 { 31 // return mHardwareOcclusionQuery->pullOcclusionQuery(&visiblePixels, waitForResult); 32 33 bool isAvailable = true; 34 35 if (!waitForResult) 31 if (waitForResult || !mHardwareOcclusionQuery->isStillOutstanding()) 36 32 { 37 isAvailable = !mHardwareOcclusionQuery->isStillOutstanding(); 33 //return mHardwareOcclusionQuery->pullOcclusionQuery(&visiblePixels); 34 mHardwareOcclusionQuery->pullOcclusionQuery(&visiblePixels); 35 return true; 38 36 } 39 37 40 //std::stringstream d; d << mHardwareOcclusionQuery << ", available: " << isAvailable << ", waitforresult: " << waitForResult;41 // Ogre::LogManager::getSingleton().logMessage(d.str());42 43 if (isAvailable)44 return mHardwareOcclusionQuery->pullOcclusionQuery(&visiblePixels);45 46 38 return false; 47 39 }
Note: See TracChangeset
for help on using the changeset viewer.