Changeset 1676 for GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp
- Timestamp:
- 10/24/06 17:42:03 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp
r1673 r1676 251 251 Environment::GetSingleton()->GetBoolValue("BvHierarchy.useCostHeuristics", mUseCostHeuristics); 252 252 Environment::GetSingleton()->GetBoolValue("BvHierarchy.useSah", mUseSah); 253 254 253 254 char subdivisionStatsLog[100]; 255 255 Environment::GetSingleton()->GetStringValue("BvHierarchy.subdivisionStats", subdivisionStatsLog); 256 256 mSubdivisionStats.open(subdivisionStatsLog); … … 260 260 261 261 Environment::GetSingleton()->GetBoolValue("BvHierarchy.Construction.useGlobalSorting", mUseGlobalSorting); 262 Environment::GetSingleton()->GetIntValue("BvHierarchy.minRaysForVisibility", mMinRaysForVisibility); 263 262 264 263 265 mUseBboxAreaForSah = true; … … 283 285 Debug << "render cost decrease weight: " << mRenderCostDecreaseWeight << endl; 284 286 Debug << "use global sort: " << mUseGlobalSorting << endl; 287 Debug << "minimal rays for visibility: " << mMinRaysForVisibility << endl; 288 285 289 Debug << endl; 286 290 } … … 487 491 if (computeSplitPlane) 488 492 { 493 const bool sufficientSamples = splitCandidate.mParentData.mNumRays < mMinRaysForVisibility; 494 495 const bool useVisibiliyBasedHeuristics = 496 !mUseSah && 497 !(mHierarchyManager->GetViewSpaceSubdivisionType() == HierarchyManager::KD_BASED_VIEWSPACE_SUBDIV) && 498 sufficientSamples; 499 489 500 // compute best object partition 490 501 const float ratio = SelectObjectPartition(splitCandidate.mParentData, 491 502 splitCandidate.mFrontObjects, 492 splitCandidate.mBackObjects); 503 splitCandidate.mBackObjects, 504 useVisibiliyBasedHeuristics); 493 505 494 506 // cost ratio violated? … … 497 509 const int previousMisses = splitCandidate.mParentData.mMaxCostMisses; 498 510 499 splitCandidate.SetMaxCostMisses(maxCostRatioViolated ? 500 previousMisses + 1 : previousMisses); 511 splitCandidate.SetMaxCostMisses(maxCostRatioViolated ? previousMisses + 1 : previousMisses); 501 512 502 513 } … … 1218 1229 float BvHierarchy::SelectObjectPartition(const BvhTraversalData &tData, 1219 1230 ObjectContainer &frontObjects, 1220 ObjectContainer &backObjects) 1231 ObjectContainer &backObjects, 1232 bool useVisibilityBasedHeuristics) 1221 1233 { 1222 1234 ObjectContainer nFrontObjects[3]; … … 1245 1257 //-- split objects using heuristics 1246 1258 1247 if (!mUseSah && 1248 (mHierarchyManager->GetViewSpaceSubdivisionType() == 1249 HierarchyManager::KD_BASED_VIEWSPACE_SUBDIV)) 1259 if (useVisibilityBasedHeuristics) 1250 1260 { 1251 1261 ///////////
Note: See TracChangeset
for help on using the changeset viewer.