Changeset 156 for trunk/VUT/Ogre/src/OgreVisibilityTerrainSceneManager.cpp
- Timestamp:
- 07/06/05 02:36:16 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/Ogre/src/OgreVisibilityTerrainSceneManager.cpp
r155 r156 9 9 #include <OgreEntity.h> 10 10 #include <OgreSubEntity.h> 11 11 12 12 13 namespace Ogre { … … 31 32 mSkipTransparents(false), 32 33 mSavedShadowTechnique(SHADOWTYPE_NONE), 33 mRenderOnlyBoundingBoxes(false) 34 mRenderHierarchyNodes(false) 35 //mRenderHierarchyNodes(true) 34 36 { 35 37 mHierarchyInterface = new OctreeHierarchyInterface(this, mDestRenderSystem); … … 147 149 //Pass *usedPass = ((mRenderDepthPass && !pass->hasVertexProgram()) ? mDepthPass : pass); 148 150 149 // set depth fill pass only if depth write enabled151 // set depth fill pass if we currently do not make an aabb occlusion query 150 152 Pass *usedPass = (mRenderDepthPass && !mHierarchyInterface->IsBoundingBoxQuery() ? 151 153 mDepthPass : pass); … … 208 210 void VisibilityTerrainSceneManager::_findVisibleObjects(Camera* cam, bool onlyShadowCasters) 209 211 { 212 // clear list of solid boxes (used for item buffer hierarchy node rendering) 213 /*for (int i=0; i<(int)mSolidBoxes.size(); ++i) 214 delete mSolidBoxes[i]; 215 216 mSolidBoxes.clear();*/ 217 210 218 //-- show visible scene nodes and octree bounding boxes from last frame 211 219 if (mShowVisualization) … … 213 221 PrepareVisualization(cam); 214 222 } 215 else if (mRenderOnlyBoundingBoxes) 216 { 223 else if (mRenderHierarchyNodes) 224 { 225 AxisAlignedBox aab; 226 227 228 // get rendered hierarchy nodes from last frame 229 GtpVisibility::HierarchyNodeList *nodeList = mHierarchyInterface->GetRenderedNodes(); 230 GtpVisibility::HierarchyNodeList::iterator nodeIt, nodeIt_end = nodeList->end(); 231 232 for (nodeIt = nodeList->begin(); nodeIt != nodeIt_end; ++nodeIt) 233 { 234 SolidBoundingBox *solidBox = new SolidBoundingBox(); 235 solidBox->SetupBoundingBox(aab); 236 237 Octree *octree = static_cast<Octree *>(*nodeIt); 238 solidBox->setId(octree->getId()); 239 mSolidBoxes.push_back(solidBox); 240 241 aab = octree->_getWorldAABB(); 242 std::stringstream d; d << "bounding box with id: " << octree->getId() << ", " << aab << "\n"; 243 LogManager::getSingleton().logMessage(d.str()); 244 245 getRenderQueue()->addRenderable(solidBox); 246 } 217 247 } 218 248 else … … 233 263 //TerrainSceneManager::_findVisibleObjects(cam, onlyShadowCasters); 234 264 265 // -- delete lists stored for visualization 235 266 mVisible.clear(); 236 267 mBoxes.clear(); 237 238 268 } 239 269 //----------------------------------------------------------------------- … … 246 276 // e.g., visualization, shadow pass 247 277 248 if (mShowVisualization || mRenderOnlyBoundingBoxes || 249 (mShadowTechnique == SHADOWTYPE_TEXTURE_MODULATIVE && mIlluminationStage == IRS_RENDER_TO_TEXTURE)) 278 if (mShowVisualization || mRenderHierarchyNodes || 279 (mShadowTechnique == SHADOWTYPE_TEXTURE_MODULATIVE && 280 mIlluminationStage == IRS_RENDER_TO_TEXTURE)) 250 281 { 251 282 IlluminationRenderStage savedStage = mIlluminationStage; 252 283 253 if (mShowVisualization )254 // disable illumination stage because we want no shadows in visualization284 if (mShowVisualization || mRenderHierarchyNodes) 285 // disable illumination stage because we want no shadows 255 286 mIlluminationStage = IRS_NONE; 256 287 … … 416 447 mUseItemBuffer = (*static_cast<const bool *>(val)); 417 448 return true; 449 } 450 if (key == "RenderHierarchyNodes") 451 { 452 mRenderHierarchyNodes = (*static_cast<const bool *>(val)); 418 453 } 419 454 return VisibilityOptionsManager(mVisibilityManager, mHierarchyInterface). … … 503 538 } 504 539 505 //--- item buffer 540 // --- item buffer 541 506 542 // Iterate through priorities 507 543 RenderQueueGroup::PriorityMapIterator groupIt = pGroup->getIterator(); … … 604 640 605 641 Pass *usedPass = setPass(mItemBufferPass); 606 607 /*if (rend->getId() > 0) 608 { 609 std::stringstream d; d << "item buffer id: " << rend->getId() << ", col: " << col[0] << 610 " " << col[1] << " " << col[2] << " " << col[3]; 611 LogManager::getSingleton().logMessage(d.str()); 612 }*/ 642 613 643 614 644 // Render a single object, this will set up auto params if required
Note: See TracChangeset
for help on using the changeset viewer.