Changeset 146 for trunk/VUT/GtpVisibility
- Timestamp:
- 06/22/05 11:04:20 (20 years ago)
- Location:
- trunk/VUT/GtpVisibility
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibility/include/CoherentHierarchicalCullingManager.h
r142 r146 16 16 CoherentHierarchicalCullingManager(); 17 17 void RenderScene(); 18 /** Sets assumed visibility which is a decition variable19 wether an occlusion query should be issued or not.20 @param assumedVisibility indicates that same visibility should be assumed21 for approximately assumedVisibility frames.22 if 0, no assumedVisibility will be tested.18 /** Sets assumed visibility which is a an estimation for e 19 how many frames the visibility is considered to be valied 20 @param assumedVisibility indicates for how many frames the 21 same visibility is be assumed. 22 if 0, the visibility is tested deterministically for each frame. 23 23 */ 24 void SetAssumedVisibility(int assumedVisibility); 24 void SetAssumedVisibility(unsigned int assumedVisibility); 25 25 26 protected: 26 27 /** Decides wether occlusion query should be issued depending on some … … 29 30 */ 30 31 bool DecideQueryTest(HierarchyNode *node) const; 31 int mAssumedVisibility; 32 33 unsigned int mAssumedVisibility; 34 /** Threshold for rand function to return positive result with respect to 35 mAssumedVisibility. 36 */ 37 unsigned int mThreshold; 32 38 }; 33 39 -
trunk/VUT/GtpVisibility/include/VisibilityManager.h
r130 r146 55 55 */ 56 56 void SetUseChcOptimization(bool useOptimization); 57 /** Indicates for how long a frame is considered to be visible. 58 @param assumedVisibility estimation for how long visibility is assumed to be valid. 59 */ 60 void SetAssumedVisibility(unsigned int assumedVisibility); 57 61 /** Sets pointer to a query manager. 58 62 */ … … 71 75 72 76 unsigned int mVisibilityThreshold; 73 77 unsigned int mAssumedVisibility; 74 78 }; 75 79 } // namespace GtpVisibility -
trunk/VUT/GtpVisibility/src/CoherentHierarchicalCullingManager.cpp
r142 r146 6 6 //----------------------------------------------------------------------- 7 7 CoherentHierarchicalCullingManager:: CoherentHierarchicalCullingManager(): 8 mAssumedVisibility(0) 8 mAssumedVisibility(0), mThreshold(0) 9 9 { 10 10 // initialise random generator because of assumed visibility … … 111 111 } 112 112 //----------------------------------------------------------------------- 113 void CoherentHierarchicalCullingManager::SetAssumedVisibility( int assumedVisibility)113 void CoherentHierarchicalCullingManager::SetAssumedVisibility(unsigned int assumedVisibility) 114 114 { 115 115 mAssumedVisibility = assumedVisibility; 116 117 mThreshold = 0; 118 119 if (mAssumedVisibility) 120 { 121 mThreshold = RAND_MAX / mAssumedVisibility; 122 } 116 123 } 117 124 //----------------------------------------------------------------------- 118 125 bool CoherentHierarchicalCullingManager::DecideQueryTest(HierarchyNode *node) const 119 126 { 120 bool result = false; 121 rand(); 122 return result; 127 return rand() < mThreshold; 123 128 } 124 129 } // namespace GtpVisibility -
trunk/VUT/GtpVisibility/src/VisibilityManager.cpp
r130 r146 46 46 case VisibilityEnvironment::COHERENT_HIERARCHICAL_CULLING: 47 47 mCullingManager = new CoherentHierarchicalCullingManager(); 48 dynamic_cast<CoherentHierarchicalCullingManager *>(mCullingManager)-> 49 SetAssumedVisibility(mAssumedVisibility); 48 50 break; 49 51 … … 93 95 return mQueryManager; 94 96 } 97 void VisibilityManager::SetAssumedVisibility(unsigned int assumedVisibility) 98 { 99 mAssumedVisibility = assumedVisibility; 100 101 if (VisibilityManager::GetCullingManagerType() == 102 VisibilityEnvironment::COHERENT_HIERARCHICAL_CULLING) 103 { 104 dynamic_cast<CoherentHierarchicalCullingManager *>(mCullingManager)-> 105 SetAssumedVisibility(mAssumedVisibility); 106 } 107 } 95 108 } // namespace GtpVisibility
Note: See TracChangeset
for help on using the changeset viewer.