- Timestamp:
- 10/22/07 16:42:43 (17 years ago)
- Location:
- GTP/trunk/Lib/Vis/OnlineCullingCHC
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionQueriesQueryManager.cpp
r2532 r2557 5 5 6 6 #include "OgreOcclusionQueriesQueryManager.h" 7 //#include "OgrePlatformHierarchyInterface.h"8 7 #include "OgreOcclusionCullingSceneManager.h" 9 8 #include "VisibilityEnvironment.h" -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/Plugin_VisibilitySceneManager.vcproj
r2532 r2557 525 525 </File> 526 526 <File 527 RelativePath="..\include\OgreVisibilityPredictor.h"> 528 </File> 529 <File 527 530 RelativePath="..\include\VisibilityMesh.h"> 528 531 </File> … … 563 566 <File 564 567 RelativePath="..\src\OgreVisibilityOptionsManager.cpp"> 568 </File> 569 <File 570 RelativePath=".\OgreVisibilityPredictor.cpp"> 565 571 </File> 566 572 <File -
GTP/trunk/Lib/Vis/OnlineCullingCHC/include/CoherentHierarchicalCullingPlusPlusManager.h
r2555 r2557 66 66 inline void IssueQuery(HierarchyNode *node, const bool testGeometry); 67 67 68 //void IssueOptimalBatches(QueryHeap &nodes); 69 68 70 69 71 ////////////////////// -
GTP/trunk/Lib/Vis/OnlineCullingCHC/src/CoherentHierarchicalCullingPlusPlusManager.cpp
r2556 r2557 52 52 ////////// 53 53 //-- only wait for result if there are no nodes to process 54 #if 055 bool resultAvailable = true;56 while (!mQueryQueue.empty() &&57 (NodeInvalid(mQueryQueue.front().first) ||58 mQueryQueue.front().second->GetQueryResult(59 visiblePixels, mHierarchyInterface->GetQueue()->empty())))60 #else61 54 bool resultAvailable = false; 62 55 … … 67 60 (resultAvailable = mQueryQueue.front().second->GetQueryResult(visiblePixels, false))) 68 61 ) 69 #endif70 62 { 71 63 HierarchyNode *node = mQueryQueue.front().first; … … 75 67 if (NodeInvalid(node)) {mQueryQueue.pop(); continue;} 76 68 77 // during the wait time issue nodes from visible queue69 // during the wait time we issue nodes from visible queue 78 70 while (1 && !mVisibleNodes.empty() && !resultAvailable) 79 71 { … … 114 106 if (mVisualizeCulledNodes) 115 107 mHierarchyInterface->VisualizeCulledNode(node, QUERY_CULLED); 116 108 } 117 109 118 110 // update node's visited flag … … 221 213 222 214 // issue rest of nodes from nodes from visible queue 223 if (0 && mHierarchyInterface->GetQueue()->empty() && mQueryQueue.empty() && !mVisibleNodes.empty()) 215 if (0 && 216 mHierarchyInterface->GetQueue()->empty() && mQueryQueue.empty() && !mVisibleNodes.empty()) 224 217 { 225 218 while (!mVisibleNodes.empty()) … … 230 223 } 231 224 } 232 233 234 if (0 && !mVisibleNodes.empty())235 {236 std::stringstream d;237 d << "queries: " << (int)mQueryQueue.size() << " vis: " << (int)mVisibleNodes.size() << " inv: " << (int)mInvisibleNodes.size();238 CullingLogManager::GetSingleton()->LogMessage(d.str());239 }240 225 241 // render rest226 // render what is left in the render queue 242 227 mHierarchyInterface->RenderQueue(); 243 228 … … 279 264 mHierarchyInterface->SetLastVisited(node, mHierarchyInterface->GetFrameId()); 280 265 } 281 282 if (0)283 {284 std::stringstream d;285 d << "tested: " << i << " nodes";286 CullingLogManager::GetSingleton()->LogMessage(d.str());287 }288 266 } 289 267 //----------------------------------------------------------------------- … … 357 335 nodes.clear(); 358 336 } 337 //----------------------------------------------------------------------- 338 #if 0 339 void CoherentHierarchicalCullingPlusPlusManager::IssueOptimalBatches(QueryHeap &nodes) 340 { 341 while (!nodes.Empty()) 342 { 343 QueryQueueEntry *entry = GetNextQueryQueueEntry(); 344 entry->mIsVisibleQuery = false; 345 346 float pFail = 1.0f; 347 float maxBatchVal = 0.0f; 348 float newPBatch = 1.0f; 349 float newBatchVal; 359 350 360 } 351 // issue next query 352 while (!nodes.Empty()) 353 { 354 HierarchyNode *node = nodes.Top(); 355 356 newPBatch *= mNodePredictor.GetProbability(node); 357 358 if (entry->mNodes.empty()) 359 newBatchVal = 1.0f; 360 else 361 { 362 const float newSize = float(entry->mNodes.size() + 1); 363 newBatchVal = newSize / (1.0f + (1.0f - newPBatch) * newSize); 364 } 365 366 if (newBatchVal <= maxBatchVal) 367 break; 368 369 pFail = entry->mNodes.empty() ? 0.0f : (1.0f - newPBatch); 370 371 nodes.Pop(); 372 entry->AddNode(node); 373 374 maxBatchVal = newBatchVal; 375 } 376 377 entry->mPFail = pFail; 378 379 IssueQuery(*entry, false); 380 mQueries.push(entry); 381 } 382 } 383 #endif 384 }
Note: See TracChangeset
for help on using the changeset viewer.