Changeset 1668 for GTP/trunk/Lib/Vis
- Timestamp:
- 10/23/06 20:32:01 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.cpp
r1667 r1668 821 821 822 822 // take render cost of node into account 823 // otherwise danger of being stuck in a local minimum! !823 // otherwise danger of being stuck in a local minimum! 824 824 const float factor = mRenderCostDecreaseWeight; 825 825 float priority = factor * renderCostDecr + (1.0f - factor) * oldRenderCost; … … 832 832 splitCandidate.SetPriority(priority); 833 833 } 834 835 836 /*float VspTree::EvalPriority(const VspSubdivisionCandidate &splitCandidate) const837 {838 // compute global decrease in render cost839 float oldRenderCost;840 const float renderCostDecr = EvalRenderCostDecrease(splitCandidate.mSplitPlane,841 splitCandidate.mParentData,842 oldRenderCost);843 844 // take render cost of node into account845 // otherwise danger of being stuck in a local minimum!!846 const float factor = mRenderCostDecreaseWeight;847 848 float priority = factor * renderCostDecr + (1.0f - factor) * oldRenderCost;849 850 if (mHierarchyManager->mConsiderMemory)851 {852 //cout << "here2 rc: " << factor * renderCostDecr << " pvs: " << (1.0f - factor) * splitCandidate.GetPvsEntriesIncr() << endl;853 //const float priority = factor * renderCostDecr - (1.0f - factor) * splitCandidate.GetPvsEntriesIncr();854 priority /= ((float)splitCandidate.GetPvsEntriesIncr() + mHierarchyManager->mMemoryConst);855 }856 857 return priority;858 }*/859 834 860 835 … … 865 840 float bPvsSize = 0; 866 841 867 AxisAlignedPlane candidatePlane = splitCandidate.mSplitPlane;842 const AxisAlignedPlane candidatePlane = splitCandidate.mSplitPlane; 868 843 869 844 Intersectable::NewMail(3); … … 881 856 float t; 882 857 // classify ray 883 const int cf = 884 rayInf.ComputeRayIntersection(candidatePlane.mAxis, 885 candidatePlane.mPosition, t); 858 const int cf = rayInf.ComputeRayIntersection(candidatePlane.mAxis, 859 candidatePlane.mPosition, t); 886 860 887 861 UpdatePvsEntriesContribution(*ray, true, cf, fPvsSize, bPvsSize, oldPvsSize); … … 890 864 #endif 891 865 } 892 //cout << "pvs entries: " << fPvsSize << " " << bPvsSize << " " << oldPvsSize << endl;893 866 894 867 return (int)(fPvsSize + bPvsSize - oldPvsSize); … … 933 906 934 907 if (tData.mDepth > mVspStats.maxDepth) 935 { //Debug << "max depth increases to " << tData.mDepth << " at " << mVspStats.Leaves() << " leaves" << endl;908 { 936 909 mVspStats.maxDepth = tData.mDepth; 937 910 } … … 996 969 return interior; 997 970 } 998 999 1000 971 1001 972
Note: See TracChangeset
for help on using the changeset viewer.