Changeset 2455 for GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE
- Timestamp:
- 06/14/07 17:24:08 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreOctreeHierarchyInterface.h
r2332 r2455 64 64 65 65 void PullUpLastVisited(GtpVisibility::HierarchyNode *node, const int frameId) const; 66 void DetermineVisibilityRatio(GtpVisibility::HierarchyNode *node) const;67 float GetNodeVisibilityRatio(GtpVisibility::HierarchyNode *node) const;66 67 GtpVisibility::HierarchyNode *GetParent(GtpVisibility::HierarchyNode *node); 68 68 69 GtpVisibility::HierarchyNode *GetParent(GtpVisibility::HierarchyNode *node); 69 70 71 /** Returns #frames this node is assumed to be visible. 72 */ 73 int GetNodeAssumedVisible(GtpVisibility::HierarchyNode *node); 74 75 /** Sets #frames this node is assumed to be visible. 76 */ 77 void SetNodeAssumedVisible(GtpVisibility::HierarchyNode *node, int assumedVisible); 78 79 /** Decreases #frames this node is assumed to be visible. 80 */ 81 void DecNodeAssumedVisible(GtpVisibility::HierarchyNode *node); 82 83 void RenderGeometryBounds(GtpVisibility::HierarchyNode *node); 70 84 71 85 … … 77 91 */ 78 92 AxisAlignedBox *GetBoundingBox(GtpVisibility::HierarchyNode *node); 93 79 94 /** Returns squared distance of center of box with respect to the camera . 80 95 @param cam current camera -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgrePlatformHierarchyInterface.h
r2332 r2455 26 26 { 27 27 public: 28 28 29 /** Construction taking the current scene manager and the 29 30 current rendersystem as argument … … 33 34 PlatformHierarchyInterface(SceneManager *sm, RenderSystem *rsys); 34 35 ~PlatformHierarchyInterface(); 35 36 36 /** Returns next available occlusion query or creates new one. 37 37 @return the next occlusion query … … 76 76 /** Issue a occlusion query for this node. 77 77 @param node the current hierarchy node 78 @param wasVisible if the node was visible in the last frame 78 @param gives a parameters that decideds on the type of occlusion query. 79 79 80 @returns occlusion query for this node 80 81 */ 81 82 GtpVisibility::OcclusionQuery *IssueNodeOcclusionQuery( 82 GtpVisibility::HierarchyNode *node, const bool wasVisible);83 GtpVisibility::HierarchyNode *node, const bool testGeometry = false); 83 84 84 85 /** Issue a occlusion query for this mesh. … … 87 88 */ 88 89 GtpVisibility::OcclusionQuery *IssueMeshOcclusionQuery(GtpVisibility::Mesh *mesh); 89 90 90 /** If true, the interface finds and renders only objects which are marked as shadow casters. 91 91 @remark This is important for the shadow texture pass … … 95 95 */ 96 96 bool GetOnlyShadowCasters(); 97 /** see set98 */99 bool GetTestGeometryForVisibleLeaves();100 97 /** see set 101 98 */ 102 99 SceneManager *GetSceneManager(); 103 104 100 /** see set 105 101 */ 106 102 RenderSystem *GetRenderSystem(); 107 108 103 /** true if bounding box query is currently active. 109 104 */ 110 105 bool IsBoundingBoxQuery(); 111 106 /** Issues occlusion queries for a patch. 107 */ 112 108 GtpVisibility::OcclusionQuery *IssuePatchOcclusionQuery(GtpVisibility::Patch *patch); 113 114 109 /** Deletes all occlusion queries. 115 110 */ … … 126 121 127 122 void PullUpLastVisited(GtpVisibility::HierarchyNode *node, const int frameId) const {} 128 void DetermineVisibilityRatio(GtpVisibility::HierarchyNode *node) const {}129 123 130 float GetNodeVisibilityRatio(GtpVisibility::HierarchyNode *node) const { return 1.0f;}124 GtpVisibility::HierarchyNode *GetParent(GtpVisibility::HierarchyNode *node) { return NULL; } 131 125 132 GtpVisibility::HierarchyNode *GetParent(GtpVisibility::HierarchyNode *node) { return NULL;} 126 /** Returns #frames this node is assumed to be visible. 127 */ 128 virtual int GetNodeAssumedVisible(GtpVisibility::HierarchyNode *node) { return 0; }; 129 /** Sets #frames this node is assumed to be visible. 130 */ 131 virtual void SetNodeAssumedVisible(GtpVisibility::HierarchyNode *node, int assumedVisible) {}; 132 /** Decreases #frames this node is assumed to be visible. 133 */ 134 virtual void DecNodeAssumedVisible(GtpVisibility::HierarchyNode *node) {}; 135 /** Test tigher geometry bounds instead of hierarchy node. 136 */ 137 void SetTestGeometryBounds(bool testGeometryForLeaves); 138 /** See get 139 */ 140 int GetTestGeometryBounds(); 133 141 134 142 … … 138 146 */ 139 147 void RenderGeometry(GtpVisibility::Mesh *geom); 140 141 148 /** Renders the given patch 142 149 */ 143 150 void RenderPatch(GtpVisibility::Patch *patch); 144 145 151 /** Materials for visualizing frustum and query culled nodes. 146 152 */ 147 153 void CreateNodeVizMaterials(); 148 149 154 /** Returns pointer to current renderable bounding box geometry. 150 155 */ 151 156 SolidBoundingBox *GetSolidBoundingBox(); 152 153 /** A pass that prepares an occlusion query.154 @remark disables depth write, colour write, lighting,155 vertex and fragment program.*/156 //void SetOcclusionPass();157 158 157 /** Renders given bounding box. 159 158 @param box the bounding box of the scene node to be rendered 160 159 */ 161 160 void RenderBoundingBox(AxisAlignedBox *box); 161 /** Renders bounding boxes of the geometry. 162 @param node the node to be rendered 163 */ 164 virtual void RenderGeometryBounds(GtpVisibility::HierarchyNode *node) {}; 165 166 167 ///////////////////// 162 168 163 169 /** Renderable of an aabb. … … 179 185 int mLeavePassesInQueue; 180 186 bool mIsBoundingBoxQuery; 187 188 bool mTestGeometryBounds; 181 189 }; 182 190 -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreBiHierarchyInterface.cpp
r2348 r2455 84 84 // reuse box if node is the same 85 85 // only create renderable bounding box for new node 86 if (node != m SavedNode)86 if (node != mOldNode) 87 87 { 88 m SavedNode = node;88 mOldNode = node; 89 89 mBox = BIHNODEPTR_CAST(node)->_getWorldAABB(); 90 90 } -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreBiHierarchySceneManager.cpp
r2402 r2455 1429 1429 d << "Depth pass: " << StringConverter::toString(mUseDepthPass) << ", " 1430 1430 << "Delay transparents: " << StringConverter::toString(mDelayRenderTransparents) << ", " 1431 << "Use optimization: " << StringConverter::toString(mHierarchyInterface->GetTestGeometryForVisibleLeaves()) << ", "1431 //<< "Use optimization: " << StringConverter::toString(mHierarchyInterface->GetTestGeometryForVisibleLeaves()) << ", " 1432 1432 << "Algorithm type: " << mVisibilityManager->GetCullingManagerType() << ", " 1433 1433 << "Hierarchy nodes: " << (mBiHierarchy ? mBiHierarchy->getTreeStats().mNumNodes : 0) << ", " -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreKdTreeHierarchyInterface.cpp
r2280 r2455 84 84 // reuse box if node is the same 85 85 // only create renderable bounding box for new node 86 if (node != m SavedNode)86 if (node != mOldNode) 87 87 { 88 m SavedNode = node;88 mOldNode = node; 89 89 mBox = KDNODEPTR_CAST(node)->_getWorldAABB(); 90 90 } -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreKdTreeSceneManager.cpp
r2130 r2455 1419 1419 d << "Depth pass: " << StringConverter::toString(mUseDepthPass) << ", " 1420 1420 << "Delay transparents: " << StringConverter::toString(mDelayRenderTransparents) << ", " 1421 << "Use optimization: " << StringConverter::toString(mHierarchyInterface->GetTestGeometryForVisibleLeaves()) << ", "1421 //<< "Use optimization: " << StringConverter::toString(mHierarchyInterface->GetTestGeometryForVisibleLeaves()) << ", " 1422 1422 << "Algorithm type: " << mVisibilityManager->GetCullingManagerType() << ", " 1423 1423 << "Hierarchy nodes: " << (mKdTree ? mKdTree->getTreeStats().mNumNodes : 0) << ", " -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionCullingSceneManager.cpp
r2402 r2455 311 311 } 312 312 313 ///////////// 313 314 val = config.getSetting("OnlineCullingAlgorithm"); 314 315 … … 357 358 358 359 ///////////// 359 // terrain options 360 val = config.getSetting("TestGeometryForVisibleLeaves"); 361 362 if (!val.empty()) 363 { 364 if (val == "yes") 365 mVisibilityManager->SetTestGeometryForVisibleLeaves(true); 366 else 367 mVisibilityManager->SetTestGeometryForVisibleLeaves(false); 368 } 369 370 ///////////// 371 val = config.getSetting("TestGeometryBounds"); 372 373 if (!val.empty()) 374 { 375 if (val == "yes") 376 mHierarchyInterface->SetTestGeometryBounds(true); 377 else 378 mHierarchyInterface->SetTestGeometryBounds(false); 379 } 380 381 ///////////// 382 val = config.getSetting("AssumedVisibleFrames"); 383 384 if (!val.empty()) 385 { 386 mVisibilityManager->SetAssumedVisibilityForChc(atoi(val.c_str())); 387 } 388 389 390 ///////////// 391 val = config.getSetting("RandomUpdateCandidates"); 392 393 if (!val.empty()) 394 { 395 mVisibilityManager->SetRandomUpdateCandidatesForRuc(atoi(val.c_str())); 396 } 397 398 399 ///////////// 400 // output 360 401 361 402 if (mUseDepthPass) … … 395 436 else 396 437 LogManager::getSingleton().logMessage("not flushing queue after some frames"); 438 439 if (mVisibilityManager->GetTestGeometryForVisibleLeaves()) 440 LogManager::getSingleton().logMessage("test geometry for visible leaves"); 441 else 442 LogManager::getSingleton().logMessage("not testing geometry for visible leaves"); 443 444 if (mHierarchyInterface->GetTestGeometryBounds()) 445 LogManager::getSingleton().logMessage("test geometry bounds instead of bounding box"); 446 else 447 LogManager::getSingleton().logMessage("not testing geometry bounds instead of bounding box"); 448 449 450 ///////////// 451 // terrain options 397 452 398 453 if (!mShowTerrain) … … 1263 1318 d << "Depth pass: " << StringConverter::toString(mUseDepthPass) << ", " 1264 1319 << "Delay transparents: " << StringConverter::toString(mDelayRenderTransparents) << ", " 1265 << "Use optimization: " << StringConverter::toString(mHierarchyInterface->GetTestGeometryForVisibleLeaves()) << ", "1320 // << "Use optimization: " << StringConverter::toString(mHierarchyInterface->GetTestGeometryForVisibleLeaves()) << ", " 1266 1321 << "Algorithm type: " << mVisibilityManager->GetCullingManagerType() << ", " 1267 1322 << "Hierarchy nodes: " << mNumOctants << ", " … … 1686 1741 LogManager::getSingleton().logMessage("error: should not come here"); 1687 1742 // question: if no view cell, set everything visible? 1688 //SetObjectsVisible(true);1689 1743 SetObjectsVisible(false); 1690 1744 return; … … 1693 1747 //////////// 1694 1748 //-- set PVS of view cell to visible 1695 1696 //std::stringstream d; d << "appying new view cell pvs: " << vc->GetPvs().GetSize();1697 //LogManager::getSingleton().logMessage(d.str());1698 1749 1699 1750 GtpVisibilityPreprocessor::ObjectPvsIterator pit = vc->GetPvs().GetIterator(); … … 1717 1768 const GtpVisibilityPreprocessor::Vector3 viewPoint = 1718 1769 OgreTypeConverter::ConvertFromOgre(cam->getDerivedPosition()); 1719 1720 //std::stringstream d; d << "vp: " << viewPoint;1721 //LogManager::getSingleton().logMessage(d.str());1722 1770 1723 1771 GtpVisibilityPreprocessor::ViewCell *newElementary = … … 2173 2221 } 2174 2222 2175 // Prepare render queue for receiving new objects2176 //prepareRenderQueue();2177 2178 2223 mDestRenderSystem->_beginGeometryCount(); 2179 2224 // Begin the frame … … 2281 2326 /////////////////////// 2282 2327 //-- put items in render queue 2283 //////////2284 2328 2285 2329 getRenderQueue()->clear(); 2286 2330 2287 //////////////////////2288 //-- apply queries on geometry level2289 2290 2331 if (!nodeVisibility) 2291 2332 { 2333 ////////////////// 2334 //-- apply queries on geometry level 2335 2292 2336 MeshInfoContainer::iterator geomIt, geomIt_end = visibleGeometry.end(); 2293 2337 … … 2384 2428 if (camera->isWindowSet()) 2385 2429 { 2386 const std::vector<Plane>& planeList = 2387 camera->getWindowPlanes(); 2388 for (ushort i = 0; i < 4; ++ i)2430 const std::vector<Plane>& planeList = camera->getWindowPlanes(); 2431 2432 for (ushort i = 0; i < 4; ++ i) 2389 2433 { 2390 2434 mDestRenderSystem->enableClipPlane(i, true); … … 2421 2465 2422 2466 RenderHierarchicalCulling(fillQueue); 2423 // _renderVisibleObjects();2424 2467 2425 2468 // End frame … … 2529 2572 2530 2573 if (mQueryMode == 2) 2531 {2532 2574 approximateVisibility = true; 2533 }2534 2575 } 2535 2576 else … … 2542 2583 new OcclusionQueriesQueryManager(mHierarchyInterface, 2543 2584 cam->getViewport(), 2544 //mCurrentViewport,2545 2585 queryModes, 2546 2586 itemBufferMode); -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOctreeHierarchyInterface.cpp
r2360 r2455 3 3 #include <OgreLogManager.h> 4 4 #include <OgreStringConverter.h> 5 #include <OgreOctreeNode.h> 5 6 6 7 … … 187 188 } 188 189 //----------------------------------------------------------------------- 189 void OctreeHierarchyInterface::DetermineVisibilityRatio(GtpVisibility::HierarchyNode *node) const190 {191 #if 0192 Octree *octant = static_cast<Octree *>(node);193 194 // node not visited in this frame => no change195 if (octant->lastVisited() != mFrameId)196 return;197 198 // leaf node: terminate recursion199 if (IsLeaf(node))200 {201 octant->setNumLeaves(1);202 octant->setNumVisibleLeaves(octant->isOctreeVisible() ? 1 : 0);203 return;204 }205 206 int numVisibleLeaves = 0;207 int numLeaves = 0;208 209 Octree *nextChild;210 211 for (int i = 0; i < 8; ++ i)212 {213 int x = (i & 4) / 4;214 int y = (i & 2) / 2;215 int z = i & 1;216 217 nextChild = octant->mChildren[x][y][z];218 219 if (!nextChild)220 continue;221 222 // recursive traversal223 DetermineVisibilityRatio(nextChild);224 225 // this leaf is not fully visible226 numLeaves += nextChild->getNumLeaves();227 numVisibleLeaves += nextChild->getNumVisibleLeaves();228 }229 230 octant->setNumLeaves(numLeaves);231 octant->setNumVisibleLeaves(numVisibleLeaves);232 #endif233 }234 //-----------------------------------------------------------------------235 190 void OctreeHierarchyInterface::RenderNode(GtpVisibility::HierarchyNode *node) 236 191 { … … 290 245 } 291 246 //----------------------------------------------------------------------- 292 float OctreeHierarchyInterface::GetNodeVisibilityRatio(GtpVisibility::HierarchyNode *node) const293 {294 #if 0295 return static_cast<Octree *>(node)->getVisibilityRatio();296 #else297 return 1.0f;298 #endif299 }300 //-----------------------------------------------------------------------301 247 unsigned int OctreeHierarchyInterface::LastVisited(GtpVisibility::HierarchyNode *node) const 302 248 { … … 312 258 // reuse box if node is the same 313 259 // only create renderable bounding box for new node 314 if (node != m SavedNode)315 { 316 m SavedNode = node;260 if (node != mOldNode) 261 { 262 mOldNode = node; 317 263 //static_cast<Octree *>(node)->_getCullBounds(&mBox); 318 264 mBox = static_cast<Octree *>(node)->_getWorldAABB(); … … 374 320 375 321 for (int z = 0; z < 2; ++ z) 376 {377 322 for (int y = 0; y < 2; ++ y) 378 {379 323 for (int x = 0; x < 2; ++ x) 380 {381 324 if ((child = octree->mChildren[x][y][z]) != NULL) 382 {383 325 tStack.push(child); 384 }385 }386 }387 }388 326 } 389 327 } … … 394 332 { 395 333 Octree *octree = static_cast<Octree *>(node); 396 397 334 return octree->getParent(); 398 335 } 336 //----------------------------------------------------------------------- 337 int OctreeHierarchyInterface::GetNodeAssumedVisible(GtpVisibility::HierarchyNode *node) 338 { 339 Octree *octree = static_cast<Octree *>(node); 340 return octree->getAssumedVisible(); 341 } 342 //----------------------------------------------------------------------- 343 void OctreeHierarchyInterface::SetNodeAssumedVisible(GtpVisibility::HierarchyNode *node, int assumedVisible) 344 { 345 Octree *octree = static_cast<Octree *>(node); 346 octree->setAssumedVisible(assumedVisible); 347 } 348 //----------------------------------------------------------------------- 349 void OctreeHierarchyInterface::DecNodeAssumedVisible(GtpVisibility::HierarchyNode *node) 350 { 351 Octree *octree = static_cast<Octree *>(node); 352 octree->decAssumedVisible(); 353 } 354 //----------------------------------------------------------------------- 355 void OctreeHierarchyInterface::RenderGeometryBounds(GtpVisibility::HierarchyNode *node) 356 { 357 Octree *octree = static_cast<Octree *>(node); 358 359 NodeList::iterator it, it_end = octree->mNodes.end(); 360 361 for (it = octree->mNodes.begin(); it != it_end; ++ it) 362 { 363 RenderBoundingBox(&(*it)->_getWorldAABB()); 364 } 365 } 366 399 367 400 368 } // namespace Ogre -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgrePlatformHierarchyInterface.cpp
r2318 r2455 99 99 mRenderSystem->_setWorldMatrix(Ogre::Matrix4::IDENTITY); 100 100 mSceneManager->useRenderableViewProjModeWrapper(solidBox); 101 // HACK! (mySetPass should be setPass)101 102 102 // set no depth write, no color, no lighting material 103 103 mSceneManager->setPassWrapper(solidBox->getTechnique()->getPass(0)); 104 //mSceneManager->_setPass(solidBox->getTechnique()->getPass(0));105 //SetOcclusionPass();106 107 104 solidBox->SetupBoundingBoxVertices(*box); 108 105 109 106 solidBox->getRenderOperation(ro); 110 107 ro.srcRenderable = solidBox; 108 111 109 //std::stringstream d; 112 110 //d << "vt2: " << ro.vertexData; … … 132 130 { 133 131 mOcclusionQueries.push_back(new PlatformOcclusionQuery(mRenderSystem)); 134 135 /*std::stringstream d;136 d << "resizing queries: " << (int)mOcclusionQueries.size() << std::endl;137 LogManager::getSingleton().logMessage(d.str());*/138 132 } 139 133 … … 147 141 GtpVisibility::HierarchyInterface::InitTraversal(); 148 142 149 m SavedNode = NULL;143 mOldNode = NULL; 150 144 mLeavePassesInQueue = leavePassesInQueue; 151 145 … … 181 175 GtpVisibility::OcclusionQuery *PlatformHierarchyInterface::IssueNodeOcclusionQuery( 182 176 GtpVisibility::HierarchyNode *node, 183 const bool wasVisible)177 const bool testGeometry) 184 178 { 185 179 // get next available test id … … 189 183 query->BeginQuery(); 190 184 191 // if node is leaf and was visible => will be rendered anyway. 192 // In this case we can also test with the real geometry. 193 // If camera for culling is different from camera for rendering or only solids 194 // will be rendered => cannot optimize 195 if (mTestGeometryForVisibleLeaves && (mCamera == mCullCamera) && wasVisible && IsLeaf(node)) 196 { 185 if (testGeometry && IsLeaf(node)) 186 { 187 // if node is a leaf and was visible => will be rendered anyway. 188 // In this case we can also test with the real geometry. 197 189 RenderNode(node); 198 190 } 199 else 200 { 201 // this information is used e.g., by the scene graph, because the bounding box 202 // must be treated differently to the scene geometry during rendering 203 mIsBoundingBoxQuery = true; 204 RenderBoundingBox(GetBoundingBox(node)); 205 206 mIsBoundingBoxQuery = false; 191 else 192 { 193 if (mTestGeometryBounds && IsLeaf(node)) 194 { 195 mIsBoundingBoxQuery = true; 196 // we can also test the tighter bounds of the geometry instead of the hierarchy nodes. 197 RenderGeometryBounds(node); 198 mIsBoundingBoxQuery = false; 199 } 200 else 201 { 202 // this information is used e.g., by the scene graph, because the bounding box 203 // must be treated differently to the scene geometry during rendering 204 mIsBoundingBoxQuery = true; 205 RenderBoundingBox(GetBoundingBox(node)); 206 mIsBoundingBoxQuery = false; 207 } 207 208 } 208 209 … … 236 237 //////// 237 238 //-- the actual query test 238 239 239 query->BeginQuery(); 240 240 241 RenderGeometry(mesh); 242 241 243 query->EndQuery(); 242 244 … … 244 246 } 245 247 //----------------------------------------------------------------------- 246 /*void PlatformHierarchyInterface::SetOcclusionPass()247 {248 // disable vertex and fragment program249 mRenderSystem->unbindGpuProgram(GPT_VERTEX_PROGRAM);250 mRenderSystem->unbindGpuProgram(GPT_FRAGMENT_PROGRAM);251 252 // disable lighting253 mRenderSystem->setLightingEnabled(false);254 255 // Disable remaining texture units256 mRenderSystem->_disableTextureUnitsFrom(0);257 258 //--Set up non-texture related material settings259 260 // Depth buffer settings261 mRenderSystem->_setDepthBufferParams(true, false, CMPF_LESS_EQUAL);262 // Set colour write mode off263 mRenderSystem->_setColourBufferWriteEnabled(false, false, false, false);264 }*/265 //-----------------------------------------------------------------------266 248 SolidBoundingBox *PlatformHierarchyInterface::GetSolidBoundingBox() 267 249 { 268 250 if (!mSolidBoundingBox) 269 {270 251 mSolidBoundingBox = new SolidBoundingBox; 271 //LogManager::getSingleton().logMessage("solid box created");272 }273 252 274 253 return mSolidBoundingBox; … … 285 264 } 286 265 //----------------------------------------------------------------------- 287 bool PlatformHierarchyInterface::GetTestGeometryForVisibleLeaves()288 {289 return mTestGeometryForVisibleLeaves;290 }291 //-----------------------------------------------------------------------292 266 bool PlatformHierarchyInterface::IsBoundingBoxQuery() 293 267 { … … 314 288 return mRenderSystem; 315 289 } 290 //----------------------------------------------------------------------- 291 void PlatformHierarchyInterface::SetTestGeometryBounds(bool testGeometryBounds) 292 { 293 mTestGeometryBounds = testGeometryBounds; 294 } 295 //----------------------------------------------------------------------- 296 int PlatformHierarchyInterface::GetTestGeometryBounds() 297 { 298 return mTestGeometryBounds; 299 } 316 300 317 301 } // namespace Ogre -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgrePlatformQueryManager.cpp
r2280 r2455 12 12 namespace Ogre { 13 13 14 //----------------------------------------------------------------------- 15 /* 16 PlatformQueryManager::PlatformQueryManager(PlatformHierarchyInterface *hierarchyInterface, 17 Viewport *vp, 18 int queryModes): 19 //QueryManager(hierarchyInterface, queryModes), 20 QueryManager(queryModes), 21 mViewport(vp), 22 mWasInitialised(false), 23 mHierarchyInterface(hierarchyInterface) 24 { 25 }*/ 26 //----------------------------------------------------------------------- 27 /*bool PlatformQueryManager::ShootRay(const Ray &ray, 28 std::vector<Mesh *> *visibleMeshes, 29 bool isGlobalLine) 30 { 31 // run OGRE ray shooting query 32 return false; 33 }*/ 14 34 15 //----------------------------------------------------------------------- 35 16 void PlatformQueryManager::ComputeFromPointVisibility( … … 41 22 const bool approximateVisibility) 42 23 { 43 SceneManager *sm = 44 static_cast<PlatformHierarchyInterface *> 24 SceneManager *sm = static_cast<PlatformHierarchyInterface *> 45 25 (mHierarchyInterface)->GetSceneManager(); 46 26 … … 95 75 relativeVisibility, 96 76 approximateVisibility); 97 //mViewport->getTarget()->update(); for(int j=0; j<10000000; j++) printf("wait");98 77 99 78 // permute directions … … 176 155 uchar *buf = mViewport->getTarget()->getBufferContents(dimx, dimy); 177 156 178 //std::stringstream d; d << "dimx: " << dimx << ", dimy: " << dimy; LogManager::getSingleton().logMessage(d.str());179 180 157 // loop through frame buffer and collect visible pixels 181 158 for (int idx = 0; idx < dimy * dimx * 3; idx += 3) … … 185 162 id += buf[idx + 1] << 8; 186 163 id += buf[idx + 2]; 187 188 //std::stringstream d; d << "myid: " << (int)buf[idx] << " " << (int)buf[idx + 1] << " " << (int)buf[idx + 2]; LogManager::getSingleton().logMessage(d.str());189 164 190 165 // if valid id <= add visibility (id values start at 1) -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreSceneContentGenerator.cpp
r2280 r2455 12 12 namespace Ogre { 13 13 14 15 14 16 /*************************************************************/ 15 17 /* SceneContentGenerator implementation */ … … 169 171 &mScale.x, &mScale.y, &mScale.z); 170 172 171 GenerateSceneObject(position, orientation, objName); 172 173 //std::stringstream d; d << StringConverter::toString(position) << " " << StringConverter::toString(orientation); 174 //LogManager::getSingleton().logMessage(d.str()); 175 } 173 GenerateSceneObject(position, orientation, objName); 174 } 175 176 176 ifstr.close(); 177 177 -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreSceneNodeHierarchyInterface.cpp
r2280 r2455 121 121 { 122 122 // only create renderable bounding box for new node 123 if (node != m SavedNode)123 if (node != mOldNode) 124 124 { 125 m SavedNode = node;125 mOldNode = node; 126 126 mBox = static_cast<SceneNode *>(node)->_getWorldAABB(); 127 127 } … … 151 151 { 152 152 Entity *ent = static_cast<Entity *>(movable); 153 //std::stringstream d; d << "ent " << ent->getName();154 //LogManager::getSingleton().logMessage(d.str());155 153 geometryList->push_back(ent); 156 154 } -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreSolidBoundingBox.cpp
r2184 r2455 71 71 /// Upload the index data to the card 72 72 ibuf->writeData(0, ibuf->getSizeInBytes(), faces, true); 73 //mRenderOp.useSharedVertices = true;74 73 mRenderOp.indexData->indexBuffer = ibuf; 75 74 // set material with no lighting, no color, no depth write 76 75 SetOcclusionQueryMaterial(); 77 //setMaterial("BaseWhiteNoLighting");78 79 /* std::stringstream d;80 d << "vtx: " << mRenderOp.vertexData;81 LogManager::getSingleton().logMessage(d.str());82 */83 84 76 } 85 77 //----------------------------------------------------------------------- -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreVisibilityOptionsManager.cpp
r2171 r2455 24 24 return true; 25 25 } 26 26 27 if (key == "Threshold") 27 28 { … … 36 37 if (key == "TestGeometryForVisibleLeaves") 37 38 { 38 m HierarchyInterface->TestGeometryForVisibleLeaves(*static_cast<const bool *>(val));39 mVisibilityManager->SetTestGeometryForVisibleLeaves(*static_cast<const bool *>(val)); 39 40 return true; 40 41 } … … 75 76 return true; 76 77 } 78 if (key == "TestGeometryForVisibleLeaves") 79 { 80 * static_cast<bool *>(val) = 81 mVisibilityManager->GetTestGeometryForVisibleLeaves(); 82 return true; 83 } 84 if (key == "AssumedVisibility") 85 { 86 * static_cast<unsigned int *>(val) = 87 mVisibilityManager->GetAssumedVisibilityForChc(); 88 return true; 89 } 90 if (key == "TestGeometryForVisibleLeaves") 91 { 92 * static_cast<unsigned int *>(val) = 93 mVisibilityManager->GetRandomUpdateCandidatesForRuc(); 94 return true; 95 } 77 96 78 97 return false;
Note: See TracChangeset
for help on using the changeset viewer.