Ignore:
Timestamp:
06/14/07 17:24:08 (18 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/Lib/Vis/OnlineCullingCHC/include
Files:
5 edited

Legend:

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

    r2332 r2455  
    2121 
    2222        void RenderScene(); 
     23         
    2324        /** Sets assumed visibility (i.e., an estimation for  
    2425                how many frames the visibility is considered to be valid). 
     
    2728                if 0, the visibility is tested deterministically for each frame. 
    2829        */ 
    29         void SetAssumedVisibility(const unsigned int assumedVisibility); 
     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 
    3043 
    3144protected: 
     
    4760        bool NodeInvalid(HierarchyNode *node) const; 
    4861 
     62        void AssignAssumedVisibility(GtpVisibility::HierarchyNode *node); 
     63 
     64 
     65        ////////////////////// 
     66 
    4967        /** number of steps the visibility is assumed to be valid. 
    5068        */ 
    5169        unsigned int mAssumedVisibility; 
    5270 
    53         /** Threshold for rand function to return positive result with respect to 
    54                 mAssumedVisibility. 
    55         */ 
    56         int mThreshold; 
     71        bool mTestGeometryForVisibleLeaves; 
    5772}; 
    5873 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/include/CoherentHierarchicalCullingManager2.h

    r2360 r2455  
    99{ 
    1010 
    11 /** Renders the scene with the coherent hierarchical culling algorithm.  
     11/** Renders the scene with the coherent hierarchical culling algorithm with 
     12        some additional features 
    1213*/ 
    13 class CoherentHierarchicalCullingManager2 : public CullingManager 
     14class CoherentHierarchicalCullingManager2: public CullingManager 
    1415{ 
    1516public: 
    1617        CoherentHierarchicalCullingManager2(); 
     18 
    1719        /** Constructor taking the assumed visibility into account, i.e., the estimation 
    1820                for how many frames the current visibility is considered to be valid 
     
    2022        CoherentHierarchicalCullingManager2(const unsigned int assumedVisibility); 
    2123 
     24        /** The main render routine. 
     25        */ 
    2226        void RenderScene(); 
     27 
    2328        /** Sets assumed visibility (i.e., an estimation for  
    2429                how many frames the visibility is considered to be valid). 
     
    3035 
    3136protected: 
     37 
    3238        /** Decides if node is considered to be visible depeding on the  
    3339                assumed visibility factor. 
     
    3541        */ 
    3642        bool DecideVisible(HierarchyNode *node) const; 
    37  
    3843 
    3944        /** Skip query for this node. 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/include/HierarchyInterface.h

    r2332 r2455  
    22#define _GtpVisibilityHierarchyInterface_H__ 
    33 
     4 
    45#include "DistanceQueue.h" 
    5 //#include "VisibilityMesh.h" 
    66#include <stack> 
     7 
    78 
    89namespace GtpVisibility { 
     
    5253        /** Issue a occlusion query for this node.  
    5354                @param node the current hierarchy node 
    54                 @param wasVisible if the node was visible in the last frame: based 
    55                 on this the method can decide on the way of querying 
     55                @param testGeometry (if geometry should be tested instead of the bb). 
    5656                @returns occlusion query for this node 
    5757        */ 
    5858        virtual OcclusionQuery *IssueNodeOcclusionQuery(HierarchyNode *node,  
    59                                                                                                         const bool wasVisible = false) = 0; 
     59                                                                                                        const bool testGeometry = false) = 0; 
    6060        /** Returns distance of the node to the view plane. 
    6161                @param node the hierarchy node 
     
    119119        */ 
    120120        HierarchyNode *GetHierarchyRoot() const; 
    121          
    122         /** This is an optimization when issuing the occlusion test.  
    123                 The test is done with actual geometry rather than the bounding  
    124                 box of leave nodes previously marked as visible. 
    125  
    126                 @param testGeometry if this optimization should be used 
    127                 @remark this option is only useful for the coherent hierarchical culling algorithm 
    128         */ 
    129         void TestGeometryForVisibleLeaves(bool testGeometry); 
    130  
    131121        /** Sets the scene root and initialises this hierarchy interface for a traversal.                
    132122                @remark also resets the statistics evaluated in the last traversal 
     
    142132        */ 
    143133        DistanceQueue *GetQueue(); 
    144  
    145134        /** Checks if the node is visible from the current view frustum. 
    146135                @param node the current node 
    147136        */ 
    148137        bool CheckFrustumVisible(HierarchyNode *node); 
    149  
    150138        /** Returns number of traversed nodes. 
    151139        */ 
     
    154142        */ 
    155143        unsigned int GetNumRenderedNodes(); 
    156  
    157144        /** Returns vector of visible hierarchy nodes from previous render. 
    158145        */ 
    159146        std::vector<HierarchyNode *> *GetVisibleNodes(); 
    160  
     147        /** Pulls up the last visited information of this node. 
     148        */ 
    161149        virtual void PullUpLastVisited(HierarchyNode *node, const int frameId) const = 0; 
    162         virtual void DetermineVisibilityRatio(HierarchyNode *node) const = 0; 
    163         virtual float GetNodeVisibilityRatio(HierarchyNode *node) const = 0; 
    164  
     150        /** Returns parent node. 
     151        */ 
    165152        virtual HierarchyNode *GetParent(HierarchyNode *node) = 0; 
     153        /** Returns #frames this node is assumed to be visible. 
     154        */ 
     155        virtual int GetNodeAssumedVisible(HierarchyNode *node) = 0; 
     156        /** Sets #frames this node is assumed to be visible. 
     157        */ 
     158        virtual void SetNodeAssumedVisible(HierarchyNode *node, int assumedVisible) = 0; 
     159        /** Decreases #frames this node is assumed to be visible. 
     160        */ 
     161        virtual void DecNodeAssumedVisible(HierarchyNode *node) = 0; 
    166162 
    167163protected: 
    168164 
    169  
    170         /// chc optimization for testing geometry of leaves instead of bounding box 
    171         bool mTestGeometryForVisibleLeaves; 
    172165        /// the current frame number 
    173166        unsigned int mFrameId; 
     167         
    174168        /// index of the lcurrent occlusion query in the array of queries 
    175169        /// NOTE: should rather be iterator 
     
    186180         
    187181        /// buffer for a node pointer 
    188         HierarchyNode *mSavedNode; 
     182        HierarchyNode *mOldNode; 
    189183 
    190184        /// list of rendered hierarchy nodes (e.g., useful for exact visibility queries) 
    191185        std::vector<HierarchyNode *> mVisibleNodes; 
    192186}; 
     187 
    193188} // namespace GtpVisibility 
    194189 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/include/RandomUpdateCullingManager.h

    r2259 r2455  
    1414{ 
    1515public: 
     16         
    1617        RandomUpdateCullingManager(); 
    17         /** Constructor taking the assumed visibility into account, i.e., the estimation 
    18                 for how many frames the current visibility is considered to be valid 
     18 
     19        /** Constructor taking the #random candidates tested per subtree into account. 
    1920        */ 
    20         RandomUpdateCullingManager(const unsigned int assumedVisibility); 
     21        RandomUpdateCullingManager(const unsigned int randomCandidates); 
    2122 
    2223        void RenderScene(); 
    23         /** Sets assumed visibility (i.e., an estimation for  
    24                 how many frames the visibility is considered to be valid). 
    25                 @param assumedVisibility indicates for how many frames the  
    26                 same visibility is be assumed. 
    27                 if 0, the visibility is tested deterministically for each frame. 
     24 
     25        /** Sets #random candidates tested per subtree. 
    2826        */ 
    29         void SetAssumedVisibility(const unsigned int assumedVisibility); 
     27        void SetRandomCandidates(const unsigned int randomCandidates); 
     28 
     29        /** This is an optimization when issuing the occlusion test.  
     30                The test is done with actual geometry rather than the bounding  
     31                box of leave nodes previously marked as visible. 
     32 
     33                @param testGeometry if this optimization should be used 
     34                @remark this option is only useful for the coherent hierarchical culling algorithm 
     35        */ 
     36        void SetTestGeometryForVisibleLeaves(const bool testGeometry); 
     37        /** See TestGeometryForVisibleLeaves 
     38        */ 
     39        bool GetTestGeometryForVisibleLeaves(); 
    3040 
    3141protected: 
    32  
    33         /** Decides if node is considered to be visible depeding on the  
    34                 assumed visibility factor. 
    35                 @returns if node is considered to be visible 
    36         */ 
    37         bool DecideVisible(HierarchyNode *node) const; 
    3842 
    3943        /** Skip query for this node. 
     
    4145        void SkipQuery(HierarchyNode *node) const; 
    4246 
    43         /** number of steps the visibility is assumed to be valid. 
    44         */ 
    45         unsigned int mAssumedVisibility; 
    4647 
    47         /** Threshold for rand function to return positive result  
    48                 with respect to mAssumedVisibility. 
    49         */ 
    50         int mThreshold; 
     48        //////////// 
    5149 
    52         int mRandomCandidates; 
     50        /// number of candidates that are tested per subtree 
     51        unsigned int mRandomCandidates; 
     52 
     53        bool mTestGeometryForVisibleLeaves; 
     54 
    5355}; 
    5456 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/include/VisibilityManager.h

    r2280 r2455  
    5858        */ 
    5959        void SetAssumedVisibilityForChc(unsigned int assumedVisibility); 
    60          
     60        /** Random candidates per subtree for random update manager. 
     61                @note these options should rather be given by general parameter system using void * 
     62                and strings. 
     63        */ 
     64        void SetRandomUpdateCandidatesForRuc(unsigned int randomCandidatesForRuc); 
     65        /** See get 
     66        */ 
     67        unsigned int GetAssumedVisibilityForChc(); 
     68        /* See get 
     69        */ 
     70        unsigned int GetRandomUpdateCandidatesForRuc(); 
    6171        /** Sets pointer to a query manager.  
    6272        */ 
     
    6676        QueryManager *GetQueryManager(); 
    6777 
     78        void SetTestGeometryForVisibleLeaves(bool testGeometryForLeaves); 
     79        bool GetTestGeometryForVisibleLeaves(); 
     80 
     81        /** Returns the visibility environment. 
     82        */ 
    6883        VisibilityEnvironment *GetVisibilityEnvironment(); 
    6984 
     
    7388        CullingManager *mCullingManager; 
    7489        QueryManager *mQueryManager; 
     90 
    7591        PreprocessingManager *mPreprocessingManager; 
    7692        VisibilityEnvironment *mVisibilityEnvironment; 
     
    7995        unsigned int mVisibilityThreshold; 
    8096        unsigned int mAssumedVisibilityForChc; 
     97        unsigned int mRandomCandidatesForRuc; 
     98 
     99        bool mTestGeometryForVisibleLeaves; 
    81100}; 
     101 
    82102} // namespace GtpVisibility 
    83103 
Note: See TracChangeset for help on using the changeset viewer.