Changeset 1664 for GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.cpp
- Timestamp:
- 10/23/06 01:36:17 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.cpp
r1663 r1664 28 28 29 29 #define USE_FIXEDPOINT_T 0 30 #define CONSIDER_MEMORY 131 30 32 31 ///////////// … … 819 818 splitCandidate.SetPvsEntriesIncr(pvsEntriesIncr); 820 819 821 #if 0822 const float priority = (float)-splitCandidate.mParentData.mDepth;823 #else824 820 // take render cost of node into account 825 821 // otherwise danger of being stuck in a local minimum!! 826 822 const float factor = mRenderCostDecreaseWeight; 827 823 828 #if CONSIDER_MEMORY 829 const float priority = factor * renderCostDecr - (1.0f - factor) * splitCandidate.GetPvsEntriesIncr(); 830 #else 831 const float priority = factor * renderCostDecr + (1.0f - factor) * oldRenderCost; 832 #endif 833 #endif 824 float priority; 825 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(); 830 priority = renderCostDecr / ((float)splitCandidate.GetPvsEntriesIncr() + + 1.0f); 831 } 832 else 833 { 834 priority = factor * renderCostDecr + (1.0f - factor) * oldRenderCost; 835 } 834 836 835 837 splitCandidate.SetPriority(priority); … … 845 847 oldRenderCost); 846 848 847 #if 0848 const float priority = (float)-splitCandidate.mParentData.mDepth;849 #else850 849 // take render cost of node into account 851 850 // otherwise danger of being stuck in a local minimum!! 852 851 const float factor = mRenderCostDecreaseWeight; 853 #if CONSIDER_MEMORY 854 const float priority = factor * renderCostDecr - (1.0f - factor) * splitCandidate.GetPvsEntriesIncr(); 855 #else 856 const float priority = factor * renderCostDecr + (1.0f - factor) * oldRenderCost; 857 #endif 858 859 #endif 860 852 853 float priority; 854 855 if (mHierarchyManager->mConsiderMemory) 856 { 857 //cout << "here2 rc: " << factor * renderCostDecr << " pvs: " << (1.0f - factor) * splitCandidate.GetPvsEntriesIncr() << endl; 858 //const float priority = factor * renderCostDecr - (1.0f - factor) * splitCandidate.GetPvsEntriesIncr(); 859 priority = renderCostDecr / ((float)splitCandidate.GetPvsEntriesIncr() + 1.0f); 860 } 861 else 862 { 863 priority = factor * renderCostDecr + (1.0f - factor) * oldRenderCost; 864 } 865 861 866 return priority; 862 867 } … … 917 922 918 923 //-- subdivide rays 919 SplitRays(splitPlane, 920 *tData.mRays, 921 *frontData.mRays, 922 *backData.mRays); 924 SplitRays(splitPlane, *tData.mRays, *frontData.mRays, *backData.mRays); 923 925 924 926 //-- compute pvs … … 946 948 // two more leaves per split 947 949 mVspStats.nodes += 2; 948 // /and a new split950 // and a new split 949 951 ++ mVspStats.splits[splitPlane.mAxis]; 950 952
Note: See TracChangeset
for help on using the changeset viewer.