Changeset 92


Ignore:
Timestamp:
05/11/05 15:29:32 (19 years ago)
Author:
mattausch
Message:

exchanged halfbounding box with full bounding box

Location:
trunk/VUT
Files:
2 added
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/GtpVisibility/include/VisibilityManager.h

    r74 r92  
    3232        */ 
    3333        void SetCullingManager(VisibilityEnvironment::CullingManagerType ocmType); 
    34         /** Returns the current online occlusion culling manager. See set 
     34        /** Returns the current online occlusion culling manager. 
    3535        */ 
    3636        CullingManager *GetCullingManager(); 
     37        /** Returns the current online occlusion culling manager type. See set 
     38        */ 
     39        VisibilityEnvironment::CullingManagerType GetCullingManagerType(); 
    3740 
    3841        /** Applies the online visibility culling algorithm on a scene. 
  • trunk/VUT/GtpVisibility/src/StopAndWaitCullingManager.cpp

    r87 r92  
    3939 
    4040                        mHierarchyInterface->IssueOcclusionQuery(node)->GetQueryResult(visiblePixels, true); 
    41  
     41                         
    4242                        // node visible 
    4343                        if (visiblePixels > mVisibilityThreshold) 
  • trunk/VUT/GtpVisibility/src/VisibilityManager.cpp

    r74 r92  
    3030        if (mCullingManagerType != ocmType) 
    3131        { 
    32                 mCullingManagerType = ocmType; 
     32                // delete old culling manager 
    3333                delete mCullingManager; 
    3434 
     35                mCullingManagerType = ocmType; 
     36                 
    3537                switch (ocmType) 
    3638                { 
     
    6870        mCullingManager->RenderScene(); 
    6971} 
     72VisibilityEnvironment::CullingManagerType VisibilityManager::GetCullingManagerType() 
     73{ 
     74        return mCullingManagerType; 
     75} 
    7076//----------------------------------------------------------------------- 
    7177} // namespace GtpVisibility 
  • trunk/VUT/Ogre/include/OgrePlatformHierarchyInterface.h

    r86 r92  
    77#include <OgreRenderSystem.h> 
    88 
    9 #include "OgreSolidHalfBoundingBox.h" 
     9//#include "OgreSolidHalfBoundingBox.h" 
     10#include "OgreSolidBoundingBox.h" 
    1011#include "HierarchyInterface.h" 
    1112#include "OgrePlatformOcclusionQuery.h" 
     
    8182        /** Returns pointer to current renderable half bounding box geometry 
    8283        */ 
    83         SolidHalfBoundingBox *GetSolidHalfBoundingBox(); 
     84        //SolidHalfBoundingBox *GetSolidHalfBoundingBox(); 
     85        /** Returns pointer to current renderable bounding box geometry 
     86        */ 
     87        SolidBoundingBox *GetSolidBoundingBox(); 
    8488 
    8589        /** one renderable half of an aabb.  
    8690        */ 
    87         SolidHalfBoundingBox *mSolidHalfBoundingBox; 
     91        SolidBoundingBox *mSolidBoundingBox; 
    8892 
    8993        SceneManager *mSceneManager; 
  • trunk/VUT/Ogre/include/OgreSolidHalfBoundingBox.h

    r86 r92  
    66namespace Ogre { 
    77 
    8 /** Allows the rendering of one half of a solid bounding box. 
     8/** The renderable of one half of a solid bounding box. 
    99    @remarks 
    10         This class builds a wireframe renderable from a given aabb. A pointer to this class can be 
     10        This class builds a solid renderable from a given aabb. A pointer to this class can be 
    1111                added to a render queue to display the bounding box of an object. 
    1212*/ 
  • trunk/VUT/Ogre/include/OgreVisibilityOctreeSceneManager.h

    r87 r92  
    5050        GtpVisibility::VisibilityManager *getVisibilityManager( void ); 
    5151 
     52        //writes out into the Ogre log file 
     53        void WriteLog(); 
     54 
    5255protected: 
    5356         
  • trunk/VUT/Ogre/include/OgreVisibilityTerrainSceneManager.h

    r87 r92  
    5353        GtpVisibility::VisibilityManager *getVisibilityManager(); 
    5454         
     55        //writes out statis into the Ogre log file 
     56        void WriteLog(); 
     57 
    5558protected: 
    56  
     59         
    5760        OctreeHierarchyInterface *mHierarchyInterface; 
    5861        GtpVisibility::VisibilityManager *mVisibilityManager; 
  • trunk/VUT/Ogre/scripts/Plugin_VisibilitySceneManager.vcproj

    r74 r92  
    196196                                </File> 
    197197                                <File 
     198                                        RelativePath="..\include\OgreSolidBoundingBox.h"> 
     199                                </File> 
     200                                <File 
    198201                                        RelativePath="..\include\OgreSolidHalfBoundingBox.h"> 
    199202                                </File> 
     
    216219                                <File 
    217220                                        RelativePath="..\src\OgreSceneNodeHierarchyInterface.cpp"> 
     221                                </File> 
     222                                <File 
     223                                        RelativePath="..\src\OgreSolidBoundingBox.cpp"> 
    218224                                </File> 
    219225                                <File 
  • trunk/VUT/Ogre/src/OgrePlatformHierarchyInterface.cpp

    r91 r92  
    1 //#include <OgreMath.h> 
    2 //#include <OgreIteratorWrappers.h> 
    31#include <OgreCamera.h> 
    42 
    5 #include "OgreSolidHalfBoundingBox.h" 
     3//#include "OgreSolidHalfBoundingBox.h" 
     4#include "OgreSolidBoundingBox.h" 
    65#include "OgrePlatformHierarchyInterface.h" 
    76#include "OgrePlatformOcclusionQuery.h" 
     
    1211//----------------------------------------------------------------------- 
    1312PlatformHierarchyInterface::PlatformHierarchyInterface(SceneManager *sm, RenderSystem *rsys): 
    14 mSceneManager(sm), mRenderSystem(rsys), mSolidHalfBoundingBox(NULL) 
     13mSceneManager(sm), mRenderSystem(rsys), mSolidBoundingBox(NULL)/*, mSolidHalfBoundingBox(NULL)*/ 
    1514{ 
    1615} 
     
    2019        DeleteQueries(); 
    2120 
    22         if(mSolidHalfBoundingBox) 
    23                 delete mSolidHalfBoundingBox; 
     21        if(mSolidBoundingBox) 
     22                delete mSolidBoundingBox; 
    2423} 
    2524//----------------------------------------------------------------------- 
     
    3736 
    3837        //TODO: this should be the full bounding box 
    39         SolidHalfBoundingBox *halfbox = GetSolidHalfBoundingBox(); 
     38        SolidBoundingBox *solidBox = GetSolidBoundingBox(); 
    4039         
    4140        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); 
    4449 
    4550        // 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) 
    4752        { 
    48                 halfbox->SetupBoundingBoxVertices(*box, halfIdx == 1); 
     53                solidBox->SetupBoundingBoxVertices(*box, halfIdx == 1); 
    4954                                 
    50                 halfbox->getRenderOperation(ro); 
    51                 ro.srcRenderable = halfbox; 
     55                solidBox->getRenderOperation(ro); 
     56                ro.srcRenderable = solidBox; 
    5257                mRenderSystem->_render(ro); 
    53         } 
     58        }*/ 
    5459} 
    5560//----------------------------------------------------------------------- 
     
    121126} 
    122127//----------------------------------------------------------------------- 
    123 SolidHalfBoundingBox *PlatformHierarchyInterface::GetSolidHalfBoundingBox() 
     128SolidBoundingBox *PlatformHierarchyInterface::GetSolidBoundingBox() 
    124129{ 
    125         if(!mSolidHalfBoundingBox) 
    126                 mSolidHalfBoundingBox = new SolidHalfBoundingBox; 
     130        if(!mSolidBoundingBox) 
     131                mSolidBoundingBox = new SolidBoundingBox; 
    127132 
    128         return mSolidHalfBoundingBox; 
     133        return mSolidBoundingBox; 
    129134} 
    130135 
  • trunk/VUT/Ogre/src/OgreVisibilityOctreeSceneManager.cpp

    r91 r92  
    55#include <OgreRenderSystem.h> 
    66#include <OgreCamera.h> 
     7#include <OgreLogManager.h> 
    78 
    89#include <windows.h> 
     
    7374        clearSpecialCaseRenderQueues(); 
    7475        SceneManager::_renderVisibleObjects(); 
     76 
     77        // write out stats 
     78        WriteLog(); 
    7579} 
    7680//----------------------------------------------------------------------- 
     
    141145        return mVisibilityManager; 
    142146} 
     147void VisibilityOctreeSceneManager::WriteLog() 
     148{ 
     149        std::stringstream d; 
    143150 
     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} 
    144160}   // namespace Ogre 
  • trunk/VUT/work/ogre_changes/OgreMain/include/OgreHardwareOcclusionQuery.h

    r88 r92  
    9696      * Pulls the hardware occlusion query too see if there is a result. 
    9797      * @retval NumOfFragments will get the resulting number of fragments. 
     98          * @param waitForResult if true, the query will wait until a result is available 
    9899      * @return True if success or false if not. 
    99100          * @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 visable skip pass2. Also note that objects 
    101           *                     not visable 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. 
    102103          *                     Testing non visable objects can be don unlit, no texture with low LOD object. 
    103104          *        0 will generate all the levels till 1x1. [default: 0] 
    104105      */ 
    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 
    107111        /** 
    108112      * Pulls the hardware occlusion query too see if there is a result. 
    109113      * @retval NumOfFragments will get the resulting number of fragments. 
     114          * @param waitForResult if true, the query will wait until a result is available 
    110115      * @return True if success or false if not. 
    111116          * @Remarks In DX9 mode specifying OCCLUSIONQUERY_FLUSH as the flag, will case the driver to flush whatever API calls are batched. 
    112117          * In OpenGL mode it makes no difference if you specify OCCLUSIONQUERY_FLUSH or OCCLUSIONQUERY_NOFLUSH. 
    113118      */ 
    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 
    117126        /** 
    118127          * 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  
    7171        void beginOcclusionQuery();      
    7272        void endOcclusionQuery(); 
    73         bool pullOcclusionQuery( unsigned int* NumOfFragments, const bool waitForResult ); 
     73 
     74#ifdef GTP_VISIBILITY_MODIFIED_OGRE 
    7475        bool pullOcclusionQuery( unsigned int* NumOfFragments, const bool waitForResult, 
    7576                                                         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 
    7682 
    7783        unsigned int getLastQuerysPixelcount() { return m_uintPixelCount; } 
  • trunk/VUT/work/ogre_changes/RenderSystems/GL/include/OgreGLHardwareOcclusionQuery.h

    r88 r92  
    8888        void beginOcclusionQuery(); 
    8989        void endOcclusionQuery(); 
    90         bool pullOcclusionQuery( unsigned int* NumOfFragments, const bool waitForResult ); 
     90 
     91#ifdef GTP_VISIBILITY_MODIFIED_OGRE 
    9192        bool pullOcclusionQuery( unsigned int* NumOfFragments, const bool waitForResult, 
    9293                                                         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 
    9399 
    94100        unsigned int getLastQuerysPixelcount() { return m_uintPixelCount; } 
Note: See TracChangeset for help on using the changeset viewer.