Changeset 2455 for GTP/trunk/Lib/Vis/OnlineCullingCHC/include
- Timestamp:
- 06/14/07 17:24:08 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/OnlineCullingCHC/include
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/OnlineCullingCHC/include/CoherentHierarchicalCullingManager.h
r2332 r2455 21 21 22 22 void RenderScene(); 23 23 24 /** Sets assumed visibility (i.e., an estimation for 24 25 how many frames the visibility is considered to be valid). … … 27 28 if 0, the visibility is tested deterministically for each frame. 28 29 */ 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 30 43 31 44 protected: … … 47 60 bool NodeInvalid(HierarchyNode *node) const; 48 61 62 void AssignAssumedVisibility(GtpVisibility::HierarchyNode *node); 63 64 65 ////////////////////// 66 49 67 /** number of steps the visibility is assumed to be valid. 50 68 */ 51 69 unsigned int mAssumedVisibility; 52 70 53 /** Threshold for rand function to return positive result with respect to 54 mAssumedVisibility. 55 */ 56 int mThreshold; 71 bool mTestGeometryForVisibleLeaves; 57 72 }; 58 73 -
GTP/trunk/Lib/Vis/OnlineCullingCHC/include/CoherentHierarchicalCullingManager2.h
r2360 r2455 9 9 { 10 10 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 12 13 */ 13 class CoherentHierarchicalCullingManager2 14 class CoherentHierarchicalCullingManager2: public CullingManager 14 15 { 15 16 public: 16 17 CoherentHierarchicalCullingManager2(); 18 17 19 /** Constructor taking the assumed visibility into account, i.e., the estimation 18 20 for how many frames the current visibility is considered to be valid … … 20 22 CoherentHierarchicalCullingManager2(const unsigned int assumedVisibility); 21 23 24 /** The main render routine. 25 */ 22 26 void RenderScene(); 27 23 28 /** Sets assumed visibility (i.e., an estimation for 24 29 how many frames the visibility is considered to be valid). … … 30 35 31 36 protected: 37 32 38 /** Decides if node is considered to be visible depeding on the 33 39 assumed visibility factor. … … 35 41 */ 36 42 bool DecideVisible(HierarchyNode *node) const; 37 38 43 39 44 /** Skip query for this node. -
GTP/trunk/Lib/Vis/OnlineCullingCHC/include/HierarchyInterface.h
r2332 r2455 2 2 #define _GtpVisibilityHierarchyInterface_H__ 3 3 4 4 5 #include "DistanceQueue.h" 5 //#include "VisibilityMesh.h"6 6 #include <stack> 7 7 8 8 9 namespace GtpVisibility { … … 52 53 /** Issue a occlusion query for this node. 53 54 @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). 56 56 @returns occlusion query for this node 57 57 */ 58 58 virtual OcclusionQuery *IssueNodeOcclusionQuery(HierarchyNode *node, 59 const bool wasVisible= false) = 0;59 const bool testGeometry = false) = 0; 60 60 /** Returns distance of the node to the view plane. 61 61 @param node the hierarchy node … … 119 119 */ 120 120 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 bounding124 box of leave nodes previously marked as visible.125 126 @param testGeometry if this optimization should be used127 @remark this option is only useful for the coherent hierarchical culling algorithm128 */129 void TestGeometryForVisibleLeaves(bool testGeometry);130 131 121 /** Sets the scene root and initialises this hierarchy interface for a traversal. 132 122 @remark also resets the statistics evaluated in the last traversal … … 142 132 */ 143 133 DistanceQueue *GetQueue(); 144 145 134 /** Checks if the node is visible from the current view frustum. 146 135 @param node the current node 147 136 */ 148 137 bool CheckFrustumVisible(HierarchyNode *node); 149 150 138 /** Returns number of traversed nodes. 151 139 */ … … 154 142 */ 155 143 unsigned int GetNumRenderedNodes(); 156 157 144 /** Returns vector of visible hierarchy nodes from previous render. 158 145 */ 159 146 std::vector<HierarchyNode *> *GetVisibleNodes(); 160 147 /** Pulls up the last visited information of this node. 148 */ 161 149 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 */ 165 152 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; 166 162 167 163 protected: 168 164 169 170 /// chc optimization for testing geometry of leaves instead of bounding box171 bool mTestGeometryForVisibleLeaves;172 165 /// the current frame number 173 166 unsigned int mFrameId; 167 174 168 /// index of the lcurrent occlusion query in the array of queries 175 169 /// NOTE: should rather be iterator … … 186 180 187 181 /// buffer for a node pointer 188 HierarchyNode *m SavedNode;182 HierarchyNode *mOldNode; 189 183 190 184 /// list of rendered hierarchy nodes (e.g., useful for exact visibility queries) 191 185 std::vector<HierarchyNode *> mVisibleNodes; 192 186 }; 187 193 188 } // namespace GtpVisibility 194 189 -
GTP/trunk/Lib/Vis/OnlineCullingCHC/include/RandomUpdateCullingManager.h
r2259 r2455 14 14 { 15 15 public: 16 16 17 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 valid18 19 /** Constructor taking the #random candidates tested per subtree into account. 19 20 */ 20 RandomUpdateCullingManager(const unsigned int assumedVisibility);21 RandomUpdateCullingManager(const unsigned int randomCandidates); 21 22 22 23 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. 28 26 */ 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(); 30 40 31 41 protected: 32 33 /** Decides if node is considered to be visible depeding on the34 assumed visibility factor.35 @returns if node is considered to be visible36 */37 bool DecideVisible(HierarchyNode *node) const;38 42 39 43 /** Skip query for this node. … … 41 45 void SkipQuery(HierarchyNode *node) const; 42 46 43 /** number of steps the visibility is assumed to be valid.44 */45 unsigned int mAssumedVisibility;46 47 47 /** Threshold for rand function to return positive result 48 with respect to mAssumedVisibility. 49 */ 50 int mThreshold; 48 //////////// 51 49 52 int mRandomCandidates; 50 /// number of candidates that are tested per subtree 51 unsigned int mRandomCandidates; 52 53 bool mTestGeometryForVisibleLeaves; 54 53 55 }; 54 56 -
GTP/trunk/Lib/Vis/OnlineCullingCHC/include/VisibilityManager.h
r2280 r2455 58 58 */ 59 59 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(); 61 71 /** Sets pointer to a query manager. 62 72 */ … … 66 76 QueryManager *GetQueryManager(); 67 77 78 void SetTestGeometryForVisibleLeaves(bool testGeometryForLeaves); 79 bool GetTestGeometryForVisibleLeaves(); 80 81 /** Returns the visibility environment. 82 */ 68 83 VisibilityEnvironment *GetVisibilityEnvironment(); 69 84 … … 73 88 CullingManager *mCullingManager; 74 89 QueryManager *mQueryManager; 90 75 91 PreprocessingManager *mPreprocessingManager; 76 92 VisibilityEnvironment *mVisibilityEnvironment; … … 79 95 unsigned int mVisibilityThreshold; 80 96 unsigned int mAssumedVisibilityForChc; 97 unsigned int mRandomCandidatesForRuc; 98 99 bool mTestGeometryForVisibleLeaves; 81 100 }; 101 82 102 } // namespace GtpVisibility 83 103
Note: See TracChangeset
for help on using the changeset viewer.