- Timestamp:
- 05/08/06 06:55:17 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionCullingSceneManager.cpp
r903 r925 11 11 #include <OgreMaterialManager.h> 12 12 #include <OgreIteratorWrappers.h> 13 #include <OgreHeightmapTerrainPageSource.h> 13 14 #include "VspBspTree.h" 14 15 #include "Containers.h" … … 44 45 mSkipTransparents(false), 45 46 mRenderTransparentsForItemBuffer(true), 46 mExecuteVertexProgramForAllPasses(true), 47 //mExecuteVertexProgramForAllPasses(true), 48 mExecuteVertexProgramForAllPasses(false), 47 49 mIsHierarchicalCulling(false), 48 50 mViewCellsLoaded(false), … … 56 58 if (0) 57 59 { 58 mDisplayNodes = true;59 mShowBoundingBoxes = true;60 mShowBoxes = true;60 mDisplayNodes = true; 61 mShowBoundingBoxes = true; 62 mShowBoxes = true; 61 63 } 62 64 63 65 // TODO: set maxdepth to reasonable value 64 66 mMaxDepth = 50; 67 68 //loadVisibilityConfig("GtpVisibility.cfg"); 69 //LoadViewCells(""); 70 //mViewCellsLoaded = true; 65 71 } 66 72 //----------------------------------------------------------------------- … … 117 123 } 118 124 //------------------------------------------------------------------------- 125 #if 1 119 126 void OcclusionCullingSceneManager::setWorldGeometry( DataStreamPtr& stream, const String& typeName ) 120 127 { … … 146 153 147 154 } 148 155 #endif 149 156 //----------------------------------------------------------------------- 150 157 void OcclusionCullingSceneManager::PrepareVisualization(Camera *cam) … … 183 190 { 184 191 // render the leaf nodes 185 if (((*it)->numAttachedObjects() > 0) && ((*it)->numChildren() == 0) && 186 (*it)->getAttachedObject(0)->getMovableType() == "Entity") 192 if ((*it)->numAttachedObjects() && 193 !(*it)->numChildren() && 194 ((*it)->getAttachedObject(0)->getMovableType() == "Entity") && 195 (*it)->getAttachedObject(0)->isVisible()) 187 196 { 188 197 getRenderQueue()->addRenderable((*it)); … … 217 226 Pass *usedPass = useDepthPass ? mDepthPass : pass; 218 227 219 IlluminationRenderStage savedStage = mIlluminationStage; 228 229 const IlluminationRenderStage savedStage = mIlluminationStage; 220 230 221 231 // set illumination stage to NONE so no shadow material is used … … 583 593 return true; 584 594 } 585 595 if (key == "VisibilityManager") 596 { 597 * static_cast<GtpVisibility::VisibilityManager **>(val) = 598 (GtpVisibility::VisibilityManager *)mVisibilityManager; 599 return true; 600 } 601 if (key == "HierarchInterface") 602 { 603 * static_cast<GtpVisibility::HierarchyInterface **>(val) = 604 (GtpVisibility::HierarchyInterface *)mHierarchyInterface; 605 return true; 606 } 607 586 608 return VisibilityOptionsManager(mVisibilityManager, mHierarchyInterface). 587 609 getOption(key, val) && TerrainSceneManager::getOption(key, val); … … 630 652 } 631 653 //----------------------------------------------------------------------- 632 void OcclusionCullingSceneManager::renderObjects( 633 const QueuedRenderableCollection& objs, 634 QueuedRenderableCollection::OrganisationMode om, 635 bool doLightIteration, const LightList* manualLightList) 636 { 637 // for correct rendering, transparents must be rendered after hierarchical culling 638 // => do nothing 639 if (NORMAL_RENDER_HACK || !mSkipTransparents) 640 { 641 OctreeSceneManager::renderObjects(objs, om, doLightIteration, manualLightList); 642 } 643 } 654 void OcclusionCullingSceneManager::renderBasicQueueGroupObjects(RenderQueueGroup* pGroup, 655 QueuedRenderableCollection::OrganisationMode om) 656 { 657 // Basic render loop 658 // Iterate through priorities 659 RenderQueueGroup::PriorityMapIterator groupIt = pGroup->getIterator(); 660 661 while (groupIt.hasMoreElements()) 662 { 663 RenderPriorityGroup* pPriorityGrp = groupIt.getNext(); 664 665 // Sort the queue first 666 pPriorityGrp->sort(mCameraInProgress); 667 668 // Do solids 669 renderObjects(pPriorityGrp->getSolidsBasic(), om, true); 670 671 // for correct rendering, transparents must be rendered after hierarchical culling 672 // => do nothing 673 674 // Do transparents (always descending) 675 if (NORMAL_RENDER_HACK || !mSkipTransparents) 676 { 677 renderObjects(pPriorityGrp->getTransparents(), 678 QueuedRenderableCollection::OM_SORT_DESCENDING, true); 679 } 680 681 682 }// for each priority 683 } 684 644 685 //----------------------------------------------------------------------- 645 686 bool OcclusionCullingSceneManager::validatePassForRendering(Pass* pass) … … 836 877 /*** msz: no more IRS_AMBIENT, see OgreSceneManager.h ***/ 837 878 // mIlluminationStage = IRS_AMBIENT; 838 getRenderQueue()->setSplitPassesByLightingType(true);879 //getRenderQueue()->setSplitPassesByLightingType(true); 839 880 } 840 881 … … 1173 1214 //-- compute new filtered cell 1174 1215 GtpVisibilityPreprocessor::PrVs prvs; 1175 mViewCellsManager->GetPrVS(viewPoint, prvs );1216 mViewCellsManager->GetPrVS(viewPoint, prvs, 5); 1176 1217 viewCell = prvs.mViewCell; 1177 1218 } … … 1206 1247 } 1207 1248 //----------------------------------------------------------------------- 1208 SceneManager* OcclusionCullingSceneManagerFactory::createInstance( 1209 const String& instanceName) 1210 { 1211 return new OcclusionCullingSceneManager(instanceName, visManager); 1249 SceneManager *OcclusionCullingSceneManagerFactory::createInstance( 1250 const String& instanceName) 1251 { 1252 OcclusionCullingSceneManager* tsm = new OcclusionCullingSceneManager(instanceName, visManager); 1253 1254 // Create & register default sources (one per manager) 1255 HeightmapTerrainPageSource* ps = new HeightmapTerrainPageSource(); 1256 mTerrainPageSources.push_back(ps); 1257 tsm->registerPageSource("Heightmap", ps); 1258 1259 return tsm; 1212 1260 } 1213 1261 //-----------------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.