Changeset 1676 for GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp
- Timestamp:
- 10/24/06 17:42:03 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp
r1673 r1676 256 256 257 257 // calculate cost in MB 258 const float memoryCost = mHierarchyStats.mMemory / (1024.0f * 1024.0f)258 const float memoryCost = mHierarchyStats.mMemory / float(1024 * 1024) 259 259 + objectSpaceMem + viewSpaceMem; 260 260 … … 383 383 // number of initial splits 384 384 const int minSteps = mMinStepsOfSameType; 385 const int maxSteps = mMinStepsOfSameType + 500; 385 386 float renderCostDecr = Limits::Infinity; 386 387 387 SubdivisionCandidate *osc = 388 PrepareObjectSpaceSubdivision(sampleRays, objects); 388 SubdivisionCandidate *osc = PrepareObjectSpaceSubdivision(sampleRays, objects); 389 389 390 390 objectSpaceQueue.Push(osc); … … 399 399 // for first round, use sah splits. Once view space partition 400 400 // has started, use render cost heuristics instead 401 const int ospSteps = RunConstruction(objectSpaceQueue, dirtyVspList, NULL, minSteps); 401 const int ospSteps = 402 RunConstruction(objectSpaceQueue, dirtyVspList, NULL, minSteps, maxSteps); 402 403 403 404 cout << "\n" << ospSteps << " object space partition steps taken" << endl; … … 440 441 // for first round, use sah splits. Once view space partition 441 442 // has started, use render cost heuristics instead 442 const int ospSteps = 443 RunConstruction(objectSpaceQueue, dirtyVspList, viewSpaceQueue.Top(), minSteps); 443 const int ospSteps = RunConstruction(objectSpaceQueue, 444 dirtyVspList, 445 viewSpaceQueue.Top(), 446 minSteps, 447 maxSteps); 444 448 445 449 cout << "\n" << ospSteps << " object space partition steps taken" << endl; … … 461 465 // process view space candidates 462 466 const int vspSteps = 463 RunConstruction(viewSpaceQueue, dirtyOspList, objectSpaceQueue.Top(), minSteps );467 RunConstruction(viewSpaceQueue, dirtyOspList, objectSpaceQueue.Top(), minSteps, maxSteps); 464 468 465 469 cout << "\n" << vspSteps << " view space partition steps taken" << endl; … … 700 704 701 705 // memory size in byte 702 mHierarchyStats.mMemory += (float)ObjectPvs::GetEntrySizeByte() ;706 mHierarchyStats.mMemory += (float)ObjectPvs::GetEntrySizeByte() * pvsEntriesIncr; 703 707 mHierarchyStats.mRenderCostDecrease = sc->GetRenderCostDecrease(); 704 708 … … 841 845 842 846 cout << "\nstarting object space subdivision after " 843 << mVspTree->mVspStats.nodes << " (" 844 << mMinStepsOfSameType << ") " << endl; 847 << mVspTree->mVspStats.nodes << " (" << mMinStepsOfSameType << ") " << endl; 845 848 846 849 SubdivisionCandidate *ospSc = PrepareObjectSpaceSubdivision(sampleRays, objects); … … 895 898 SubdivisionCandidateContainer &dirtyCandidates, 896 899 SubdivisionCandidate *oldCandidate, 897 const int minSteps) 898 { 900 const int minSteps, 901 const int maxSteps) 902 { 903 if (minSteps >= maxSteps) 904 cout << "error!! " << minSteps << " equal or larger maxSteps" << endl; 905 899 906 int steps = 0; 900 907 SubdivisionCandidate::NewMail(); … … 908 915 909 916 // minimum slope reached 910 if ((sc->GetPriority() < threshold) && !(steps < minSteps)) 911 { 912 cout << "**************** breaking on " << sc->GetPriority() << " smaller than " << threshold << endl; 917 if ((steps > maxSteps) || 918 ((sc->GetPriority() < threshold) && !(steps < minSteps))) 919 { 920 cout << "\n**************** breaking on " << sc->GetPriority() << " smaller than " << threshold << endl; 913 921 break; 914 922 }
Note: See TracChangeset
for help on using the changeset viewer.