Changeset 2210 for GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.cpp
- Timestamp:
- 03/08/07 13:23:13 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.cpp
r2206 r2210 881 881 splitCandidate.GetAvgRayContribution()); 882 882 883 splitCandidate.mFrontPvs = fPvsSize; 884 splitCandidate.mBackPvs = bPvsSize; 885 883 886 if (0) 884 887 cout << "vsp pvs" … … 902 905 903 906 const VspTraversalData &tData = sc.mParentData; 904 const AxisAlignedPlane splitPlane = sc.mSplitPlane;907 const AxisAlignedPlane &splitPlane = sc.mSplitPlane; 905 908 906 909 /////////////// … … 917 920 918 921 //-- compute pvs 919 frontData.mPvs = (float)EvalPvsEntriesSize(*frontData.mRays);920 backData.mPvs = (float)EvalPvsEntriesSize(*backData.mRays);922 frontData.mPvs = sc.mFrontPvs;//(float)EvalPvsEntriesSize(*frontData.mRays); 923 backData.mPvs = sc.mBackPvs;//(float)EvalPvsEntriesSize(*backData.mRays); 921 924 922 925 //-- compute pvs correction for coping with undersampling … … 934 937 935 938 //-- compute render cost 936 frontData.mRenderCost = (float)EvalPvsCost(*frontData.mRays);937 backData.mRenderCost = (float)EvalPvsCost(*backData.mRays);939 frontData.mRenderCost = sc.mFrontRenderCost;//(float)EvalPvsCost(*frontData.mRays); 940 backData.mRenderCost = sc.mBackRenderCost;//(float)EvalPvsCost(*backData.mRays); 938 941 939 942 frontData.mCorrectedRenderCost = sc.mCorrectedFrontRenderCost; … … 1275 1278 const float maxBand = minBox + mMaxBand * sizeBox; 1276 1279 1280 // sort by the current dimension 1277 1281 SortSubdivisionCandidates(usedRays, axis, minBand, maxBand); 1278 1282 … … 1589 1593 sc.mCorrectedBackRenderCost = mHierarchyManager->EvalCorrectedPvs(pvsBack, penaltyOld, avgRayContri); 1590 1594 1595 sc.mFrontRenderCost = pvsFront; 1596 sc.mBackRenderCost = pvsBack; 1597 1591 1598 const float oldRenderCost = pOverall * penaltyOld; 1592 1599 const float newRenderCost = sc.mCorrectedFrontRenderCost * pFront + … … 1727 1734 1728 1735 const float renderCost = countEntries ? 1 : 1729 m HierarchyManager->mBvHierarchy->EvalAbsCost(leaf->mObjects);1736 mBvHierarchy->EvalAbsCost(leaf->mObjects); 1730 1737 1731 1738 // leaf in no pvs => new … … 2286 2293 case HierarchyManager::BV_BASED_OBJ_SUBDIV: 2287 2294 { 2288 BvhLeaf *bvhleaf = m HierarchyManager->mBvHierarchy->GetLeaf(obj);2295 BvhLeaf *bvhleaf = mBvHierarchy->GetLeaf(obj); 2289 2296 2290 2297 if (!bvhleaf->Mailed()) … … 2901 2908 VspSubdivisionCandidate::sVspTree = this; 2902 2909 2910 mBvHierarchy = mHierarchyManager->mBvHierarchy; 2911 2903 2912 // initialise termination criteria 2904 2913 mTermMinProbability *= mBoundingBox.GetVolume(); … … 2969 2978 case HierarchyManager::BV_BASED_OBJ_SUBDIV: 2970 2979 { 2971 BvhLeaf *leaf = m HierarchyManager->mBvHierarchy->GetLeaf(obj);2980 BvhLeaf *leaf = mBvHierarchy->GetLeaf(obj); 2972 2981 2973 2982 if (!leaf->Mailed()) … … 3049 3058 case HierarchyManager::BV_BASED_OBJ_SUBDIV: 3050 3059 { 3051 BvhLeaf *leaf = m HierarchyManager->mBvHierarchy->GetLeaf(obj);3060 BvhLeaf *leaf = mBvHierarchy->GetLeaf(obj); 3052 3061 3053 3062 if (-- leaf->mCounter == 0) … … 3098 3107 case HierarchyManager::BV_BASED_OBJ_SUBDIV: 3099 3108 { 3100 BvhLeaf *leaf = m HierarchyManager->mBvHierarchy->GetLeaf(obj);3109 BvhLeaf *leaf = mBvHierarchy->GetLeaf(obj); 3101 3110 3102 3111 if (!leaf->Mailed()) … … 3151 3160 case HierarchyManager::BV_BASED_OBJ_SUBDIV: 3152 3161 { 3153 BvhLeaf *leaf = m HierarchyManager->mBvHierarchy->GetLeaf(obj);3162 BvhLeaf *leaf = mBvHierarchy->GetLeaf(obj); 3154 3163 if (!leaf->Mailed()) 3155 3164 { … … 3198 3207 case HierarchyManager::BV_BASED_OBJ_SUBDIV: 3199 3208 { 3200 BvhLeaf *leaf = m HierarchyManager->mBvHierarchy->GetLeaf(obj);3209 BvhLeaf *leaf = mBvHierarchy->GetLeaf(obj); 3201 3210 UpdateContributionsToPvs(leaf, cf, frontPvs, backPvs, totalPvs, false); 3202 3211 break; … … 3227 3236 case HierarchyManager::BV_BASED_OBJ_SUBDIV: 3228 3237 { 3229 BvhLeaf *leaf = m HierarchyManager->mBvHierarchy->GetLeaf(obj);3238 BvhLeaf *leaf = mBvHierarchy->GetLeaf(obj); 3230 3239 UpdateContributionsToPvs(leaf, cf, pvsFront, pvsBack, totalPvs, true); 3231 3240 break; … … 3269 3278 case HierarchyManager::BV_BASED_OBJ_SUBDIV: 3270 3279 { 3271 BvhLeaf *bvhleaf = m HierarchyManager->mBvHierarchy->GetLeaf(obj);3280 BvhLeaf *bvhleaf = mBvHierarchy->GetLeaf(obj); 3272 3281 3273 3282 if (!bvhleaf->Mailed())
Note: See TracChangeset
for help on using the changeset viewer.