Changeset 33
- Timestamp:
- 03/30/05 11:36:07 (20 years ago)
- Location:
- trunk/VUT/OcclusionCullingSceneManager
- Files:
-
- 4 added
- 2 deleted
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/OcclusionCullingSceneManager/TestCulling/TestCulling.vcproj
r32 r33 21 21 Name="VCCLCompilerTool" 22 22 Optimization="0" 23 AdditionalIncludeDirectories=""$(OGRE_PATH)\Dependencies\include";"$(OGRE_PATH)\OgreMain\include";"$(OGRE_PATH)\Samples\Common\include";"$(OGRE_PATH)\Dependencies\include\CEGUI";"$(OGRE_PATH)\ Samples\Common\CEGUIRenderer\include""24 PreprocessorDefinitions="_WINDOWS;_STLP_USE_DYNAMIC_LIB;OGRE_LIBRARY_IMPORTS;_DEBUG;WIN32;_STLP_DEBUG "23 AdditionalIncludeDirectories=""$(OGRE_PATH)\Dependencies\include";"$(OGRE_PATH)\OgreMain\include";"$(OGRE_PATH)\Samples\Common\include";"$(OGRE_PATH)\Dependencies\include\CEGUI";"$(OGRE_PATH)\PlugIns\OctreeSceneManager\include";"$(OGRE_ADDONS_PATH)\dotsceneoctree\PlugIns\DotSceneManager\include";"$(OGRE_PATH)\Samples\Common\CEGUIRenderer\include";../include" 24 PreprocessorDefinitions="_WINDOWS;_STLP_USE_DYNAMIC_LIB;OGRE_LIBRARY_IMPORTS;_DEBUG;WIN32;_STLP_DEBUG;PLUGIN_TERRAIN_IMPORTS" 25 25 MinimalRebuild="TRUE" 26 26 BasicRuntimeChecks="3" … … 34 34 <Tool 35 35 Name="VCLinkerTool" 36 AdditionalDependencies=" OGREMain_d.LIB CEGUIBase_d.lib OgreGUIRenderer_d.lib Plugin_OctreeSceneManager.lib"36 AdditionalDependencies="Plugin_OctreeSceneManager.lib OGREMain_d.LIB CEGUIBase_d.lib OgreGUIRenderer_d.lib Plugin_DotSceneManager.lib" 37 37 OutputFile="$(OGRE_PATH)/Samples/Common/bin/Debug/TestCulling.exe" 38 38 LinkIncremental="2" 39 AdditionalLibraryDirectories=""$(OGRE_PATH)\Dependencies\Lib\Debug";"$(OGRE_ PATH)\OgreMain\Lib\Debug";"$(OGRE_PATH)\Samples\Common\CEGUIRenderer\lib";"$(OGRE_PATH)\PlugIns\OctreeSceneManager\bin\$(ConfigurationName)""39 AdditionalLibraryDirectories=""$(OGRE_PATH)\Dependencies\Lib\Debug";"$(OGRE_ADDONS_PATH)\dotsceneoctree\PlugIns\DotSceneManager\bin\debug";"$(OGRE_PATH)\OgreMain\Lib\Debug";"$(OGRE_PATH)\PlugIns\OctreeSceneManager\bin\debug";"$(OGRE_PATH)\Samples\Common\CEGUIRenderer\lib"" 40 40 GenerateDebugInformation="TRUE" 41 41 ProgramDatabaseFile="$(OutDir)/TestCulling.pdb" -
trunk/VUT/OcclusionCullingSceneManager/TestCulling/TestCullingApplication.cpp
r32 r33 6 6 */ 7 7 8 //#pragma warning (push)9 //#pragma warning( disable : 4267 )10 11 8 #include <OgreNoMemoryMacros.h> 12 9 #include <CEGUI/CEGUI.h> … … 15 12 #include <../CEGUIRenderer/include/OgreCEGUITexture.h> 16 13 #include <OgreMemoryMacros.h> 17 //#pragma warning (pop) 18 /* 19 #include <CEGUI/CEGUIImageset.h> 20 #include <CEGUI/CEGUISystem.h> 21 #include <CEGUI/CEGUISchemeManager.h> 22 #include <CEGUI/CEGUIWindowManager.h> 23 #include <CEGUI/CEGUIWindow.h> 24 #include <CEGUI/CEGUILogger.h> 25 #include <CEGUI/elements/CEGUICombobox.h> 26 #include <CEGUI/elements/CEGUIListbox.h> 27 #include <CEGUI/elements/CEGUIListboxTextItem.h> 28 #include <CEGUI/elements/CEGUIPushButton.h> 29 #include <CEGUI/elements/CEGUIScrollbar.h> 30 #include <CEGUI/elements/CEGUIStaticImage.h> 31 32 #include "OgreCEGUIRenderer.h" 33 #include "OgreCEGUIResourceProvider.h" 34 */ 14 35 15 #include "Ogre.h" 36 16 #include "TestCullingApplication.h" 17 #include "OgreOcclusionCullingSceneTraverser.h" 37 18 38 19 #define WIN32_LEAN_AND_MEAN … … 83 64 void TestCullingApplication::chooseSceneManager(void) 84 65 { 85 mSceneMgr = mRoot->getSceneManager(ST_GENERIC); 66 //mSceneMgr = mRoot->getSceneManager(ST_GENERIC); 67 mSceneMgr = mRoot->getSceneManager(ST_EXTERIOR_CLOSE); 86 68 } 87 69 … … 96 78 { 97 79 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 80 // Setup default variables 81 mCurrentObject = NULL; 82 mLMouseDown = false; 83 mRMouseDown = false; 84 mSceneMgr = sceneManager; 85 86 // Reduce move speed 87 mMoveSpeed = 50; 88 mRotateSpeed *= 2; 89 90 mCurrentAlgorithm = OcclusionCullingSceneTraverser::RENDER_COHERENT; 91 mThreshold = 0; 92 93 // Register this so that we get mouse events. 94 mEventProcessor->addMouseListener(this); 95 mEventProcessor->addMouseMotionListener(this); 96 mEventProcessor->addKeyListener(this); 97 98 // show overlay 99 Overlay* pOver = OverlayManager::getSingleton().getByName("Example/OcclusionDemoOverlay"); 100 101 mAlgorithmInfo = OverlayManager::getSingleton().getOverlayElement("Example/Occlusion/AlgorithmInfo"); 102 mThresholdInfo = OverlayManager::getSingleton().getOverlayElement("Example/Occlusion/ThresholdInfo"); 103 mFrustumCulledNodesInfo = OverlayManager::getSingleton().getOverlayElement("Example/Occlusion/FrustumCulledNodesInfo"); 104 mQueryCulledNodesInfo = OverlayManager::getSingleton().getOverlayElement("Example/Occlusion/QueryCulledNodesInfo"); 105 mTraversedNodesInfo = OverlayManager::getSingleton().getOverlayElement("Example/Occlusion/TraversedNodesInfo"); 106 107 mAlgorithmInfo->setCaption(": " + mCurrentAlgorithmCaptions[mCurrentAlgorithm]); 108 mThresholdInfo->setCaption(": 0"); 109 mFrustumCulledNodesInfo->setCaption(": 0"); 110 mQueryCulledNodesInfo->setCaption(": 0"); 111 mTraversedNodesInfo->setCaption(": 0"); 112 113 pOver->show(); 132 114 } // MouseQueryListener 133 115 //----------------------------------------------------------------------- -
trunk/VUT/OcclusionCullingSceneManager/TestCulling/TestCullingApplication.h
r32 r33 5 5 #include "CEGUIForwardRefs.h" 6 6 #include "ExampleApplication.h" 7 #include "OgreOcclusionCullingSceneManager.h"7 //#include "OgreOcclusionCullingSceneManager.h" 8 8 #include "OgreOcclusionCullingSceneTraverser.h" 9 9 -
trunk/VUT/OcclusionCullingSceneManager/include/OgreOcclusionCullingSceneManager.h
r32 r33 20 20 public: 21 21 OcclusionCullingSceneManager(); 22 //~OcclusionCullingSceneManager();22 ~OcclusionCullingSceneManager(); 23 23 24 24 /** Overriden from SceneManager. Renders the scene with the specified algorithm … … 49 49 50 50 protected: 51 OcclusionCullingSceneTraverser mSceneTraverser;51 OcclusionCullingSceneTraverser *mOcclusionCullingSceneTraverser; 52 52 53 53 }; -
trunk/VUT/OcclusionCullingSceneManager/include/OgreOcclusionCullingSceneTraverser.h
r32 r33 39 39 { 40 40 public: 41 OcclusionCullingSceneTraverser(); 41 /** Construction taking the current scene manager and the current rendersystem as argument 42 @param sm current scene manager 43 @param rsys current render system 44 */ 45 OcclusionCullingSceneTraverser(SceneManager *sm, RenderSystem *rsys); 42 46 ~OcclusionCullingSceneTraverser(); 43 47 44 48 enum {RENDER_CULL_FRUSTUM, RENDER_STOP_AND_WAIT, RENDER_COHERENT, NUM_RENDERMODES}; 45 49 46 /** Overriden from SceneManager. Renders the scene with the specified algorithm 47 /** 48 The algorithm is one of 50 /** Renders the scene with the specified algorithm 51 @comment 52 The algorithm type can be set with the parameter "Algorithm" and setOption. 53 54 The algorithm is one of: 49 55 RENDER_CULL_FRUSTUM: renders the scene with view frustum culling only 50 56 RENDER_STOP_AND_WAIT: renders the scene with the hierarchical stop and wait algorithm 51 57 RENDER_COHERENT: renders the scene with the coherent hierarchical algorithm 58 59 @param cam current camera 60 @param root root of hierarchy 52 61 */ 62 void renderScene( Camera *cam, SceneNode *root ); 63 53 64 54 /** Sets the given option for the SceneTraverser65 /** Sets the given option for the scene traverser. 55 66 @remarks 56 67 Options are: … … 58 69 */ 59 70 bool setOption( const String &, const void * ); 60 /** Gets the given option for the SceneTraverser.71 /** Gets the given option for the scene traverser. 61 72 @remarks 62 73 See setOption 63 74 */ 64 75 bool getOption( const String &, void * ); 65 66 /** Renders current scene 67 @param cam current camera 68 @param root root of hierarchy */ 69 void renderScene( Camera *cam, SceneNode *root ); 70 71 /** Sets the scene manager */ 76 bool getOptionKeys( StringVector &refKeys ); 77 78 /** Sets pointer to the current scene manager. 79 @param the scene manager */ 72 80 void setSceneManager( SceneManager *sm ); 73 /** Sets the render system */ 81 82 /** Sets pointer to the current render system 83 @param the rendersystem */ 74 84 void setRenderSystem( RenderSystem *rsys ); 75 85 86 /** Doing some necessary preprocessing. 87 @comment e.g., initialises occlusion queries */ 76 88 void preprocess( void ); 77 89 90 /** Sets the current number of scene nodes in the scene. 91 @param num number of scene nodes 92 */ 93 void setNumSceneNodes(int num ); 94 78 95 protected: 96 /** query mode (= without color) or RENDER_MODE */ 79 97 enum {MODE_QUERY, MODE_RENDER}; 80 98 /** returns true if node is leaf of the hierarchy */ -
trunk/VUT/OcclusionCullingSceneManager/scripts/Plugin_OcclusionCullingSceneManager.vcproj
r32 r33 20 20 Name="VCCLCompilerTool" 21 21 Optimization="0" 22 AdditionalIncludeDirectories=""$(OGRE_PATH)\PlugIns\OctreeSceneManager\include";"$(OGRE_ PATH)\Samples\Common\include";"$(OGRE_PATH)\Dependencies\include\CEGUI";"$(OGRE_PATH)\Samples\Common\CEGUIRenderer\include";"$(OGRE_PATH)\OgreMain\include";"$(OGRE_PATH)\Dependencies\include";..\include"22 AdditionalIncludeDirectories=""$(OGRE_PATH)\PlugIns\OctreeSceneManager\include";"$(OGRE_ADDONS_PATH)\dotsceneoctree\PlugIns\DotSceneManager\include";"$(OGRE_PATH)\Samples\Common\include";"$(OGRE_PATH)\Dependencies\include\CEGUI";"$(OGRE_PATH)\Samples\Common\CEGUIRenderer\include";"$(OGRE_PATH)\OgreMain\include";"$(OGRE_PATH)\Dependencies\include";..\include" 23 23 PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;PLUGIN_OCCLUSIONCULLINGSCENEMANAGER_EXPORTS;OGRE_COHERENT_OCCLUSION_CULLING" 24 24 MinimalRebuild="TRUE" … … 35 35 Name="VCLinkerTool" 36 36 IgnoreImportLibrary="TRUE" 37 AdditionalDependencies="OgreMain_d.lib CEGUIBase_d.lib OgreGUIRenderer_d.lib Plugin_OctreeSceneManager.lib "37 AdditionalDependencies="OgreMain_d.lib CEGUIBase_d.lib OgreGUIRenderer_d.lib Plugin_OctreeSceneManager.lib Plugin_DotSceneManager.lib" 38 38 OutputFile="$(OutDir)/Plugin_OcclusionCullingSceneManager.dll" 39 39 Version="0.99" 40 40 LinkIncremental="2" 41 41 SuppressStartupBanner="TRUE" 42 AdditionalLibraryDirectories=""$(OGRE_PATH)\OgreMain\lib\$(ConfigurationName)";"$(OGRE_PATH)\Dependencies\lib\$(ConfigurationName)";"$(OGRE_PATH)\PlugIns\OctreeSceneManager\bin\$(ConfigurationName)";"$(OGRE_PATH)\Samples\Common\CEGUIRenderer\lib" "42 AdditionalLibraryDirectories=""$(OGRE_PATH)\OgreMain\lib\$(ConfigurationName)";"$(OGRE_PATH)\Dependencies\lib\$(ConfigurationName)";"$(OGRE_PATH)\PlugIns\OctreeSceneManager\bin\$(ConfigurationName)";"$(OGRE_PATH)\Samples\Common\CEGUIRenderer\lib";"$(OGRE_ADDONS_PATH)\dotsceneoctree\PlugIns\DotSceneManager\bin\debug"" 43 43 ModuleDefinitionFile="..\misc\OgreOcclusionCullingSceneManager.def" 44 44 GenerateDebugInformation="TRUE" 45 45 ProgramDatabaseFile="$(OutDir)/Plugin_OcclusionCullingSceneManager.pdb" 46 46 SubSystem="2" 47 ImportLibrary=" "47 ImportLibrary="$(OUTDIR)\Plugin_OcclusionCullingSceneManager.lib" 48 48 TargetMachine="1"/> 49 49 <Tool … … 145 145 Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"> 146 146 <File 147 RelativePath="..\src\OgreOcclusionCullingDotSceneManager.cpp"> 148 </File> 149 <File 147 150 RelativePath="..\src\OgreOcclusionCullingResourceManager.cpp"> 148 151 </File> … … 157 160 </File> 158 161 <File 159 RelativePath="..\src\Ogre SolidHalfBoundingBox.cpp">162 RelativePath="..\src\OgreOcclusionCullingTerrainSceneManager.cpp"> 160 163 </File> 161 164 <File 162 RelativePath="..\ TestCulling\TestCullingApplication.cpp">165 RelativePath="..\src\OgreSolidHalfBoundingBox.cpp"> 163 166 </File> 164 167 </Filter> … … 166 169 Name="Header Files" 167 170 Filter="h;hpp;hxx;hm;inl;inc"> 171 <File 172 RelativePath="..\include\OgreOcclusionCullingDotSceneManager.h"> 173 </File> 168 174 <File 169 175 RelativePath="..\include\OgreOcclusionCullingResourceManager.h"> … … 174 180 <File 175 181 RelativePath="..\include\OgreOcclusionCullingSceneTraverser.h"> 182 </File> 183 <File 184 RelativePath="..\include\OgreOcclusionCullingTerrainSceneManager.h"> 176 185 </File> 177 186 <File -
trunk/VUT/OcclusionCullingSceneManager/src/OgreOcclusionCullingSceneManager.cpp
r32 r33 15 15 OcclusionCullingSceneManager::OcclusionCullingSceneManager() 16 16 { 17 mOcclusionCullingSceneTraverser = new OcclusionCullingSceneTraverser(this, mDestRenderSystem); 18 } 19 //----------------------------------------------------------------------- 20 OcclusionCullingSceneManager::~OcclusionCullingSceneManager() 21 { 22 delete mOcclusionCullingSceneTraverser; 17 23 } 18 24 //----------------------------------------------------------------------- … … 24 30 void OcclusionCullingSceneManager::_renderVisibleObjects( void ) 25 31 { 26 m SceneTraverser.renderScene(mCameraInProgress, mSceneRoot);32 mOcclusionCullingSceneTraverser->renderScene(mCameraInProgress, mSceneRoot); 27 33 } 28 34 //----------------------------------------------------------------------- … … 34 40 void OcclusionCullingSceneManager::_updateSceneGraph( Camera* cam ) 35 41 { 36 mSceneTraverser.preprocess(); 42 mOcclusionCullingSceneTraverser->setNumSceneNodes(mSceneNodes.size()); 43 mOcclusionCullingSceneTraverser->preprocess(); 37 44 38 45 SceneManager::_updateSceneGraph(cam); … … 41 48 bool OcclusionCullingSceneManager::setOption( const String & key, const void * val ) 42 49 { 43 m SceneTraverser.setOption(key, val);50 mOcclusionCullingSceneTraverser->setOption(key, val); 44 51 45 52 return SceneManager::setOption( key, val ); … … 48 55 bool OcclusionCullingSceneManager::getOption( const String & key, void *val ) 49 56 { 50 m SceneTraverser.getOption(key, val);57 mOcclusionCullingSceneTraverser->getOption(key, val); 51 58 52 59 return SceneManager::getOption( key, val ); … … 62 69 SceneManager::getOptionKeys( refKeys ); 63 70 64 refKeys.push_back( "Algorithm" ); 65 refKeys.push_back( "Threshold" ); 66 refKeys.push_back( "NumSceneNodes" ); 67 refKeys.push_back( "NumTraversedNodes" ); 68 refKeys.push_back( "NumQueryCulledNodes" ); 69 refKeys.push_back( "NumFrustumCulledNodes" ); 70 //refKeys.push_back( "mNumRenderedGeometry" ); 71 mOcclusionCullingSceneTraverser->getOptionKeys( refKeys ); 72 71 73 return true; 72 74 } -
trunk/VUT/OcclusionCullingSceneManager/src/OgreOcclusionCullingSceneManagerDll.cpp
r32 r33 24 24 */ 25 25 26 //#include "OgreOcclusionCullingSceneManager.h" 27 //#include "OgreTerrainOcclusionCullingSceneManager.h" 28 #include <OgreOctreeSceneManager.h> 29 #include <OgreTerrainSceneManager.h> 26 #include "OgreOcclusionCullingTerrainSceneManager.h" 27 #include "OgreOcclusionCullingSceneManager.h" 28 #include "OgreOcclusionCullingDotSceneManager.h" 30 29 #include <OgreRoot.h> 31 #include "OgreHeightmapTerrainPageSource.h" 30 31 //#include "OgreHeightmapTerrainPageSource.h" 32 32 //#include <windows.h> 33 33 34 34 namespace Ogre { 35 35 36 //OcclusionCullingSceneManager *occlusionPlugin; 37 //TerrainOcclusionCullingSceneManager *terrainOcclusionPlugin; 38 OctreeSceneManager *ocPlugin; 39 36 OcclusionCullingSceneManager *occlusionPlugin; 37 OcclusionCullingTerrainSceneManager *occlusionTerrainPlugin; 38 40 39 //----------------------------------------------------------------------- 41 40 extern "C" void dllStartPlugin(void) 42 41 { 43 42 // Create new scene manager 44 //occlusionPlugin = new OcclusionCullingSceneManager();45 oc Plugin = new OctreeSceneManager();43 occlusionPlugin = new OcclusionCullingSceneManager(); 44 occlusionTerrainPlugin = new OcclusionCullingTerrainSceneManager(); 46 45 47 46 // Register 48 //Root::getSingleton().setSceneManager( ST_GENERIC, occlusionPlugin ); 49 // Root::getSingleton().setSceneManager( ST_EXTERIOR_CLOSE, terrainOcclusionPlugin ); 50 Root::getSingleton().setSceneManager( ST_EXTERIOR_CLOSE, ocPlugin ); 51 52 //MessageBox( NULL, "myplugin registered", "this is my plugin", MB_OK | MB_ICONERROR | MB_TASKMODAL); 47 Root::getSingleton().setSceneManager( ST_GENERIC, occlusionPlugin ); 48 Root::getSingleton().setSceneManager( ST_EXTERIOR_CLOSE, occlusionTerrainPlugin ); 49 50 // MessageBox( NULL, "myplugin registered", "this is my plugin", MB_OK | MB_ICONERROR | MB_TASKMODAL); 53 51 } 54 52 extern "C" void dllStopPlugin(void) 55 53 { 56 // delete occlusionPlugin; 57 delete ocPlugin; 58 //delete terrainOcclusionPlugin; 54 delete occlusionPlugin; 55 delete occlusionTerrainPlugin; 59 56 } 60 57 } -
trunk/VUT/OcclusionCullingSceneManager/src/OgreOcclusionCullingSceneTraverser.cpp
r32 r33 7 7 #include "OgreSolidHalfBoundingBox.h" 8 8 9 9 10 #include <windows.h> 10 11 … … 12 13 13 14 //----------------------------------------------------------------------- 14 OcclusionCullingSceneTraverser::OcclusionCullingSceneTraverser( ):15 OcclusionCullingSceneTraverser::OcclusionCullingSceneTraverser(SceneManager *sm, RenderSystem *rsys): 15 16 mFrameId(1), mDistanceQueue(NULL), mVisibilityThreshold(0), mCurrentTestIdx(0), 16 17 mQueryMode(MODE_RENDER), mNumSceneNodes(0), mCurrentAlgorithm(RENDER_COHERENT), 17 18 mNumTraversedNodes(0), mNumQueryCulledNodes(0), mNumFrustumCulledNodes(0), 18 mNumRenderedGeometry(0), mSceneManager( 0), mRenderSystem(0)19 mNumRenderedGeometry(0), mSceneManager(sm), mRenderSystem(rsys) 19 20 { 20 21 mHalfBoundingBox[0] = mHalfBoundingBox[1] = 0; … … 257 258 //-- initialise occlusion queries. 258 259 deleteQueries(); 259 260 260 261 for(unsigned int i=0; i < mNumSceneNodes; i++) 261 262 { … … 389 390 return false; 390 391 } 392 //----------------------------------------------------------------------- 393 bool OcclusionCullingSceneTraverser::getOptionKeys( StringVector & refKeys ) 394 { 395 refKeys.push_back( "Algorithm" ); 396 refKeys.push_back( "Threshold" ); 397 refKeys.push_back( "NumSceneNodes" ); 398 refKeys.push_back( "NumTraversedNodes" ); 399 refKeys.push_back( "NumQueryCulledNodes" ); 400 refKeys.push_back( "NumFrustumCulledNodes" ); 401 //refKeys.push_back( "mNumRenderedGeometry" ); 402 403 return true; 404 } 405 //----------------------------------------------------------------------- 406 void OcclusionCullingSceneTraverser::setNumSceneNodes(int num) 407 { 408 mNumSceneNodes = num; 409 } 391 410 }
Note: See TracChangeset
for help on using the changeset viewer.