Changeset 1667 for GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.cpp
- Timestamp:
- 10/23/06 20:24:14 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.cpp
r1666 r1667 786 786 787 787 788 void VspTree::EvalSubdivisionCandidate(VspSubdivisionCandidate &splitCandidate) 789 { 790 float frontProb; 791 float backProb; 788 void VspTree::EvalSubdivisionCandidate(VspSubdivisionCandidate &splitCandidate, bool computeSplitPlane) 789 { 790 if (computeSplitPlane) 791 { 792 float frontProb; 793 float backProb; 794 795 // compute locally best split plane 796 const float ratio = SelectSplitPlane(splitCandidate.mParentData, 797 splitCandidate.mSplitPlane, 798 frontProb, 799 backProb); 800 801 const bool maxCostRatioViolated = mTermMaxCostRatio < ratio; 802 803 const int maxCostMisses = splitCandidate.mParentData.mMaxCostMisses; 804 // max cost threshold violated? 805 splitCandidate.SetMaxCostMisses(maxCostRatioViolated ? maxCostMisses + 1: maxCostMisses); 806 } 792 807 793 808 VspLeaf *leaf = dynamic_cast<VspLeaf *>(splitCandidate.mParentData.mNode); 794 809 795 // compute locally best split plane796 const float ratio = SelectSplitPlane(splitCandidate.mParentData,797 splitCandidate.mSplitPlane,798 frontProb,799 backProb);800 801 const bool maxCostRatioViolated = mTermMaxCostRatio < ratio;802 803 // max cost threshold violated?804 splitCandidate.SetMaxCostMisses(maxCostRatioViolated ?805 splitCandidate.mParentData.mMaxCostMisses + 1:806 splitCandidate.mParentData.mMaxCostMisses);807 808 810 // compute global decrease in render cost 809 811 float oldRenderCost; … … 821 823 // otherwise danger of being stuck in a local minimum!! 822 824 const float factor = mRenderCostDecreaseWeight; 823 824 825 float priority = factor * renderCostDecr + (1.0f - factor) * oldRenderCost; 825 826 826 if (mHierarchyManager->mConsiderMemory) 827 { 828 //cout << "here4 rc: " << factor * renderCostDecr << " pvs: " << (1.0f - factor) * splitCandidate.GetPvsEntriesIncr() << endl; 829 //const float priority = factor * renderCostDecr - (1.0f - factor) * splitCandidate.GetPvsEntriesIncr(); 827 if (1)//0 && mHierarchyManager->mConsiderMemory) 828 { 830 829 priority /= ((float)splitCandidate.GetPvsEntriesIncr() + mHierarchyManager->mMemoryConst); 831 830 } … … 835 834 836 835 837 float VspTree::EvalPriority(const VspSubdivisionCandidate &splitCandidate) const836 /*float VspTree::EvalPriority(const VspSubdivisionCandidate &splitCandidate) const 838 837 { 839 838 // compute global decrease in render cost … … 857 856 858 857 return priority; 859 } 858 }*/ 860 859 861 860
Note: See TracChangeset
for help on using the changeset viewer.