Changeset 92
- Timestamp:
- 05/11/05 15:29:32 (20 years ago)
- Location:
- trunk/VUT
- Files:
-
- 2 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibility/include/VisibilityManager.h
r74 r92 32 32 */ 33 33 void SetCullingManager(VisibilityEnvironment::CullingManagerType ocmType); 34 /** Returns the current online occlusion culling manager. See set34 /** Returns the current online occlusion culling manager. 35 35 */ 36 36 CullingManager *GetCullingManager(); 37 /** Returns the current online occlusion culling manager type. See set 38 */ 39 VisibilityEnvironment::CullingManagerType GetCullingManagerType(); 37 40 38 41 /** Applies the online visibility culling algorithm on a scene. -
trunk/VUT/GtpVisibility/src/StopAndWaitCullingManager.cpp
r87 r92 39 39 40 40 mHierarchyInterface->IssueOcclusionQuery(node)->GetQueryResult(visiblePixels, true); 41 41 42 42 // node visible 43 43 if (visiblePixels > mVisibilityThreshold) -
trunk/VUT/GtpVisibility/src/VisibilityManager.cpp
r74 r92 30 30 if (mCullingManagerType != ocmType) 31 31 { 32 mCullingManagerType = ocmType;32 // delete old culling manager 33 33 delete mCullingManager; 34 34 35 mCullingManagerType = ocmType; 36 35 37 switch (ocmType) 36 38 { … … 68 70 mCullingManager->RenderScene(); 69 71 } 72 VisibilityEnvironment::CullingManagerType VisibilityManager::GetCullingManagerType() 73 { 74 return mCullingManagerType; 75 } 70 76 //----------------------------------------------------------------------- 71 77 } // namespace GtpVisibility -
trunk/VUT/Ogre/include/OgrePlatformHierarchyInterface.h
r86 r92 7 7 #include <OgreRenderSystem.h> 8 8 9 #include "OgreSolidHalfBoundingBox.h" 9 //#include "OgreSolidHalfBoundingBox.h" 10 #include "OgreSolidBoundingBox.h" 10 11 #include "HierarchyInterface.h" 11 12 #include "OgrePlatformOcclusionQuery.h" … … 81 82 /** Returns pointer to current renderable half bounding box geometry 82 83 */ 83 SolidHalfBoundingBox *GetSolidHalfBoundingBox(); 84 //SolidHalfBoundingBox *GetSolidHalfBoundingBox(); 85 /** Returns pointer to current renderable bounding box geometry 86 */ 87 SolidBoundingBox *GetSolidBoundingBox(); 84 88 85 89 /** one renderable half of an aabb. 86 90 */ 87 Solid HalfBoundingBox *mSolidHalfBoundingBox;91 SolidBoundingBox *mSolidBoundingBox; 88 92 89 93 SceneManager *mSceneManager; -
trunk/VUT/Ogre/include/OgreSolidHalfBoundingBox.h
r86 r92 6 6 namespace Ogre { 7 7 8 /** Allows the renderingof one half of a solid bounding box.8 /** The renderable of one half of a solid bounding box. 9 9 @remarks 10 This class builds a wireframerenderable from a given aabb. A pointer to this class can be10 This class builds a solid renderable from a given aabb. A pointer to this class can be 11 11 added to a render queue to display the bounding box of an object. 12 12 */ -
trunk/VUT/Ogre/include/OgreVisibilityOctreeSceneManager.h
r87 r92 50 50 GtpVisibility::VisibilityManager *getVisibilityManager( void ); 51 51 52 //writes out into the Ogre log file 53 void WriteLog(); 54 52 55 protected: 53 56 -
trunk/VUT/Ogre/include/OgreVisibilityTerrainSceneManager.h
r87 r92 53 53 GtpVisibility::VisibilityManager *getVisibilityManager(); 54 54 55 //writes out statis into the Ogre log file 56 void WriteLog(); 57 55 58 protected: 56 59 57 60 OctreeHierarchyInterface *mHierarchyInterface; 58 61 GtpVisibility::VisibilityManager *mVisibilityManager; -
trunk/VUT/Ogre/scripts/Plugin_VisibilitySceneManager.vcproj
r74 r92 196 196 </File> 197 197 <File 198 RelativePath="..\include\OgreSolidBoundingBox.h"> 199 </File> 200 <File 198 201 RelativePath="..\include\OgreSolidHalfBoundingBox.h"> 199 202 </File> … … 216 219 <File 217 220 RelativePath="..\src\OgreSceneNodeHierarchyInterface.cpp"> 221 </File> 222 <File 223 RelativePath="..\src\OgreSolidBoundingBox.cpp"> 218 224 </File> 219 225 <File -
trunk/VUT/Ogre/src/OgrePlatformHierarchyInterface.cpp
r91 r92 1 //#include <OgreMath.h>2 //#include <OgreIteratorWrappers.h>3 1 #include <OgreCamera.h> 4 2 5 #include "OgreSolidHalfBoundingBox.h" 3 //#include "OgreSolidHalfBoundingBox.h" 4 #include "OgreSolidBoundingBox.h" 6 5 #include "OgrePlatformHierarchyInterface.h" 7 6 #include "OgrePlatformOcclusionQuery.h" … … 12 11 //----------------------------------------------------------------------- 13 12 PlatformHierarchyInterface::PlatformHierarchyInterface(SceneManager *sm, RenderSystem *rsys): 14 mSceneManager(sm), mRenderSystem(rsys), mSolid HalfBoundingBox(NULL)13 mSceneManager(sm), mRenderSystem(rsys), mSolidBoundingBox(NULL)/*, mSolidHalfBoundingBox(NULL)*/ 15 14 { 16 15 } … … 20 19 DeleteQueries(); 21 20 22 if(mSolid HalfBoundingBox)23 delete mSolid HalfBoundingBox;21 if(mSolidBoundingBox) 22 delete mSolidBoundingBox; 24 23 } 25 24 //----------------------------------------------------------------------- … … 37 36 38 37 //TODO: this should be the full bounding box 39 Solid HalfBoundingBox *halfbox = GetSolidHalfBoundingBox();38 SolidBoundingBox *solidBox = GetSolidBoundingBox(); 40 39 41 40 mRenderSystem->_setWorldMatrix(Ogre::Matrix4::IDENTITY); 42 mSceneManager->useRenderableViewProjMode(halfbox); 43 mSceneManager->setPass(halfbox->getTechnique()->getPass(0)); 41 mSceneManager->useRenderableViewProjMode(solidBox); 42 mSceneManager->setPass(solidBox->getTechnique()->getPass(0)); 43 44 solidBox->SetupBoundingBoxVertices(*box); 45 46 solidBox->getRenderOperation(ro); 47 ro.srcRenderable = solidBox; 48 mRenderSystem->_render(ro); 44 49 45 50 // Render two halfes of the bounding box (using triangle fans) 46 for(int halfIdx = 0; halfIdx < 2; ++halfIdx)51 /*for(int halfIdx = 0; halfIdx < 2; ++halfIdx) 47 52 { 48 halfbox->SetupBoundingBoxVertices(*box, halfIdx == 1);53 solidBox->SetupBoundingBoxVertices(*box, halfIdx == 1); 49 54 50 halfbox->getRenderOperation(ro);51 ro.srcRenderable = halfbox;55 solidBox->getRenderOperation(ro); 56 ro.srcRenderable = solidBox; 52 57 mRenderSystem->_render(ro); 53 } 58 }*/ 54 59 } 55 60 //----------------------------------------------------------------------- … … 121 126 } 122 127 //----------------------------------------------------------------------- 123 Solid HalfBoundingBox *PlatformHierarchyInterface::GetSolidHalfBoundingBox()128 SolidBoundingBox *PlatformHierarchyInterface::GetSolidBoundingBox() 124 129 { 125 if(!mSolid HalfBoundingBox)126 mSolid HalfBoundingBox = new SolidHalfBoundingBox;130 if(!mSolidBoundingBox) 131 mSolidBoundingBox = new SolidBoundingBox; 127 132 128 return mSolid HalfBoundingBox;133 return mSolidBoundingBox; 129 134 } 130 135 -
trunk/VUT/Ogre/src/OgreVisibilityOctreeSceneManager.cpp
r91 r92 5 5 #include <OgreRenderSystem.h> 6 6 #include <OgreCamera.h> 7 #include <OgreLogManager.h> 7 8 8 9 #include <windows.h> … … 73 74 clearSpecialCaseRenderQueues(); 74 75 SceneManager::_renderVisibleObjects(); 76 77 // write out stats 78 WriteLog(); 75 79 } 76 80 //----------------------------------------------------------------------- … … 141 145 return mVisibilityManager; 142 146 } 147 void VisibilityOctreeSceneManager::WriteLog() 148 { 149 std::stringstream d; 143 150 151 d << "Algorithm type: " << mVisibilityManager->GetCullingManagerType() << ", " 152 << "Hierarchy nodes: " << mNumOctreeNodes << ", " << "Traversed nodes: " << mHierarchyInterface->GetNumTraversedNodes() << ", " 153 << "Rendered nodes: " << mHierarchyInterface->GetNumRenderedNodes() << ", " 154 << "Query culled nodes: " << mVisibilityManager->GetCullingManager()->GetNumQueryCulledNodes() << ", " 155 << "Frustum culled nodes: " << mVisibilityManager->GetCullingManager()->GetNumFrustumCulledNodes() << ", " 156 << "Queries issued: " << mVisibilityManager->GetCullingManager()->GetNumQueriesIssued() << "\n"; 157 158 LogManager::getSingleton().logMessage(d.str()); 159 } 144 160 } // namespace Ogre -
trunk/VUT/work/ogre_changes/OgreMain/include/OgreHardwareOcclusionQuery.h
r88 r92 96 96 * Pulls the hardware occlusion query too see if there is a result. 97 97 * @retval NumOfFragments will get the resulting number of fragments. 98 * @param waitForResult if true, the query will wait until a result is available 98 99 * @return True if success or false if not. 99 100 * @Remarks Hardware occlusion is an assyncronius process the result may take a frame or so. 100 * one idea is to test pass1 and if not vis able skip pass2. Also note that objects101 * not vis able must be tested evrey frame. Visable objects don't need testing every frame.101 * one idea is to test pass1 and if not visible skip pass2. Also note that objects 102 * not visible must be tested evrey frame. Visable objects don't need testing every frame. 102 103 * Testing non visable objects can be don unlit, no texture with low LOD object. 103 104 * 0 will generate all the levels till 1x1. [default: 0] 104 105 */ 105 virtual bool pullOcclusionQuery( unsigned int* NumOfFragments, const bool waitForResult ) = 0; 106 106 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 107 virtual bool pullOcclusionQuery( unsigned int* NumOfFragments, const bool waitForResult ) = 0; 108 #else 109 virtual bool pullOcclusionQuery( unsigned int* NumOfFragments ) = 0; 110 #endif 107 111 /** 108 112 * Pulls the hardware occlusion query too see if there is a result. 109 113 * @retval NumOfFragments will get the resulting number of fragments. 114 * @param waitForResult if true, the query will wait until a result is available 110 115 * @return True if success or false if not. 111 116 * @Remarks In DX9 mode specifying OCCLUSIONQUERY_FLUSH as the flag, will case the driver to flush whatever API calls are batched. 112 117 * In OpenGL mode it makes no difference if you specify OCCLUSIONQUERY_FLUSH or OCCLUSIONQUERY_NOFLUSH. 113 118 */ 114 virtual bool pullOcclusionQuery( unsigned int* NumOfFragments, const bool waitForResult, 115 const HW_OCCLUSIONQUERY flag ) = 0; 116 119 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 120 virtual bool pullOcclusionQuery( unsigned int* NumOfFragments, const bool waitForResult, 121 const HW_OCCLUSIONQUERY flag ) = 0; 122 #else 123 virtual bool pullOcclusionQuery( unsigned int* NumOfFragments, 124 const HW_OCCLUSIONQUERY flag ) = 0; 125 #endif 117 126 /** 118 127 * Let's you get the last pixel count with out doing the hardware occlusion test -
trunk/VUT/work/ogre_changes/RenderSystems/Direct3D9/include/OgreD3D9HardwareOcclusionQuery.h
r88 r92 71 71 void beginOcclusionQuery(); 72 72 void endOcclusionQuery(); 73 bool pullOcclusionQuery( unsigned int* NumOfFragments, const bool waitForResult ); 73 74 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 74 75 bool pullOcclusionQuery( unsigned int* NumOfFragments, const bool waitForResult, 75 76 const HW_OCCLUSIONQUERY flag ); 77 bool pullOcclusionQuery( unsigned int* NumOfFragments, const bool waitForResult ); 78 #else 79 bool pullOcclusionQuery( unsigned int* NumOfFragments ); 80 bool pullOcclusionQuery( unsigned int* NumOfFragments, const HW_OCCLUSIONQUERY flag ); 81 #endif // GTP_VISIBILITY_MODIFIED_OGRE 76 82 77 83 unsigned int getLastQuerysPixelcount() { return m_uintPixelCount; } -
trunk/VUT/work/ogre_changes/RenderSystems/GL/include/OgreGLHardwareOcclusionQuery.h
r88 r92 88 88 void beginOcclusionQuery(); 89 89 void endOcclusionQuery(); 90 bool pullOcclusionQuery( unsigned int* NumOfFragments, const bool waitForResult ); 90 91 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 91 92 bool pullOcclusionQuery( unsigned int* NumOfFragments, const bool waitForResult, 92 93 const HW_OCCLUSIONQUERY flag ); 94 bool pullOcclusionQuery( unsigned int* NumOfFragments, const bool waitForResult ); 95 #else 96 bool pullOcclusionQuery( unsigned int* NumOfFragments ); 97 bool pullOcclusionQuery( unsigned int* NumOfFragments, const HW_OCCLUSIONQUERY flag ); 98 #endif // GTP_VISIBILITY_MODIFIED_OGRE 93 99 94 100 unsigned int getLastQuerysPixelcount() { return m_uintPixelCount; }
Note: See TracChangeset
for help on using the changeset viewer.