Changeset 925 for GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE
- Timestamp:
- 05/08/06 06:55:17 (19 years ago)
- Location:
- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreOcclusionCullingSceneManager.h
r903 r925 52 52 GtpVisibility::VisibilityManager *getVisibilityManager(); 53 53 54 /** Render a set of objects, see renderSingleObject for param definitions54 /** Render a queue group. 55 55 Override so we can handle delayed rendering of transparent objects 56 56 */ 57 virtual void renderObjects(const QueuedRenderableCollection& objs, 58 QueuedRenderableCollection::OrganisationMode om, 59 bool doLightIteration, const LightList* manualLightList = 0); 57 void renderBasicQueueGroupObjects(RenderQueueGroup* pGroup, 58 QueuedRenderableCollection::OrganisationMode om); 60 59 61 60 /** Writes out stats into the Ogre log file. … … 103 102 msz: Modified to reflect changes in Ogre::TerrainSceneManager 104 103 */ 104 #if 1 105 105 virtual void setWorldGeometry( DataStreamPtr& stream, const String& typeName ); 106 106 #endif 107 107 108 108 /** Loads view cells for this particular scene. … … 210 210 bool mUseViewCells; 211 211 212 212 213 /// if the view cells are filtered 213 214 bool mUseVisibilityFilter; … … 218 219 { 219 220 protected: 221 typedef std::vector<TerrainPageSource*> TerrainPageSources; 222 TerrainPageSources mTerrainPageSources; 220 223 void initMetaData(void) const; 221 224 GtpVisibility::VisibilityManager *visManager; … … 225 228 visManager = vm; 226 229 } 227 ~OcclusionCullingSceneManagerFactory() {} 230 228 231 /// Factory type name 229 232 static const String FACTORY_TYPE_NAME; -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreOcclusionQueriesQueryManager.h
r370 r925 15 15 on different hierarchy types, while reusing the implementation of the query methods. 16 16 */ 17 OcclusionQueriesQueryManager( PlatformHierarchyInterface *hierarchyInterface, Viewport *vp,17 OcclusionQueriesQueryManager(GtpVisibility::HierarchyInterface *hierarchyInterface, Viewport *vp, 18 18 int queryModes, int itemBufferMode); 19 19 -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgrePlatformQueryManager.h
r897 r925 4 4 #include "VisibilityInfo.h" 5 5 #include "QueryManager.h" 6 #include " OgrePlatformHierarchyInterface.h"6 #include "HierarchyInterface.h" 7 7 8 8 namespace Ogre { … … 17 17 on different hierarchy types, while reusing the implementation of the query methods. 18 18 */ 19 PlatformQueryManager( PlatformHierarchyInterface *hierarchyInterface,19 PlatformQueryManager(GtpVisibility::HierarchyInterface *hierarchyInterface, 20 20 Viewport *vp, int queryModes); 21 21 -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreVisibilityOctreeSceneManager.h
r903 r925 55 55 GtpVisibility::VisibilityManager *getVisibilityManager(); 56 56 57 /** Render a set of objects, see renderSingleObject for param definitions57 /** Render a queue group. 58 58 Override so we can handle delayed rendering of transparent objects 59 59 */ 60 virtual void renderObjects(const QueuedRenderableCollection& objs, 61 QueuedRenderableCollection::OrganisationMode om, 62 bool doLightIteration, const LightList* manualLightList = 0); 60 void renderBasicQueueGroupObjects(RenderQueueGroup* pGroup, 61 QueuedRenderableCollection::OrganisationMode om); 63 62 64 63 /** Writes out stats into the Ogre log file. -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreVisibilityTerrainSceneManager.h
r897 r925 51 51 GtpVisibility::VisibilityManager *getVisibilityManager(); 52 52 53 /** Render a set of objects, see renderSingleObject for param definitions53 /** Render a queue group. 54 54 Override so we can handle delayed rendering of transparent objects 55 55 */ 56 virtual void renderObjects(const QueuedRenderableCollection& objs, 57 QueuedRenderableCollection::OrganisationMode om, 58 bool doLightIteration, const LightList* manualLightList = 0); 56 void renderBasicQueueGroupObjects(RenderQueueGroup* pGroup, 57 QueuedRenderableCollection::OrganisationMode om); 59 58 60 59 /** Writes out stats into the Ogre log file. -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/scripts/Plugin_VisibilitySceneManager.vcproj
r897 r925 158 158 RelativePath="..\include\OgreTerrainContentGenerator.h"> 159 159 </File> 160 <File161 RelativePath="..\include\OgreVisibilityOctreeSceneManager.h">162 </File>163 <File164 RelativePath="..\include\OgreVisibilityTerrainSceneManager.h">165 </File>166 160 </Filter> 167 161 <Filter … … 169 163 Filter=""> 170 164 <File 171 RelativePath="..\src\OgreBspHierarchyInterface.cpp">172 </File>173 <File174 165 RelativePath="..\src\OgreOcclusionCullingSceneManager.cpp"> 175 166 </File> … … 179 170 <File 180 171 RelativePath="..\src\OgreTerrainContentGenerator.cpp"> 181 </File>182 <File183 RelativePath="..\src\OgreVisibilityOctreeSceneManager.cpp">184 </File>185 <File186 RelativePath="..\src\OgreVisibilityTerrainSceneManager.cpp">187 172 </File> 188 173 </Filter> … … 195 180 Filter="h;hpp;hxx;hm;inl;inc"> 196 181 <File 197 RelativePath="..\include\OgreBspHierarchyInterface.h">198 </File>199 <File200 182 RelativePath="..\include\OgreMeshInstance.h"> 201 183 </File> … … 229 211 <File 230 212 RelativePath="..\include\OgreVisibilityOptionsManager.h"> 231 </File>232 <File233 RelativePath="..\include\OgreVisibilitySceneManager.h">234 213 </File> 235 214 </Filter> … … 269 248 <File 270 249 RelativePath="..\src\OgreVisibilityOptionsManager.cpp"> 271 </File>272 <File273 RelativePath="..\src\OgreVisibilitySceneManager.cpp">274 250 </File> 275 251 <File -
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 //----------------------------------------------------------------------- -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionQueriesQueryManager.cpp
r726 r925 4 4 #include <vector> 5 5 #include <OgreSubEntity.h> 6 6 #include "OgrePlatformHierarchyInterface.h" 7 7 8 8 namespace Ogre { … … 10 10 //----------------------------------------------------------------------- 11 11 OcclusionQueriesQueryManager::OcclusionQueriesQueryManager( 12 PlatformHierarchyInterface *hierarchyInterface,12 GtpVisibility::HierarchyInterface *hierarchyInterface, 13 13 Viewport *vp, 14 14 int queryModes, -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOctreeHierarchyInterface.cpp
r880 r925 1 1 #include "OgreOctreeHierarchyInterface.h" 2 #include "OgreVisibilityOctreeSceneManager.h"2 //#include "OgreVisibilityOctreeSceneManager.h" 3 3 #include <OgreOctree.h> 4 4 #include <OgreLogManager.h> … … 25 25 RenderNode(node); 26 26 } 27 27 28 28 29 // if not all subtrees are empty … … 141 142 AxisAlignedBox *OctreeHierarchyInterface::GetBoundingBox(GtpVisibility::HierarchyNode *node) 142 143 { 143 if (node != mSavedNode) 144 // reuse box if node is the same 145 // only create renderable bounding box for new node 146 if (1 || (node != mSavedNode)) 144 147 { 145 148 mSavedNode = node; -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgrePlatformHierarchyInterface.cpp
r903 r925 123 123 if (mCurrentTestIdx >= (int)mOcclusionQueries.size()) 124 124 { 125 mCurrentTestIdx = =(int)mOcclusionQueries.size();125 mCurrentTestIdx = (int)mOcclusionQueries.size(); 126 126 mOcclusionQueries.push_back(new PlatformOcclusionQuery(mRenderSystem)); 127 127 } … … 139 139 140 140 mCamera = cam; 141 // set culling camera for visualization 141 142 mCullCamera = cullCam ? cullCam : cam; 142 143 -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgrePlatformOcclusionQuery.cpp
r903 r925 32 32 bool isAvailable = true; 33 33 34 /*if (!waitForResult) 34 if (!waitForResult) 35 { 35 36 isAvailable = !mHardwareOcclusionQuery->isStillOutstanding(); 36 */ 37 //visiblePixels = 800; 37 //std::stringstream d; d << "available: " << isAvailable; 38 //Ogre::LogManager::getSingleton().logMessage(d.str()); 39 } 40 38 41 if (isAvailable) 39 42 return mHardwareOcclusionQuery->pullOcclusionQuery(&visiblePixels); 40 41 return isAvailable;43 44 return false; 42 45 } 43 46 -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgrePlatformQueryManager.cpp
r897 r925 6 6 #include <vector> 7 7 #include <OgreSubEntity.h> 8 8 #include "OgrePlatformHierarchyInterface.h" 9 9 10 10 namespace Ogre { 11 11 12 12 //----------------------------------------------------------------------- 13 PlatformQueryManager::PlatformQueryManager( PlatformHierarchyInterface *hierarchyInterface,13 PlatformQueryManager::PlatformQueryManager(GtpVisibility::HierarchyInterface *hierarchyInterface, 14 14 Viewport *vp, int queryModes): 15 15 QueryManager(hierarchyInterface, queryModes), … … 19 19 } 20 20 //----------------------------------------------------------------------- 21 bool PlatformQueryManager::ShootRay(const Ray &ray, std::vector<Mesh *> *visibleMeshes, bool isGlobalLine) 21 bool PlatformQueryManager::ShootRay(const Ray &ray, 22 std::vector<Mesh *> *visibleMeshes, 23 bool isGlobalLine) 22 24 { 23 25 // run OGRE ray shooting query -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreSolidBoundingBox.cpp
r903 r925 74 74 mRenderOp.indexData->indexBuffer = ibuf; 75 75 // set material with no lighting, no color, no depth write 76 //SetOcclusionQueryMaterial();77 setMaterial("BaseWhiteNoLighting");76 SetOcclusionQueryMaterial(); 77 //setMaterial("BaseWhiteNoLighting"); 78 78 } 79 79 //----------------------------------------------------------------------- -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreVisibilityOctreeSceneManager.cpp
r903 r925 365 365 InitVisibilityCulling(mCameraInProgress); 366 366 367 368 367 /** 369 368 * the hierarchical culling algorithm … … 411 410 412 411 // reset ambient light 413 //setAmbientLight(savedAmbient);412 setAmbientLight(savedAmbient); 414 413 415 414 getRenderQueue()->clear(); // finally clear render queue 416 if ( 0) OGRE_DELETE(mRenderQueue); // HACK: should rather only be cleared ...415 if (1) OGRE_DELETE(mRenderQueue); // HACK: should rather only be cleared ... 417 416 418 417 if (0) WriteLog(); // write out stats … … 595 594 } 596 595 //----------------------------------------------------------------------- 597 void VisibilityOctreeSceneManager::renderObjects( 598 const QueuedRenderableCollection& objs, 599 QueuedRenderableCollection::OrganisationMode om, 600 bool doLightIteration, const LightList* manualLightList) 601 { 602 // for correct rendering, transparents must be rendered after hierarchical culling 603 // => do nothing 604 if (NORMAL_RENDER_HACK || !mSkipTransparents) 605 { 606 OctreeSceneManager::renderObjects(objs, om, doLightIteration, manualLightList); 607 } 608 } 596 void VisibilityOctreeSceneManager::renderBasicQueueGroupObjects(RenderQueueGroup* pGroup, 597 QueuedRenderableCollection::OrganisationMode om) 598 { 599 // Basic render loop 600 // Iterate through priorities 601 RenderQueueGroup::PriorityMapIterator groupIt = pGroup->getIterator(); 602 603 while (groupIt.hasMoreElements()) 604 { 605 RenderPriorityGroup* pPriorityGrp = groupIt.getNext(); 606 607 // Sort the queue first 608 pPriorityGrp->sort(mCameraInProgress); 609 610 // Do solids 611 renderObjects(pPriorityGrp->getSolidsBasic(), om, true); 612 613 // for correct rendering, transparents must be rendered after hierarchical culling 614 // => do nothing 615 616 // Do transparents (always descending) 617 if (NORMAL_RENDER_HACK || !mSkipTransparents) 618 { 619 renderObjects(pPriorityGrp->getTransparents(), 620 QueuedRenderableCollection::OM_SORT_DESCENDING, true); 621 } 622 623 624 }// for each priority 625 } 626 609 627 //----------------------------------------------------------------------- 610 628 bool VisibilityOctreeSceneManager::validatePassForRendering(Pass* pass) … … 770 788 mIsDepthPassPhase = mUseDepthPass; 771 789 772 mIsHierarchicalCulling = true; // during hierarchical culling 790 // from now on we are during hierarchical culling 791 mIsHierarchicalCulling = true; 773 792 774 793 // item buffer needs full ambient lighting to use item colors as unique id … … 828 847 // possible two cameras (one for culling, one for rendering) 829 848 mHierarchyInterface->InitTraversal(mCameraInProgress, 830 mCullCamera ? getCamera("CullCamera") : NULL,831 849 mCullCamera ? getCamera("CullCamera") : NULL, 850 mLeavePassesInQueue); 832 851 833 852 //std::stringstream d; d << "leave passes in queue: " << mLeavePassesInQueue; … … 1135 1154 //-- compute new filtered cell 1136 1155 GtpVisibilityPreprocessor::PrVs prvs; 1137 mViewCellsManager->GetPrVS(viewPoint, prvs );1156 mViewCellsManager->GetPrVS(viewPoint, prvs, 5); 1138 1157 viewCell = prvs.mViewCell; 1139 1158 } -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreVisibilitySceneManager.cpp
r897 r925 13 13 VisibilitySceneManager::VisibilitySceneManager(const String& name, 14 14 GtpVisibility::VisibilityManager *visManager) 15 :SceneManager(name), mVisibilityManager(visManager), mUseDepthPass(false), mShowVisualization(false) 15 :SceneManager(name), 16 mVisibilityManager(visManager), 17 mUseDepthPass(false), 18 mShowVisualization(false) 16 19 { 17 mHierarchyInterface = 18 new SceneNodeHierarchyInterface(this, mDestRenderSystem); 20 mHierarchyInterface = new SceneNodeHierarchyInterface(this, mDestRenderSystem); 19 21 } 20 22 //----------------------------------------------------------------------- -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreVisibilitySceneManagerDll.cpp
r897 r925 24 24 */ 25 25 26 #include <OgreVisibilityTerrainSceneManager.h>27 #include <OgreVisibilityOctreeSceneManager.h>28 //#include <OgreVisibilityDotSceneManager.h>26 //#include <OgreVisibilityTerrainSceneManager.h> 27 //#include <OgreVisibilityOctreeSceneManager.h> 28 #include <OgreOcclusionCullingSceneManager.h> 29 29 30 30 //#include <OgreHeightmapTerrainPageSource.h> … … 40 40 namespace Ogre { 41 41 42 VisibilityOctreeSceneManagerFactory *visibilityOctreePlugin; 43 VisibilityTerrainSceneManagerFactory *visibilityTerrainPlugin; 42 //VisibilityOctreeSceneManagerFactory *visibilityOctreePlugin; 43 //VisibilityTerrainSceneManagerFactory *visibilityTerrainPlugin; 44 OcclusionCullingSceneManagerFactory *occlusionCullingPlugin; 44 45 45 46 //----------------------------------------------------------------------- … … 47 48 { 48 49 visEnv = new GtpVisibility::VisibilityEnvironment(); 49 visEnv->LoadEnvironment(" vienna_simple.env");50 visEnv->LoadEnvironment("simple.env"); 50 51 visManager = new GtpVisibility::VisibilityManager(visEnv); 51 52 52 53 // Create new scene manager 53 visibilityOctreePlugin = new VisibilityOctreeSceneManagerFactory(visManager); 54 visibilityTerrainPlugin = new VisibilityTerrainSceneManagerFactory(visManager); 54 //visibilityOctreePlugin = new VisibilityOctreeSceneManagerFactory(visManager); 55 //visibilityTerrainPlugin = new VisibilityTerrainSceneManagerFactory(visManager); 56 occlusionCullingPlugin = new OcclusionCullingSceneManagerFactory(visManager); 55 57 // Construct listener manager singleton 56 58 new TerrainPageSourceListenerManager(); 57 59 58 60 // Register 59 Root::getSingleton().addSceneManagerFactory(visibilityOctreePlugin); 60 Root::getSingleton().addSceneManagerFactory(visibilityTerrainPlugin); 61 //Root::getSingleton().addSceneManagerFactory(visibilityOctreePlugin); 62 //Root::getSingleton().addSceneManagerFactory(visibilityTerrainPlugin); 63 Root::getSingleton().addSceneManagerFactory(occlusionCullingPlugin); 61 64 } 62 65 //----------------------------------------------------------------------- 63 66 extern "C" void __declspec(dllexport) dllShutdownPlugin() 64 67 { 65 Root::getSingleton().removeSceneManagerFactory(visibilityOctreePlugin); 66 Root::getSingleton().removeSceneManagerFactory(visibilityTerrainPlugin); 68 //Root::getSingleton().removeSceneManagerFactory(visibilityOctreePlugin); 69 //Root::getSingleton().removeSceneManagerFactory(visibilityTerrainPlugin); 70 Root::getSingleton().removeSceneManagerFactory(occlusionCullingPlugin); 67 71 // destroy listener manager 68 72 delete TerrainPageSourceListenerManager::getSingletonPtr(); … … 75 79 // (HACK: crashes on delete!!!! FIX this 76 80 //delete visibilityOctreePlugin; 77 78 //delete occlusionDotPlugin;79 81 //delete visibilityTerrainPlugin; 82 delete occlusionCullingPlugin; 83 80 84 delete visManager; 81 85 delete visEnv; … … 83 87 84 88 89 85 90 } //namespace Ogre -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreVisibilityTerrainSceneManager.cpp
r903 r925 341 341 setSpecialCaseRenderQueueMode(SceneManager::SCRQM_EXCLUDE); 342 342 343 343 344 // set all necessary parameters for 344 345 // hierarchical visibility culling and rendering 345 346 InitVisibilityCulling(mCameraInProgress); 347 346 348 347 349 /** … … 389 391 // HACK: set the new render level index, important to avoid cracks 390 392 // in terrain caused by LOD 391 TerrainRenderable::NextRenderLevelIndex();393 //TerrainRenderable::NextRenderLevelIndex(); 392 394 393 395 // reset ambient light … … 395 397 396 398 getRenderQueue()->clear(); // finally clear render queue 397 if ( 0) OGRE_DELETE(mRenderQueue); // HACK: should rather only be cleared ...399 if (1) OGRE_DELETE(mRenderQueue); // HACK: should rather only be cleared ... 398 400 399 401 if (0) WriteLog(); // write out stats … … 547 549 } 548 550 //----------------------------------------------------------------------- 549 void VisibilityTerrainSceneManager::renderObjects( 550 const QueuedRenderableCollection& objs, 551 QueuedRenderableCollection::OrganisationMode om, 552 bool doLightIteration, const LightList* manualLightList) 553 { 554 // for correct rendering, transparents must be rendered after hierarchical culling 555 // => do nothing 556 if (NORMAL_RENDER_HACK || !mSkipTransparents) 557 { 558 SceneManager::renderObjects(objs, om, doLightIteration, manualLightList); 559 } 551 //----------------------------------------------------------------------- 552 void VisibilityTerrainSceneManager::renderBasicQueueGroupObjects(RenderQueueGroup* pGroup, 553 QueuedRenderableCollection::OrganisationMode om) 554 { 555 // Basic render loop 556 // Iterate through priorities 557 RenderQueueGroup::PriorityMapIterator groupIt = pGroup->getIterator(); 558 559 while (groupIt.hasMoreElements()) 560 { 561 RenderPriorityGroup* pPriorityGrp = groupIt.getNext(); 562 563 // Sort the queue first 564 pPriorityGrp->sort(mCameraInProgress); 565 566 // Do solids 567 renderObjects(pPriorityGrp->getSolidsBasic(), om, true); 568 569 // for correct rendering, transparents must be rendered after hierarchical culling 570 // => do nothing 571 572 // Do transparents (always descending) 573 if (NORMAL_RENDER_HACK || !mSkipTransparents) 574 { 575 renderObjects(pPriorityGrp->getTransparents(), 576 QueuedRenderableCollection::OM_SORT_DESCENDING, true); 577 } 578 579 580 }// for each priority 560 581 } 561 582 //-----------------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.