Ignore:
Timestamp:
10/05/07 15:36:52 (17 years ago)
Author:
mattausch
Message:

added partial implementation of chc++. problem: bounding box rendering in Ogre is VERY slow

Location:
GTP/trunk/Lib/Vis/OnlineCullingCHC/include
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/include/CoherentHierarchicalCullingManager.h

    r2455 r2555  
    7070 
    7171        bool mTestGeometryForVisibleLeaves; 
     72 
     73        QueryQueue mQueryQueue; 
    7274}; 
    7375 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/include/CoherentHierarchicalCullingPlusPlusManager.h

    r2553 r2555  
    1 #ifndef _BatchedQueriesCullingManager_H__ 
    2 #define _BatchedQueriesCullingManager_H__ 
     1#ifndef _CoherentHierarchicalCullingPlusPlusManager_H__ 
     2#define _CoherentHierarchicalCullingPlusPlusManager_H__ 
    33 
    4 #include "CoherentHierarchicalCullingManager.h" 
     4#include "CullingManager.h" 
    55#include "HierarchyInterface.h" 
    66 
     
    1111/** Renders the scene with the coherent hierarchical culling algorithm.  
    1212*/ 
    13 class BatchedQueriesCullingManager : public CoherentHierarchicalCullingManager 
     13class CoherentHierarchicalCullingPlusPlusManager: public CullingManager 
    1414{ 
    1515public: 
    16         BatchedQueriesCullingManager(); 
     16        CoherentHierarchicalCullingPlusPlusManager(); 
    1717        /** Constructor taking the assumed visibility into account, i.e., the estimation 
    1818                for how many frames the current visibility is considered to be valid 
    1919        */ 
    20         BatchedQueriesCullingManager(const unsigned int assumedVisibility); 
     20        CoherentHierarchicalCullingPlusPlusManager(const unsigned int assumedVisibility); 
    2121 
    2222        void RenderScene(); 
    2323         
    24         void SetMaxPending(int maxPending); 
     24        /** Sets assumed visibility (i.e., an estimation for  
     25                how many frames the visibility is considered to be valid). 
     26                @param assumedVisibility indicates for how many frames the  
     27                same visibility is be assumed. 
     28                if 0, the visibility is tested deterministically for each frame. 
     29        */ 
     30        void SetAssumedVisibility(const unsigned int assumedVisibility);         
     31        /** This is an optimization when issuing the occlusion test.  
     32                The test is done with actual geometry rather than the bounding  
     33                box of leave nodes previously marked as visible. 
     34 
     35                @param testGeometry if this optimization should be used 
     36                @remark this option is only useful for the coherent hierarchical culling algorithm 
     37        */ 
     38        void SetTestGeometryForVisibleLeaves(const bool testGeometry); 
     39        /** See TestGeometryForVisibleLeaves 
     40        */ 
     41        bool GetTestGeometryForVisibleLeaves(); 
     42 
    2543 
    2644protected: 
    2745 
    28         void IssueMultipleQueries(PendingQueue &pendingQueue, QueryQueue &queryQueue); 
     46        /** Decides if node is considered to be visible depeding on the  
     47                assumed visibility factor. 
     48                @returns if node is considered to be visible 
     49        */ 
     50        bool DecideVisible(HierarchyNode *node) const; 
    2951 
    30         /** maximal pending nodes. 
     52        /** Skip query for this node. 
    3153        */ 
    32         int mMaxPending; 
     54        void SkipQuery(HierarchyNode *node) const; 
     55 
     56        /** If this node is still valid for traversal in this frame. 
     57                It is possible that the parent was tested invisible before 
     58                so this node can be skipped. 
     59        */ 
     60        bool NodeInvalid(HierarchyNode *node) const; 
     61 
     62        void AssignAssumedVisibility(GtpVisibility::HierarchyNode *node); 
     63 
     64        void IssueBatchedQuery(HierarchyNodeContainer &nodes); 
     65 
     66        inline void IssueQuery(HierarchyNode *node, const bool testGeometry); 
     67 
     68 
     69        ////////////////////// 
     70 
     71        /** number of steps the visibility is assumed to be valid. 
     72        */ 
     73        unsigned int mAssumedVisibility; 
     74 
     75        bool mTestGeometryForVisibleLeaves; 
     76 
     77        QueryQueue mQueryQueue; 
     78 
     79        std::queue<HierarchyNode *> mVisibleNodes; 
     80        HierarchyNodeContainer mInvisibleNodes; 
     81 
     82        int mMaxInvisibleNodesSize; 
    3383}; 
    3484 
    3585} // namespace GtpVisibility 
    3686 
    37 #endif // BatchedQueriesCullingManager_H 
     87#endif // CoherentHierarchicalCullingPlusPlusManager_H 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/include/HierarchyInterface.h

    r2543 r2555  
    164164        */ 
    165165        virtual void DecNodeAssumedVisible(HierarchyNode *node) = 0; 
     166         
     167        virtual void AddToQueue(GtpVisibility::HierarchyNode *node) = 0; 
     168 
     169        virtual void RenderQueue() = 0; 
     170 
     171        virtual void TraverseNode2(GtpVisibility::HierarchyNode *node) = 0; 
    166172 
    167173protected: 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/include/VisibilityEnvironment.h

    r2289 r2555  
    2222        */ 
    2323        enum CullingManagerType {COHERENT_HIERARCHICAL_CULLING,  
     24                                                         COHERENT_HIERARCHICAL_CULLING_PLUSPLUS, 
     25                                                         STOP_AND_WAIT_CULLING,  
    2426                                                         FRUSTUM_CULLING,  
    25                                                          RANDOM_UPDATE_CULLING, 
    26                                                          STOP_AND_WAIT_CULLING,  
    27                                                          NUM_CULLING_MANAGERS}; 
     27                             NUM_CULLING_MANAGERS}; 
    2828 
    2929         
Note: See TracChangeset for help on using the changeset viewer.