Changeset 345 for trunk/VUT/GtpVisibility/src
- Timestamp:
- 10/21/05 19:53:30 (19 years ago)
- Location:
- trunk/VUT/GtpVisibility/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibility/src/CoherentHierarchicalCullingManager.cpp
r343 r345 25 25 unsigned int visiblePixels = 0; 26 26 bool isAvailable = false; 27 //Ogre::LogManager::getSingleton().logMessage("Coherent Hierarchical Culling");27 Ogre::LogManager::getSingleton().logMessage("Coherent Hierarchical Culling\n"); 28 28 29 29 //-- PART 1: process finished occlusion queries … … 37 37 38 38 queryQueue.pop(); 39 40 std::stringstream d2; d2 << "fetch node from query queue " << node; 41 Ogre::LogManager::getSingleton().logMessage(d2.str()); 39 42 40 43 if (visiblePixels > mVisibilityThreshold) … … 60 63 mHierarchyInterface->GetQueue()->pop(); 61 64 65 std::stringstream d2; d2 << "fetch node from hierarchy queue " << node; 66 Ogre::LogManager::getSingleton().logMessage(d2.str()); 67 62 68 bool intersects = false; 63 69 … … 81 87 bool wasVisible = mHierarchyInterface->IsNodeVisible(node) && 82 88 (mHierarchyInterface->LastVisited(node) == mHierarchyInterface->GetFrameId() - 1); 83 89 if (mHierarchyInterface->LastVisited(node) == mHierarchyInterface->GetFrameId()) 90 { 91 std::stringstream d2; d2 << "!!!!lastVisited: " << mHierarchyInterface->LastVisited(node) << " " << node; 92 Ogre::LogManager::getSingleton().logMessage(d2.str()); 93 std::stringstream d; d << "!!!!!frameid: " << mHierarchyInterface->GetFrameId() << " " << node << "\n"; 94 Ogre::LogManager::getSingleton().logMessage(d.str()); 95 } 84 96 // if we assume node to be visible in this frame => skip query 85 97 // TODO: check this (not the expected speed up) … … 93 105 // identify nodes that we cannot skip queries for 94 106 // geometry not only in leaves => test for renderable geometry 95 bool issueQuery = !wasVisible || mHierarchyInterface->HasGeometry(node); 96 107 bool issueQuery = (mHierarchyInterface->LastVisited(node) != mHierarchyInterface->GetFrameId()) 108 && (!wasVisible || mHierarchyInterface->HasGeometry(node)); 109 97 110 // reset node's visibility classification 98 111 mHierarchyInterface->SetNodeVisible(node, false); … … 100 113 // update node's visited flag 101 114 mHierarchyInterface->SetLastVisited(node, mHierarchyInterface->GetFrameId()); 102 115 116 std::stringstream d2; d2 << "lastVisited: " << mHierarchyInterface->LastVisited(node) << " " << node; 117 Ogre::LogManager::getSingleton().logMessage(d2.str()); 118 103 119 // skip testing previously visible nodes without geometry 104 120 if (issueQuery) … … 113 129 if (wasVisible) 114 130 { 131 std::stringstream d2; d2 << "traversing node " << node; 132 Ogre::LogManager::getSingleton().logMessage(d2.str()); 115 133 mHierarchyInterface->TraverseNode(node); 116 134 } … … 120 138 } 121 139 //----------------------------------------------------------------------- 122 void CoherentHierarchicalCullingManager::SetAssumedVisibility( unsigned int assumedVisibility)140 void CoherentHierarchicalCullingManager::SetAssumedVisibility(const unsigned int assumedVisibility) 123 141 { 124 142 mAssumedVisibility = assumedVisibility; … … 133 151 } 134 152 //----------------------------------------------------------------------- 135 bool CoherentHierarchicalCullingManager::DecideVisible(HierarchyNode *node) const153 inline bool CoherentHierarchicalCullingManager::DecideVisible(HierarchyNode *node) const 136 154 { 137 / *bool result = rand() < mThreshold; std::stringstream d; d << "Assumed vis: " << mAssumedVisibility << ", result: " << result;138 Ogre::LogManager::getSingleton().logMessage(d.str()); return result;*/155 //bool result = rand() < mThreshold; std::stringstream d; d << "Assumed vis: " << mAssumedVisibility << ", result: " << result; 156 //Ogre::LogManager::getSingleton().logMessage(d.str()); return result; 139 157 140 158 return rand() < mThreshold; 141 159 } 142 160 //----------------------------------------------------------------------- 143 void CoherentHierarchicalCullingManager::SkipQuery(HierarchyNode *node) 161 inline void CoherentHierarchicalCullingManager::SkipQuery(HierarchyNode *node) const 144 162 { 145 163 // -- set node to be visible in this frame, then traverse it 164 std::stringstream d2; d2 << "skipping node " << node; 165 Ogre::LogManager::getSingleton().logMessage(d2.str()); 146 166 mHierarchyInterface->SetLastVisited(node, mHierarchyInterface->GetFrameId()); 147 167 168 mHierarchyInterface->SetNodeVisible(node, true); 148 169 mHierarchyInterface->PullUpVisibility(node); 149 170 mHierarchyInterface->TraverseNode(node); -
trunk/VUT/GtpVisibility/src/StopAndWaitCullingManager.cpp
r259 r345 18 18 19 19 bool intersects = false; 20 20 21 //if (mHierarchyInterface->HasGeometry(node) && (!mHierarchyInterface->IsLeaf(node))) ++ mNumFrustumCulledNodes; 22 // Ogre::LogManager::getSingleton().logMessage("no geometry"); 23 //else if (!mHierarchyInterface->IsLeaf(node)) ++ mNumQueriesIssued;// Ogre::LogManager::getSingleton().logMessage("has geometry"); 24 /*if (!mHierarchyInterface->HasGeometry(node)) 25 Ogre::LogManager::getSingleton().logMessage("no geometry"); 26 else Ogre::LogManager::getSingleton().logMessage("has geometry");*/ 21 27 if (!mHierarchyInterface->CheckFrustumVisible(node, intersects)) 22 28 { … … 36 42 else 37 43 { 38 39 44 ++ mNumQueriesIssued; 40 45
Note: See TracChangeset
for help on using the changeset viewer.