Changeset 142
- Timestamp:
- 06/21/05 12:00:22 (20 years ago)
- Location:
- trunk/VUT/GtpVisibility
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibility/include/CoherentHierarchicalCullingManager.h
r130 r142 14 14 { 15 15 public: 16 CoherentHierarchicalCullingManager(); 16 17 void RenderScene(); 18 /** Sets assumed visibility which is a decition variable 19 wether an occlusion query should be issued or not. 20 @param assumedVisibility indicates that same visibility should be assumed 21 for approximately assumedVisibility frames. 22 if 0, no assumedVisibility will be tested. 23 */ 24 void SetAssumedVisibility(int assumedVisibility); 25 protected: 26 /** Decides wether occlusion query should be issued depending on some 27 assumed visibility factor. 28 @returns if occlusion query should be issued 29 */ 30 bool DecideQueryTest(HierarchyNode *node) const; 31 int mAssumedVisibility; 17 32 }; 18 33 -
trunk/VUT/GtpVisibility/src/CoherentHierarchicalCullingManager.cpp
r139 r142 4 4 namespace GtpVisibility { 5 5 6 //----------------------------------------------------------------------- 7 CoherentHierarchicalCullingManager:: CoherentHierarchicalCullingManager(): 8 mAssumedVisibility(0) 9 { 10 // initialise random generator because of assumed visibility 11 srand(time(NULL)); 12 } 6 13 //----------------------------------------------------------------------- 7 14 void CoherentHierarchicalCullingManager::RenderScene() … … 28 35 } 29 36 else 30 { //if (mHierarchyInterface->mIsShadowPass)37 { 31 38 mNumQueryCulledNodes ++; 32 39 … … 75 82 // identify nodes that we cannot skip queries for 76 83 // geometry not only in leaves => test for renderable geometry 77 bool issueQuery = !wasVisible || mHierarchyInterface->HasGeometry(node); 84 bool issueQuery = !wasVisible || 85 (mHierarchyInterface->HasGeometry(node) && 86 (!mAssumedVisibility || DecideQueryTest(node))); 78 87 79 88 // reset node's visibility classification … … 87 96 { 88 97 mNumQueriesIssued ++; 89 98 90 99 queryQueue.push(QueryPair(node, mHierarchyInterface-> 91 100 IssueOcclusionQuery(node, wasVisible))); … … 101 110 } 102 111 } 103 112 //----------------------------------------------------------------------- 113 void CoherentHierarchicalCullingManager::SetAssumedVisibility(int assumedVisibility) 114 { 115 mAssumedVisibility = assumedVisibility; 116 } 117 //----------------------------------------------------------------------- 118 bool CoherentHierarchicalCullingManager::DecideQueryTest(HierarchyNode *node) const 119 { 120 bool result = false; 121 rand(); 122 return result; 123 } 104 124 } // namespace GtpVisibility
Note: See TracChangeset
for help on using the changeset viewer.