Changeset 1602 for GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE
- Timestamp:
- 10/10/06 16:42:41 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreOcclusionCullingSceneManager.h
r1593 r1602 140 140 */ 141 141 void CreateViewCellsGeometry(); 142 142 void VisualizeViewCells(const bool visualize); 143 143 144 144 ////////////////////////////////////////// -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionCullingSceneManager.cpp
r1597 r1602 147 147 148 148 setupTerrainMaterial(); 149 150 149 setupTerrainPages(); 151 150 … … 179 178 if (mCurrentViewCell && mCurrentViewCell->GetMesh()) 180 179 { 181 const int id = mCurrentViewCell->GetId(); 182 mViewCellsGeometry[id]->_updateRenderQueue(getRenderQueue()); 183 } 184 180 const bool showSingleViewCell = true; 181 if (showSingleViewCell) 182 { 183 const int id = mCurrentViewCell->GetId(); 184 mViewCellsGeometry[id]->_updateRenderQueue(getRenderQueue()); 185 186 GtpVisibilityPreprocessor::ObjectPvsMap::const_iterator oit, oit_end = mCurrentViewCell->GetPvs().mEntries.end(); 187 188 for (oit = mCurrentViewCell->GetPvs().mEntries.begin(); oit != oit_end; ++ oit) 189 { 190 OgreMeshInstance *obj = static_cast<OgreMeshInstance *>((*oit).first); 191 obj->GetEntity()->_updateRenderQueue(getRenderQueue()); 192 } 193 } 194 else 195 { 196 MovableObjectsMap::const_iterator mit, mit_end = mViewCellsGeometry.end(); 197 198 for (mit = mViewCellsGeometry.begin(); mit != mit_end; ++ mit) 199 { 200 (*mit).second->_updateRenderQueue(getRenderQueue()); 201 } 202 } 203 } 204 /* 185 205 if (mRenderNodesForViz || mRenderNodesContentForViz) 186 206 { … … 206 226 207 227 // add bounding boxes instead of node itself 208 //(*it)->_addBoundingBoxToQueue(getRenderQueue()); 228 if (0) 229 (*it)->_addBoundingBoxToQueue(getRenderQueue()); 209 230 } 210 231 211 232 // add renderables itself 212 if ( 0 &&mRenderNodesContentForViz)233 if (mRenderNodesContentForViz) 213 234 { 214 235 (*it)->_addToRenderQueue(cam, getRenderQueue(), false); 215 236 } 216 237 } 217 } 238 }*/ 218 239 } 219 240 //----------------------------------------------------------------------- … … 297 318 bool onlyShadowCasters) 298 319 { 299 ///////////300 //-- set visibility according to pvs of current view cell301 302 UpdatePvs(cam);303 304 if (mNormalExecution)305 {306 OctreeSceneManager::_findVisibleObjects(cam, onlyShadowCasters);307 return;308 }309 310 320 if (mShowVisualization) 311 321 { 312 322 ////////////// 313 323 //-- show visible scene nodes and octree bounding boxes from last frame 314 315 324 PrepareVisualization(cam); 316 325 } … … 330 339 // only shadow casters will be rendered in shadow texture pass 331 340 if (0) mHierarchyInterface->SetOnlyShadowCasters(onlyShadowCasters); 341 342 /////////// 343 //-- set visibility according to pvs of current view cell 344 345 UpdatePvs(cam); 346 347 if (mNormalExecution) 348 { 349 OctreeSceneManager::_findVisibleObjects(cam, onlyShadowCasters); 350 //return; 351 } 332 352 } 333 353 … … 339 359 void OcclusionCullingSceneManager::_renderVisibleObjects() 340 360 { 361 341 362 if (mNormalExecution) 342 363 { 343 364 // the standard octree rendering mode 344 OctreeSceneManager::_renderVisibleObjects();365 TerrainSceneManager::_renderVisibleObjects(); 345 366 return; 346 367 } … … 455 476 } 456 477 } 457 /*const bool mVisualizeViewCells = true; 458 if (mVisualizeViewCells) 459 { 460 MovableObjectsMap::const_iterator mit, mit_end = mViewCellsGeometry.end(); 461 462 for (mit = mViewCellsGeometry.begin(); mit != mit_end; ++ mit) 463 { 464 (*mit).second->_updateRenderQueue(getRenderQueue()); 465 } 466 }*/ 467 478 468 479 ///////////// 469 480 //-- now we can render all remaining queue objects … … 600 611 if (key == "UseViewCells") 601 612 { 613 // only use this option if view cells are available 602 614 if (mViewCellsLoaded) 603 615 { … … 611 623 mCurrentViewCell = mViewCellsManager->GenerateViewCell(); 612 624 } 613 625 // view cell corresponding to leaf in the view cell hierarchy 614 626 mElementaryViewCell = NULL; 615 627 616 // if we use view cells, all objects are set to false initially 628 // if we decide use view cells 629 // all objects are set to invisible per default 617 630 SetObjectsVisible(!mUseViewCells); 631 } 632 633 return true; 634 } 635 if (key == "ShowViewCells") 636 { 637 // only use this option if view cells are available 638 if (mViewCellsLoaded) 639 { 640 bool showViewCells = *static_cast<const bool *>(val); 641 // if we decide use view cells 642 // all objects are set to invisible per default 643 VisualizeViewCells(showViewCells); 618 644 } 619 645 … … 1192 1218 getRootSceneNode()->createChildSceneNode()->attachObject(manual); 1193 1219 manual->setQueryFlags(0); // returned by no query 1220 1194 1221 // initialy set to invisible 1195 //manual->setVisible(false); 1196 } 1197 } 1198 1222 manual->setVisible(false); 1223 } 1224 } 1225 //------------------------------------------------------------------------- 1226 void OcclusionCullingSceneManager::VisualizeViewCells(const bool visualize) 1227 { 1228 MovableObjectsMap::const_iterator mit, mit_end = mViewCellsGeometry.end(); 1229 1230 for (mit = mViewCellsGeometry.begin(); mit != mit_end; ++ mit) 1231 { 1232 (*mit).second->setVisible(visualize); 1233 } 1234 } 1199 1235 #if 0 1200 1236 //------------------------------------------------------------------------- … … 1203 1239 // first test for scene node, then for octant (part of the hierarchy) 1204 1240 if (!node->mVisibleChildren) 1241 { 1205 1242 node->setVisible(false); 1243 } 1206 1244 1207 1245 node->getOctant()->mVisibleChildren --; -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionQueriesQueryManager.cpp
r931 r1602 33 33 bool overlayEnabled = mViewport->getOverlaysEnabled(); 34 34 35 /////////// 35 36 //-- render scene with item buffer (i.e., objects with their id as color codes) 36 37 //mItemBufferMode = 0; -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreTypeConverter.cpp
r1593 r1602 54 54 const GtpVisibilityPreprocessor::Vector3 vtx = *vit; 55 55 manual->position(vtx.x, vtx.y, vtx.z); 56 manual->colour(1.0f, 0.0f, 0.0f); 56 57 } 57 58
Note: See TracChangeset
for help on using the changeset viewer.