Changeset 720 for GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE
- Timestamp:
- 03/31/06 10:37:45 (19 years ago)
- Location:
- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionCullingSceneManager.cpp
r675 r720 1 #include "Ogre VisibilityTerrainSceneManager.h"1 #include "OgreOcclusionCullingSceneManager.h" 2 2 #include "OgreVisibilityOptionsManager.h" 3 3 #include <OgreMath.h> … … 14 14 15 15 //----------------------------------------------------------------------- 16 VisibilityTerrainSceneManager::VisibilityTerrainSceneManager(16 OcclusionCullingSceneManager::OcclusionCullingSceneManager( 17 17 GtpVisibility::VisibilityManager *visManager): 18 18 mVisibilityManager(visManager), … … 40 40 //mShowBoundingBoxes = true; 41 41 //mShowBoxes = true; 42 //std::stringstream d; d << "here555"; 43 //mDummyLog.open(""); 42 44 43 45 // TODO: set maxdepth to reasonable value … … 45 47 } 46 48 //----------------------------------------------------------------------- 47 void VisibilityTerrainSceneManager::InitDepthPass()49 void OcclusionCullingSceneManager::InitDepthPass() 48 50 { 49 51 MaterialPtr depthMat = MaterialManager::getSingleton().getByName("Visibility/DepthPass"); … … 66 68 } 67 69 //----------------------------------------------------------------------- 68 VisibilityTerrainSceneManager::~VisibilityTerrainSceneManager()70 OcclusionCullingSceneManager::~OcclusionCullingSceneManager() 69 71 { 70 72 OGRE_DELETE(mHierarchyInterface); 71 73 } 72 74 //----------------------------------------------------------------------- 73 void VisibilityTerrainSceneManager::InitItemBufferPass()75 void OcclusionCullingSceneManager::InitItemBufferPass() 74 76 { 75 77 MaterialPtr itemBufferMat = MaterialManager::getSingleton(). … … 95 97 } 96 98 //------------------------------------------------------------------------- 97 void VisibilityTerrainSceneManager::setWorldGeometry( const String& filename )99 void OcclusionCullingSceneManager::setWorldGeometry( const String& filename ) 98 100 { 99 101 // Clear out any existing world resources (if not default) … … 124 126 125 127 //----------------------------------------------------------------------- 126 void VisibilityTerrainSceneManager::PrepareVisualization(Camera *cam)128 void OcclusionCullingSceneManager::PrepareVisualization(Camera *cam) 127 129 { 128 130 // add player camera for visualization purpose … … 173 175 } 174 176 //----------------------------------------------------------------------- 175 Pass * VisibilityTerrainSceneManager::setPass(Pass* pass)177 Pass *OcclusionCullingSceneManager::setPass(Pass* pass) 176 178 { 177 179 // TODO: setting vertex program is not efficient … … 236 238 } 237 239 //----------------------------------------------------------------------- 238 void VisibilityTerrainSceneManager::_findVisibleObjects(Camera* cam,240 void OcclusionCullingSceneManager::_findVisibleObjects(Camera* cam, 239 241 bool onlyShadowCasters) 240 242 { … … 266 268 } 267 269 //----------------------------------------------------------------------- 268 void VisibilityTerrainSceneManager::_renderVisibleObjects()270 void OcclusionCullingSceneManager::_renderVisibleObjects() 269 271 { 270 272 … … 329 331 // hierarchical visibility culling and rendering 330 332 InitVisibilityCulling(mCameraInProgress); 333 334 std::stringstream d; d << "here34\n"; 335 LogManager::getSingleton().logMessage(d.str()); 331 336 332 337 /** … … 376 381 getRenderQueue()->clear(); // finally clear render queue 377 382 OGRE_DELETE(mRenderQueue); // HACK: should be cleared before... 378 //WriteLog(); // write out stats379 380 } 381 382 //----------------------------------------------------------------------- 383 void VisibilityTerrainSceneManager::_updateSceneGraph(Camera* cam)383 WriteLog(); // write out stats 384 385 } 386 387 //----------------------------------------------------------------------- 388 void OcclusionCullingSceneManager::_updateSceneGraph(Camera* cam) 384 389 { 385 390 mVisibilityManager->GetCullingManager()->SetHierarchyInterface(mHierarchyInterface); … … 389 394 } 390 395 //----------------------------------------------------------------------- 391 bool VisibilityTerrainSceneManager::setOption(const String & key, const void * val)396 bool OcclusionCullingSceneManager::setOption(const String & key, const void * val) 392 397 { 393 398 if (key == "UseDepthPass") … … 482 487 } 483 488 //----------------------------------------------------------------------- 484 bool VisibilityTerrainSceneManager::getOption(const String & key, void *val)489 bool OcclusionCullingSceneManager::getOption(const String & key, void *val) 485 490 { 486 491 if (key == "NumHierarchyNodes") … … 494 499 } 495 500 //----------------------------------------------------------------------- 496 bool VisibilityTerrainSceneManager::getOptionValues(const String & key,501 bool OcclusionCullingSceneManager::getOptionValues(const String & key, 497 502 StringVector &refValueList) 498 503 { … … 500 505 } 501 506 //----------------------------------------------------------------------- 502 bool VisibilityTerrainSceneManager::getOptionKeys(StringVector & refKeys)507 bool OcclusionCullingSceneManager::getOptionKeys(StringVector & refKeys) 503 508 { 504 509 return VisibilityOptionsManager(mVisibilityManager, mHierarchyInterface). … … 506 511 } 507 512 //----------------------------------------------------------------------- 508 void VisibilityTerrainSceneManager::setVisibilityManager(GtpVisibility::513 void OcclusionCullingSceneManager::setVisibilityManager(GtpVisibility:: 509 514 VisibilityManager *visManager) 510 515 { … … 512 517 } 513 518 //----------------------------------------------------------------------- 514 GtpVisibility::VisibilityManager * VisibilityTerrainSceneManager::getVisibilityManager( void )519 GtpVisibility::VisibilityManager *OcclusionCullingSceneManager::getVisibilityManager( void ) 515 520 { 516 521 return mVisibilityManager; 517 522 } 518 523 //----------------------------------------------------------------------- 519 void VisibilityTerrainSceneManager::WriteLog()524 void OcclusionCullingSceneManager::WriteLog() 520 525 { 521 526 std::stringstream d; … … 535 540 } 536 541 //----------------------------------------------------------------------- 537 void VisibilityTerrainSceneManager::renderObjects(542 void OcclusionCullingSceneManager::renderObjects( 538 543 const RenderPriorityGroup::TransparentRenderablePassList& objs, 539 544 bool doLightIteration, const LightList* manualLightList) … … 546 551 } 547 552 //----------------------------------------------------------------------- 548 bool VisibilityTerrainSceneManager::validatePassForRendering(Pass* pass)553 bool OcclusionCullingSceneManager::validatePassForRendering(Pass* pass) 549 554 { 550 555 // skip all but first pass if we are doing the depth pass … … 557 562 } 558 563 //----------------------------------------------------------------------- 559 void VisibilityTerrainSceneManager::renderQueueGroupObjects(RenderQueueGroup* pGroup)564 void OcclusionCullingSceneManager::renderQueueGroupObjects(RenderQueueGroup* pGroup) 560 565 { 561 566 if (!mIsItemBufferPhase) … … 576 581 } 577 582 //----------------------------------------------------------------------- 578 void VisibilityTerrainSceneManager::RenderItemBuffer(RenderPriorityGroup* pGroup)583 void OcclusionCullingSceneManager::RenderItemBuffer(RenderPriorityGroup* pGroup) 579 584 { 580 585 // Do solids … … 602 607 for (irend = rendList->begin(); irend != irendend; ++irend) 603 608 { 604 std::stringstream d; d << "itembuffer, pass name: " << 605 ipass->first->getParent()->getParent()->getName(); 606 607 LogManager::getSingleton().logMessage(d.str()); 609 //std::stringstream d; d << "itembuffer, pass name: " << 610 // ipass->first->getParent()->getParent()->getName(); 611 // LogManager::getSingleton().logMessage(d.str()); 608 612 609 613 RenderSingleObjectForItemBuffer(*irend, ipass->first); … … 633 637 } 634 638 //----------------------------------------------------------------------- 635 void VisibilityTerrainSceneManager::RenderSingleObjectForItemBuffer(Renderable *rend, Pass *pass)639 void OcclusionCullingSceneManager::RenderSingleObjectForItemBuffer(Renderable *rend, Pass *pass) 636 640 { 637 641 static LightList nullLightList; … … 678 682 } 679 683 //----------------------------------------------------------------------- 680 GtpVisibility::VisibilityManager * VisibilityTerrainSceneManager::GetVisibilityManager()684 GtpVisibility::VisibilityManager *OcclusionCullingSceneManager::GetVisibilityManager() 681 685 { 682 686 return mVisibilityManager; 683 687 } 684 688 //----------------------------------------------------------------------- 685 void VisibilityTerrainSceneManager::InitVisibilityCulling(Camera *cam)689 void OcclusionCullingSceneManager::InitVisibilityCulling(Camera *cam) 686 690 { 687 691 // reset culling manager stats … … 704 708 mLeavePassesInQueue = 0; 705 709 706 if (!mUseDepthPass && !mUseItemBuffer) 710 // if we have the depth pass or use an item buffer, no passes are left in the queue 711 if (0 && !mUseDepthPass && !mUseItemBuffer) 707 712 { 708 713 if (mShadowTechnique == SHADOWTYPE_STENCIL_ADDITIVE) … … 746 751 mLeavePassesInQueue); 747 752 748 //std::stringstream d; d << "leave passes in queue: " << mLeavePassesInQueue;LogManager::getSingleton().logMessage(d.str()); 749 } 750 //----------------------------------------------------------------------- 751 OctreeHierarchyInterface *VisibilityTerrainSceneManager::GetHierarchyInterface() 753 std::stringstream d; d << "leave passes in queue: " << mLeavePassesInQueue; 754 LogManager::getSingleton().logMessage(d.str()); 755 } 756 //----------------------------------------------------------------------- 757 OctreeHierarchyInterface *OcclusionCullingSceneManager::GetHierarchyInterface() 752 758 { 753 759 return mHierarchyInterface; 754 760 } 755 761 //----------------------------------------------------------------------- 756 void VisibilityTerrainSceneManager::endFrame()762 void OcclusionCullingSceneManager::endFrame() 757 763 { 758 764 TerrainRenderable::ResetRenderLevelIndex(); 759 765 } 760 766 //----------------------------------------------------------------------- 761 Entity* VisibilityTerrainSceneManager::createEntity(const String& entityName,767 Entity* OcclusionCullingSceneManager::createEntity(const String& entityName, 762 768 const String& meshName) 763 769 { … … 775 781 } 776 782 //----------------------------------------------------------------------- 777 void VisibilityTerrainSceneManager::renderAdditiveStencilShadowedQueueGroupObjects(RenderQueueGroup* pGroup)783 void OcclusionCullingSceneManager::renderAdditiveStencilShadowedQueueGroupObjects(RenderQueueGroup* pGroup) 778 784 { 779 785 // only render solid passes during hierarchical culling … … 807 813 } 808 814 //----------------------------------------------------------------------- 809 void VisibilityTerrainSceneManager::renderModulativeStencilShadowedQueueGroupObjects(RenderQueueGroup* pGroup)815 void OcclusionCullingSceneManager::renderModulativeStencilShadowedQueueGroupObjects(RenderQueueGroup* pGroup) 810 816 { 811 817 if (mIsHierarchicalCulling) -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreVisibilityOctreeSceneManager.cpp
r343 r720 681 681 mLeavePassesInQueue = 0; 682 682 683 if ( !mUseDepthPass && !mUseItemBuffer)683 if (0 && !mUseDepthPass && !mUseItemBuffer) 684 684 { 685 685 if (mShadowTechnique == SHADOWTYPE_STENCIL_ADDITIVE) … … 724 724 mLeavePassesInQueue); 725 725 726 //std::stringstream d; d << "leave passes in queue: " << mLeavePassesInQueue;LogManager::getSingleton().logMessage(d.str()); 726 std::stringstream d; d << "leave passes in queue: " << mLeavePassesInQueue; 727 LogManager::getSingleton().logMessage(d.str()); 727 728 } 728 729 //----------------------------------------------------------------------- -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreVisibilityTerrainSceneManager.cpp
r675 r720 1 #include "Ogre OcclusionCullingSceneManager.h"1 #include "OgreVisibilityTerrainSceneManager.h" 2 2 #include "OgreVisibilityOptionsManager.h" 3 3 #include <OgreMath.h> … … 10 10 #include <OgreSubEntity.h> 11 11 12 // HACK 13 const static DEBUG_CHC = false; 12 14 13 15 namespace Ogre { 14 16 15 17 //----------------------------------------------------------------------- 16 OcclusionCullingSceneManager::OcclusionCullingSceneManager(18 VisibilityTerrainSceneManager::VisibilityTerrainSceneManager( 17 19 GtpVisibility::VisibilityManager *visManager): 18 20 mVisibilityManager(visManager), … … 32 34 mSkipTransparents(false), 33 35 mRenderTransparentsForItemBuffer(true), 34 mExecuteVertexProgramForAllPasses( true),36 mExecuteVertexProgramForAllPasses(false), 35 37 mIsHierarchicalCulling(false) 36 38 { 37 39 mHierarchyInterface = new OctreeHierarchyInterface(this, mDestRenderSystem); 38 40 39 //mDisplayNodes = true; 40 //mShowBoundingBoxes = true; 41 //mShowBoxes = true; 41 if (0) 42 { 43 mDisplayNodes = true; 44 mShowBoundingBoxes = true; 45 mShowBoxes = true; 46 } 42 47 43 48 // TODO: set maxdepth to reasonable value … … 45 50 } 46 51 //----------------------------------------------------------------------- 47 void OcclusionCullingSceneManager::InitDepthPass()52 void VisibilityTerrainSceneManager::InitDepthPass() 48 53 { 49 54 MaterialPtr depthMat = MaterialManager::getSingleton().getByName("Visibility/DepthPass"); … … 56 61 57 62 mDepthPass = depthMat->getTechnique(0)->getPass(0); 63 58 64 mDepthPass->setColourWriteEnabled(false); 59 65 mDepthPass->setDepthWriteEnabled(true); 60 66 mDepthPass->setLightingEnabled(false); 67 //mDepthPass->setDepthCheckEnabled(true); 61 68 } 62 69 else … … 66 73 } 67 74 //----------------------------------------------------------------------- 68 OcclusionCullingSceneManager::~OcclusionCullingSceneManager()75 VisibilityTerrainSceneManager::~VisibilityTerrainSceneManager() 69 76 { 70 77 OGRE_DELETE(mHierarchyInterface); 71 78 } 72 79 //----------------------------------------------------------------------- 73 void OcclusionCullingSceneManager::InitItemBufferPass()80 void VisibilityTerrainSceneManager::InitItemBufferPass() 74 81 { 75 82 MaterialPtr itemBufferMat = MaterialManager::getSingleton(). … … 95 102 } 96 103 //------------------------------------------------------------------------- 97 void OcclusionCullingSceneManager::setWorldGeometry( const String& filename )104 void VisibilityTerrainSceneManager::setWorldGeometry( const String& filename ) 98 105 { 99 106 // Clear out any existing world resources (if not default) … … 104 111 ResourceGroupManager::getSingleton().getWorldResourceGroupName()); 105 112 } 113 106 114 mTerrainPages.clear(); 107 // Load the configuration 115 116 // Load the configuration 108 117 loadConfig(filename); 109 118 … … 115 124 float maxAxis = std::max(max_x, max_y); 116 125 maxAxis = std::max(maxAxis, max_z); 117 resize( AxisAlignedBox( 0, 0, 0, maxAxis, maxAxis, maxAxis ));126 resize(AxisAlignedBox(0, 0, 0, maxAxis, maxAxis, maxAxis)); 118 127 119 128 setupTerrainMaterial(); 120 121 129 setupTerrainPages(); 122 123 } 124 125 //----------------------------------------------------------------------- 126 void OcclusionCullingSceneManager::PrepareVisualization(Camera *cam) 130 } 131 132 //----------------------------------------------------------------------- 133 void VisibilityTerrainSceneManager::PrepareVisualization(Camera *cam) 127 134 { 128 135 // add player camera for visualization purpose … … 173 180 } 174 181 //----------------------------------------------------------------------- 175 Pass * OcclusionCullingSceneManager::setPass(Pass* pass)182 Pass *VisibilityTerrainSceneManager::setPass(Pass* pass) 176 183 { 177 184 // TODO: setting vertex program is not efficient … … 179 186 180 187 // set depth fill pass if we currently do not make an aabb occlusion query 181 Pass *usedPass = (mIsDepthPassPhase && !mHierarchyInterface->IsBoundingBoxQuery() ? 182 mDepthPass : pass); 183 184 IlluminationRenderStage savedStage = mIlluminationStage; 188 const bool useDepthPass = 1 && 189 (mIsDepthPassPhase && !mHierarchyInterface->IsBoundingBoxQuery()); 190 191 Pass *usedPass = useDepthPass ? mDepthPass : pass; 192 193 194 const IlluminationRenderStage savedStage = mIlluminationStage; 185 195 186 196 // set illumination stage to NONE so no shadow material is used 187 197 // for depth pass or for occlusion query 188 if (mIsDepthPassPhase || mHierarchyInterface->IsBoundingBoxQuery()) 198 if (1 && 199 (mIsDepthPassPhase || mHierarchyInterface->IsBoundingBoxQuery())) 189 200 { 190 201 mIlluminationStage = IRS_NONE; … … 192 203 193 204 // --- set vertex program of current pass in order to set correct depth 194 if (mExecuteVertexProgramForAllPasses && mIsDepthPassPhase && pass->hasVertexProgram()) 205 if (mExecuteVertexProgramForAllPasses 206 && mIsDepthPassPhase 207 && pass->hasVertexProgram()) 195 208 { 196 209 // add vertex program of current pass to depth pass … … 207 220 } 208 221 } 209 else if (mDepthPass->hasVertexProgram()) 222 else if (mDepthPass->hasVertexProgram()) // reset vertex program 210 223 { 211 224 mDepthPass->setVertexProgram(""); 212 225 } 213 226 214 215 bool IsDepthWrite = usedPass->getDepthWriteEnabled();227 // save old depth write: needed for item buffer 228 const bool IsDepthWrite = usedPass->getDepthWriteEnabled(); 216 229 217 230 // global option which enables / disables depth writes … … 220 233 usedPass->setDepthWriteEnabled(false); 221 234 } 222 //else if (mIsItemBufferPass) {usedPass = mItemBufferPass;} 223 235 236 237 //-- set actual pass here 224 238 Pass *result = SceneManager::setPass(usedPass); 239 225 240 226 241 // reset depth write … … 236 251 } 237 252 //----------------------------------------------------------------------- 238 void OcclusionCullingSceneManager::_findVisibleObjects(Camera* cam,253 void VisibilityTerrainSceneManager::_findVisibleObjects(Camera* cam, 239 254 bool onlyShadowCasters) 240 255 { … … 256 271 TerrainSceneManager::_findVisibleObjects(cam, onlyShadowCasters); 257 272 } 273 258 274 // only shadow casters will be rendered in shadow texture pass 259 // mHierarchyInterface->SetOnlyShadowCasters(onlyShadowCasters); 275 if (0) 276 mHierarchyInterface->SetOnlyShadowCasters(onlyShadowCasters); 260 277 } 261 278 … … 266 283 } 267 284 //----------------------------------------------------------------------- 268 void OcclusionCullingSceneManager::_renderVisibleObjects() 269 { 270 285 void VisibilityTerrainSceneManager::_renderVisibleObjects() 286 { 271 287 InitDepthPass(); // create material for depth pass 272 288 InitItemBufferPass(); // create material for item buffer pass … … 312 328 313 329 TerrainSceneManager::_renderVisibleObjects(); 330 ///////////////////////////////////////////////// 314 331 315 332 #ifdef GTP_VISIBILITY_MODIFIED_OGRE … … 331 348 332 349 /** 333 * the hierarchical culling algorithm334 * for depth pass: we just find objects and update depth buffer335 * for "delayed" rendering: we render some passes afterwards336 * e.g., transparents, because they need front-to-back sorting350 * the hierarchical culling algorithm 351 * for depth pass: we just find objects and update depth buffer 352 * for "delayed" rendering: we render some passes afterwards 353 * e.g., transparents, because they need front-to-back sorting 337 354 **/ 338 355 … … 352 369 353 370 // add visible nodes found by the visibility culling algorithm 371 #if 1 354 372 if (mUseDepthPass) 355 373 { … … 359 377 } 360 378 } 361 379 #endif 362 380 //-- now we can render all remaining queue objects 363 // used for depth pass, transparents, overlay381 //-- used for depth pass, transparents, overlay 364 382 clearSpecialCaseRenderQueues(); 365 366 TerrainSceneManager::_renderVisibleObjects(); 383 384 if (!DEBUG_CHC) 385 TerrainSceneManager::_renderVisibleObjects(); 367 386 } 368 387 … … 375 394 376 395 getRenderQueue()->clear(); // finally clear render queue 377 OGRE_DELETE(mRenderQueue); // HACK: should be cleared before... 396 OGRE_DELETE(mRenderQueue); // HACK: should rather only be cleared... 397 378 398 //WriteLog(); // write out stats 379 380 } 381 382 //----------------------------------------------------------------------- 383 void OcclusionCullingSceneManager::_updateSceneGraph(Camera* cam) 399 } 400 401 //----------------------------------------------------------------------- 402 void VisibilityTerrainSceneManager::_updateSceneGraph(Camera* cam) 384 403 { 385 404 mVisibilityManager->GetCullingManager()->SetHierarchyInterface(mHierarchyInterface); … … 389 408 } 390 409 //----------------------------------------------------------------------- 391 bool OcclusionCullingSceneManager::setOption(const String & key, const void * val)410 bool VisibilityTerrainSceneManager::setOption(const String & key, const void * val) 392 411 { 393 412 if (key == "UseDepthPass") … … 482 501 } 483 502 //----------------------------------------------------------------------- 484 bool OcclusionCullingSceneManager::getOption(const String & key, void *val)503 bool VisibilityTerrainSceneManager::getOption(const String & key, void *val) 485 504 { 486 505 if (key == "NumHierarchyNodes") … … 494 513 } 495 514 //----------------------------------------------------------------------- 496 bool OcclusionCullingSceneManager::getOptionValues(const String & key,515 bool VisibilityTerrainSceneManager::getOptionValues(const String & key, 497 516 StringVector &refValueList) 498 517 { … … 500 519 } 501 520 //----------------------------------------------------------------------- 502 bool OcclusionCullingSceneManager::getOptionKeys(StringVector & refKeys)521 bool VisibilityTerrainSceneManager::getOptionKeys(StringVector & refKeys) 503 522 { 504 523 return VisibilityOptionsManager(mVisibilityManager, mHierarchyInterface). … … 506 525 } 507 526 //----------------------------------------------------------------------- 508 void OcclusionCullingSceneManager::setVisibilityManager(GtpVisibility::527 void VisibilityTerrainSceneManager::setVisibilityManager(GtpVisibility:: 509 528 VisibilityManager *visManager) 510 529 { … … 512 531 } 513 532 //----------------------------------------------------------------------- 514 GtpVisibility::VisibilityManager * OcclusionCullingSceneManager::getVisibilityManager( void )533 GtpVisibility::VisibilityManager *VisibilityTerrainSceneManager::getVisibilityManager( void ) 515 534 { 516 535 return mVisibilityManager; 517 536 } 518 537 //----------------------------------------------------------------------- 519 void OcclusionCullingSceneManager::WriteLog()538 void VisibilityTerrainSceneManager::WriteLog() 520 539 { 521 540 std::stringstream d; … … 535 554 } 536 555 //----------------------------------------------------------------------- 537 void OcclusionCullingSceneManager::renderObjects( 538 const RenderPriorityGroup::TransparentRenderablePassList& objs, 539 bool doLightIteration, const LightList* manualLightList) 556 void VisibilityTerrainSceneManager::renderObjects( 557 const RenderPriorityGroup::TransparentRenderablePassList& objs, 558 bool doLightIteration, 559 const LightList* manualLightList) 540 560 { 541 561 // for correct rendering, transparents must be rendered after hierarchical culling 542 if ( !mSkipTransparents)562 if (1 && !mSkipTransparents) 543 563 { 544 564 OctreeSceneManager::renderObjects(objs, doLightIteration, manualLightList); … … 546 566 } 547 567 //----------------------------------------------------------------------- 548 bool OcclusionCullingSceneManager::validatePassForRendering(Pass* pass)568 bool VisibilityTerrainSceneManager::validatePassForRendering(Pass* pass) 549 569 { 550 570 // skip all but first pass if we are doing the depth pass 551 if ((mIsDepthPassPhase || mIsItemBufferPhase) && pass->getIndex() > 0)571 if ((mIsDepthPassPhase || mIsItemBufferPhase) && (pass->getIndex() > 0)) 552 572 { 553 573 return false; 554 574 } 575 // all but first pass 576 /*else if ((!mIsDepthPassPhase || mIsItemBufferPhase) && (pass->getIndex() != 0)) 577 { 578 return false; 579 }*/ 555 580 556 581 return SceneManager::validatePassForRendering(pass); 557 582 } 558 583 //----------------------------------------------------------------------- 559 void OcclusionCullingSceneManager::renderQueueGroupObjects(RenderQueueGroup* pGroup)584 void VisibilityTerrainSceneManager::renderQueueGroupObjects(RenderQueueGroup* pGroup) 560 585 { 561 586 if (!mIsItemBufferPhase) … … 565 590 } 566 591 567 //-- item buffer 592 //-- item buffer: render objects using false colors 568 593 569 594 // Iterate through priorities … … 576 601 } 577 602 //----------------------------------------------------------------------- 578 void OcclusionCullingSceneManager::RenderItemBuffer(RenderPriorityGroup* pGroup)603 void VisibilityTerrainSceneManager::RenderItemBuffer(RenderPriorityGroup* pGroup) 579 604 { 580 605 // Do solids … … 605 630 ipass->first->getParent()->getParent()->getName(); 606 631 607 LogManager::getSingleton().logMessage(d.str());632 //LogManager::getSingleton().logMessage(d.str()); 608 633 609 634 RenderSingleObjectForItemBuffer(*irend, ipass->first); … … 633 658 } 634 659 //----------------------------------------------------------------------- 635 void OcclusionCullingSceneManager::RenderSingleObjectForItemBuffer(Renderable *rend, Pass *pass)660 void VisibilityTerrainSceneManager::RenderSingleObjectForItemBuffer(Renderable *rend, Pass *pass) 636 661 { 637 662 static LightList nullLightList; … … 674 699 675 700 676 // Render a single object, this will set up auto params if required701 // render a single object, this will set up auto params if required 677 702 renderSingleObject(rend, usedPass, false, &nullLightList); 678 703 } 679 704 //----------------------------------------------------------------------- 680 GtpVisibility::VisibilityManager * OcclusionCullingSceneManager::GetVisibilityManager()705 GtpVisibility::VisibilityManager *VisibilityTerrainSceneManager::GetVisibilityManager() 681 706 { 682 707 return mVisibilityManager; 683 708 } 684 709 //----------------------------------------------------------------------- 685 void OcclusionCullingSceneManager::InitVisibilityCulling(Camera *cam)710 void VisibilityTerrainSceneManager::InitVisibilityCulling(Camera *cam) 686 711 { 687 712 // reset culling manager stats … … 704 729 mLeavePassesInQueue = 0; 705 730 706 if (! mUseDepthPass && !mUseItemBuffer)731 if (!DEBUG_CHC && !mUseDepthPass && !mUseItemBuffer) 707 732 { 708 733 if (mShadowTechnique == SHADOWTYPE_STENCIL_ADDITIVE) … … 733 758 } 734 759 735 // skip rendering transparents inthe hierarchical culling760 // skip rendering transparents during the hierarchical culling 736 761 // (because they will be rendered afterwards) 737 mSkipTransparents = mUseDepthPass ||738 (m LeavePassesInQueue & RenderPriorityGroup::TRANSPARENT_PASSES);762 mSkipTransparents = !DEBUG_CHC && 763 (mIsDepthPassPhase || (mLeavePassesInQueue & RenderPriorityGroup::TRANSPARENT_PASSES)); 739 764 740 765 // -- initialise interface for rendering traversal of the hierarchy … … 749 774 } 750 775 //----------------------------------------------------------------------- 751 OctreeHierarchyInterface * OcclusionCullingSceneManager::GetHierarchyInterface()776 OctreeHierarchyInterface *VisibilityTerrainSceneManager::GetHierarchyInterface() 752 777 { 753 778 return mHierarchyInterface; 754 779 } 755 780 //----------------------------------------------------------------------- 756 void OcclusionCullingSceneManager::endFrame()781 void VisibilityTerrainSceneManager::endFrame() 757 782 { 758 783 TerrainRenderable::ResetRenderLevelIndex(); 759 784 } 760 785 //----------------------------------------------------------------------- 761 Entity* OcclusionCullingSceneManager::createEntity(const String& entityName,786 Entity* VisibilityTerrainSceneManager::createEntity(const String& entityName, 762 787 const String& meshName) 763 788 { … … 775 800 } 776 801 //----------------------------------------------------------------------- 777 void OcclusionCullingSceneManager::renderAdditiveStencilShadowedQueueGroupObjects(RenderQueueGroup* pGroup)802 void VisibilityTerrainSceneManager::renderAdditiveStencilShadowedQueueGroupObjects(RenderQueueGroup* pGroup) 778 803 { 779 804 // only render solid passes during hierarchical culling … … 807 832 } 808 833 //----------------------------------------------------------------------- 809 void OcclusionCullingSceneManager::renderModulativeStencilShadowedQueueGroupObjects(RenderQueueGroup* pGroup)834 void VisibilityTerrainSceneManager::renderModulativeStencilShadowedQueueGroupObjects(RenderQueueGroup* pGroup) 810 835 { 811 836 if (mIsHierarchicalCulling) … … 830 855 } 831 856 } 857 832 858 } // namespace Ogre
Note: See TracChangeset
for help on using the changeset viewer.