Changeset 1077 for GTP/trunk/Lib/Vis
- Timestamp:
- 07/05/06 16:21:45 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/scripts/TestPreprocessor.vcproj
r1076 r1077 86 86 LinkIncremental="1" 87 87 AdditionalLibraryDirectories="..\support\xercesc\lib\;..\support\zlib\lib\;..\support\devil\lib;"$(QTDIR)\lib";..\include;..\src\GL;"$(CG_LIB_PATH)";"$(GTPDIR)\NonGTP\Xerces";"$(GTPDIR)\NonGTP\Xerces\xercesc\lib";"$(GTPDIR)\NonGTP\zlib\lib";"$(GTPDIR)\NonGTP\Devil\lib";..\lib\release;..\..\Preprocessing\lib\release" 88 GenerateDebugInformation=" TRUE"88 GenerateDebugInformation="FALSE" 89 89 SubSystem="1" 90 90 OptimizeReferences="2" -
GTP/trunk/Lib/Vis/Preprocessing/src/Intersectable.h
r1074 r1077 28 28 KdPvs mKdPvs; 29 29 30 ViewCellPvs mViewCellPvs; 31 30 32 /// kd leaves that this intersectable belongs to 31 33 set<KdLeaf *> mKdLeaves; -
GTP/trunk/Lib/Vis/Preprocessing/src/Pvs.h
r1001 r1077 11 11 class Ray; 12 12 class Intersectable; 13 class ViewCellKdNode; 13 class ViewCell; 14 14 15 15 16 template<typename T> … … 415 416 }; 416 417 418 419 //-- typedefs 420 417 421 typedef std::map<KdNode *, PvsData<KdNode *>, LtSample<KdNode *> > KdPvsMap; 418 422 typedef std::map<Intersectable *, PvsData<Intersectable *>, LtSample<Intersectable *> > ObjectPvsMap; 423 typedef std::map<ViewCell *, PvsData<ViewCell *>, LtSample<ViewCell *> > ViewCellPvsMap; 424 419 425 typedef PvsData<Intersectable *> ObjectPvsData; 420 426 typedef PvsData<KdNode *> KdPvsData; 421 427 422 428 typedef Pvs<Intersectable *> ObjectPvs; 423 429 typedef Pvs<ViewCell *> ViewCellPvs; 424 430 } 425 431 -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r1074 r1077 386 386 { 387 387 int numSamples = 0; 388 388 389 SimpleRayContainer simpleRays; 389 390 390 VssRayContainer initialSamples; 391 391 … … 426 426 427 427 428 if ( 1) // export initial view cells428 if (0) // export initial view cells 429 429 { 430 430 const char filename[] = "view_cells.wrl"; … … 524 524 525 525 //-- post processing (e.g.,merging) of the view cells 526 PostProcess(preprocessor->mObjects, postProcessSamples);526 if (1) PostProcess(preprocessor->mObjects, postProcessSamples); 527 527 528 528 cout << "time needed for post processing (merge) step: " … … 3075 3075 const ObjectContainer &objects) 3076 3076 { 3077 #if STILL_HAS_TODO3077 #if TODO 3078 3078 cout << "exporting view cells to xml ... "; 3079 3079 std::ofstream stream; … … 3673 3673 cout << "construction finished" << endl; 3674 3674 3675 // real meshes are contructed at this stage3675 3676 3676 if (0) 3677 3677 { 3678 //-- real meshes are contructed at this stage 3678 3679 cout << "finalizing view cells ... "; 3679 3680 FinalizeViewCells(true); … … 3769 3770 } 3770 3771 3771 if ( 1) // export merged view cells using pvs coding3772 if (0) // export merged view cells using pvs coding 3772 3773 { 3773 3774 mColorCode = 1; … … 4158 4159 GetRaySets(sampleRays, mVisualizationSamples, visRays); 4159 4160 4160 //-- export view cells 4161 if (1) 4161 //-- export final view cell partition 4162 4163 if (0) 4162 4164 { 4163 4165 // hack pvs … … 5227 5229 GetRaySets(sampleRays, mVisualizationSamples, visRays); 5228 5230 5229 //-- export view cells 5231 //-- export final view cells 5232 5230 5233 if (1) 5231 5234 { -
GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.cpp
r1076 r1077 18 18 #include "Beam.h" 19 19 20 21 20 22 namespace GtpVisibilityPreprocessor { 23 21 24 22 25 #define USE_FIXEDPOINT_T 0 -
GTP/trunk/Lib/Vis/Preprocessing/src/VspOspTree.cpp
r1076 r1077 40 40 if (pvs < lower) 41 41 return (float)lower; 42 if (pvs > upper)42 else if (pvs > upper) 43 43 return (float)upper; 44 44 … … 778 778 ++ contributingSamples; 779 779 780 // warning: rays get never deleted!781 if ( 1) leaf->mVssRays.push_back(new VssRay(*ray));780 // store rays for visualization 781 if (0) leaf->mVssRays.push_back(new VssRay(*ray)); 782 782 } 783 783 } … … 992 992 993 993 994 float VspTree::EvalLocalCostHeuristics(const RayInfoContainer &rays,995 const AxisAlignedBox3 &box,996 int pvsSize,997 const int axis,998 float &position)999 {1000 const float minBox = box.Min(axis);1001 const float maxBox = box.Max(axis);1002 1003 const float sizeBox = maxBox - minBox;1004 1005 const float minBand = minBox + mMinBand * sizeBox;1006 const float maxBand = minBox + mMaxBand * sizeBox;1007 1008 SortSplitCandidates(rays, axis, minBand, maxBand);1009 1010 // go through the lists, count the number of objects left and right1011 // and evaluate the following cost funcion:1012 // C = ct_div_ci + (ql*rl + qr*rr)/queries1013 1014 int pvsl = 0;1015 int pvsr = pvsSize;1016 1017 int pvsBack = pvsl;1018 int pvsFront = pvsr;1019 1020 float sum = (float)pvsSize * sizeBox;1021 float minSum = 1e20f;1022 1023 1024 // if no good split can be found, take mid split1025 position = minBox + 0.5f * sizeBox;1026 1027 // the relative cost ratio1028 float ratio = 99999999.0f;1029 bool splitPlaneFound = false;1030 1031 Intersectable::NewMail();1032 1033 RayInfoContainer::const_iterator ri, ri_end = rays.end();1034 1035 //-- set all object as belonging to the front pvs1036 1037 for(ri = rays.begin(); ri != ri_end; ++ ri)1038 {1039 Intersectable *oObject = (*ri).mRay->mOriginObject;1040 Intersectable *tObject = (*ri).mRay->mTerminationObject;1041 1042 if (oObject)1043 {1044 if (!oObject->Mailed())1045 {1046 oObject->Mail();1047 oObject->mCounter = 1;1048 }1049 else1050 {1051 ++ oObject->mCounter;1052 }1053 }1054 if (tObject)1055 {1056 if (!tObject->Mailed())1057 {1058 tObject->Mail();1059 tObject->mCounter = 1;1060 }1061 else1062 {1063 ++ tObject->mCounter;1064 }1065 }1066 }1067 1068 Intersectable::NewMail();1069 1070 vector<SortableEntry>::const_iterator ci, ci_end = mSplitCandidates->end();1071 1072 for (ci = mSplitCandidates->begin(); ci != ci_end; ++ ci)1073 {1074 VssRay *ray;1075 ray = (*ci).ray;1076 1077 Intersectable *oObject = ray->mOriginObject;1078 Intersectable *tObject = ray->mTerminationObject;1079 1080 1081 switch ((*ci).type)1082 {1083 case SortableEntry::ERayMin:1084 {1085 if (oObject && !oObject->Mailed())1086 {1087 oObject->Mail();1088 ++ pvsl;1089 }1090 if (tObject && !tObject->Mailed())1091 {1092 tObject->Mail();1093 ++ pvsl;1094 }1095 break;1096 }1097 case SortableEntry::ERayMax:1098 {1099 if (oObject)1100 {1101 if (-- oObject->mCounter == 0)1102 -- pvsr;1103 }1104 1105 if (tObject)1106 {1107 if (-- tObject->mCounter == 0)1108 -- pvsr;1109 }1110 1111 break;1112 }1113 }1114 1115 1116 // Note: sufficient to compare size of bounding boxes of front and back side?1117 if (((*ci).value >= minBand) && ((*ci).value <= maxBand))1118 {1119 sum = pvsl * ((*ci).value - minBox) + pvsr * (maxBox - (*ci).value);1120 1121 //Debug << "pos=" << (*ci).value << "\t pvs=(" << pvsl << "," << pvsr << ")" << endl;1122 //Debug << "cost= " << sum << endl;1123 1124 if (sum < minSum)1125 {1126 splitPlaneFound = true;1127 1128 minSum = sum;1129 position = (*ci).value;1130 1131 pvsBack = pvsl;1132 pvsFront = pvsr;1133 }1134 }1135 }1136 1137 1138 // -- compute cost1139 1140 const int lowerPvsLimit = mViewCellsManager->GetMinPvsSize();1141 const int upperPvsLimit = mViewCellsManager->GetMaxPvsSize();1142 1143 const float pOverall = sizeBox;1144 const float pBack = position - minBox;1145 const float pFront = maxBox - position;1146 1147 1148 const float penaltyOld = EvalPvsPenalty(pvsSize, lowerPvsLimit, upperPvsLimit);1149 const float penaltyFront = EvalPvsPenalty(pvsFront, lowerPvsLimit, upperPvsLimit);1150 const float penaltyBack = EvalPvsPenalty(pvsBack, lowerPvsLimit, upperPvsLimit);1151 1152 const float oldRenderCost = penaltyOld * pOverall + Limits::Small;1153 const float newRenderCost = penaltyFront * pFront + penaltyBack * pBack;1154 1155 if (splitPlaneFound)1156 {1157 ratio = newRenderCost / oldRenderCost;1158 }1159 //if (axis != 1)1160 //Debug << "axis=" << axis << " costRatio=" << ratio << " pos=" << position << " t=" << (position - minBox) / (maxBox - minBox)1161 // <<"\t pb=(" << pvsBack << ")\t pf=(" << pvsFront << ")" << endl;1162 1163 return ratio;1164 }1165 1166 1167 994 void VspTree::RemoveContriFromPvs(KdLeaf *leaf, int &pvs) const 1168 995 { … … 1194 1021 leaf->Mail(); 1195 1022 1196 // add objects without objectswhich are part of several kd leaves1023 // add objects without those which are part of several kd leaves 1197 1024 pvs += ((int)leaf->mObjects.size() - (int)leaf->mMultipleObjects.size()); 1198 1025 … … 1286 1113 { 1287 1114 set<KdLeaf *>::const_iterator kit, kit_end = tObject->mKdLeaves.end(); 1288 1115 1289 1116 for (kit = tObject->mKdLeaves.begin(); kit != kit_end; ++ kit) 1290 1117 { … … 1305 1132 1306 1133 1307 /*1308 1134 float VspTree::EvalLocalCostHeuristics(const RayInfoContainer &rays, 1309 1135 const AxisAlignedBox3 &box, … … 1322 1148 SortSplitCandidates(rays, axis, minBand, maxBand); 1323 1149 1324 // prepare the heuristics sweep1150 // prepare the sweep 1325 1151 // (note: returns pvs size, so there would be no need 1326 1152 // to give pvs size as argument) … … 1410 1236 1411 1237 return ratio; 1412 } */1238 } 1413 1239 1414 1240 … … 3016 2842 3017 2843 2844 /* 2845 float OspTree::EvalLocalCostHeuristics(const RayInfoContainer &rays, 2846 const AxisAlignedBox3 &box, 2847 int pvsSize, 2848 const int axis, 2849 float &position) 2850 { 2851 const float minBox = box.Min(axis); 2852 const float maxBox = box.Max(axis); 2853 2854 const float sizeBox = maxBox - minBox; 2855 2856 const float minBand = minBox + mMinBand * sizeBox; 2857 const float maxBand = minBox + mMaxBand * sizeBox; 2858 2859 SortSplitCandidates(rays, axis, minBand, maxBand); 2860 2861 // prepare the sweep 2862 // (note: returns pvs size, so there would be no need 2863 // to give pvs size as argument) 2864 pvsSize = PrepareHeuristics(rays); 2865 2866 Debug << "here45 pvs: " << pvsSize << endl; 2867 2868 // go through the lists, count the number of objects left and right 2869 // and evaluate the following cost funcion: 2870 // C = ct_div_ci + (ql*rl + qr*rr)/queries 2871 2872 int pvsl = 0; 2873 int pvsr = pvsSize; 2874 2875 int pvsBack = pvsl; 2876 int pvsFront = pvsr; 2877 2878 float sum = (float)pvsSize * sizeBox; 2879 float minSum = 1e20f; 2880 2881 2882 // if no good split can be found, take mid split 2883 position = minBox + 0.5f * sizeBox; 2884 2885 // the relative cost ratio 2886 float ratio = 99999999.0f; 2887 bool splitPlaneFound = false; 2888 2889 Intersectable::NewMail(); 2890 KdLeaf::NewMail(); 2891 2892 2893 vector<SortableEntry>::const_iterator ci, ci_end = mSplitCandidates->end(); 2894 2895 //-- traverse through visibility events 2896 for (ci = mSplitCandidates->begin(); ci != ci_end; ++ ci) 2897 { 2898 EvalPvsIncr(*ci, pvsl, pvsr); 2899 2900 // Note: sufficient to compare size of bounding boxes of front and back side? 2901 if (((*ci).value >= minBand) && ((*ci).value <= maxBand)) 2902 { 2903 sum = pvsl * ((*ci).value - minBox) + pvsr * (maxBox - (*ci).value); 2904 2905 //Debug << "pos=" << (*ci).value << "\t pvs=(" << pvsl << "," << pvsr << ")" << "\t cost= " << sum << endl; 2906 2907 if (sum < minSum) 2908 { 2909 splitPlaneFound = true; 2910 2911 minSum = sum; 2912 position = (*ci).value; 2913 2914 pvsBack = pvsl; 2915 pvsFront = pvsr; 2916 } 2917 } 2918 } 2919 2920 2921 // -- compute cost 2922 2923 const int lowerPvsLimit = mViewCellsManager->GetMinPvsSize(); 2924 const int upperPvsLimit = mViewCellsManager->GetMaxPvsSize(); 2925 2926 const float pOverall = sizeBox; 2927 const float pBack = position - minBox; 2928 const float pFront = maxBox - position; 2929 2930 const float penaltyOld = EvalPvsPenalty(pvsSize, lowerPvsLimit, upperPvsLimit); 2931 const float penaltyFront = EvalPvsPenalty(pvsFront, lowerPvsLimit, upperPvsLimit); 2932 const float penaltyBack = EvalPvsPenalty(pvsBack, lowerPvsLimit, upperPvsLimit); 2933 2934 const float oldRenderCost = penaltyOld * pOverall + Limits::Small; 2935 const float newRenderCost = penaltyFront * pFront + penaltyBack * pBack; 2936 2937 if (splitPlaneFound) 2938 { 2939 ratio = newRenderCost / oldRenderCost; 2940 } 2941 2942 //if (axis != 1) 2943 Debug << "axis=" << axis << " costRatio=" << ratio << " pos=" << position << " t=" << (position - minBox) / (maxBox - minBox) 2944 <<"\t pb=(" << pvsBack << ")\t pf=(" << pvsFront << ")" << endl; 2945 2946 return ratio; 2947 } 2948 */ 2949 2950 float OspTree::EvalLocalCostHeuristics(BspLeaf *node, 2951 const AxisAlignedBox3 &box, 2952 const int axis, 2953 float &position, 2954 int &objectsBack, 2955 int &objectsFront) 2956 { 2957 2958 /*SortSplitCandidates(node, axis); 2959 2960 // go through the lists, count the number of objects left and right 2961 // and evaluate the following cost funcion: 2962 // C = ct_div_ci + (ol + or)/queries 2963 2964 float totalIntersections = 0.0f; 2965 2966 vector<SortableEntry>::const_iterator ci, ci_end = splitCandidates.end(); 2967 2968 for(ci = splitCandidates->begin(); ci != ci_end; ++ ci) 2969 { 2970 if ((*ci).type == SortableEntry::BOX_MIN) 2971 { 2972 totalIntersections += (*ci).intersectable->IntersectionComplexity(); 2973 } 2974 } 2975 2976 float intersectionsLeft = 0; 2977 float intersectionsRight = totalIntersections; 2978 2979 2980 int objectsLeft = 0, objectsRight = (int)node->mObjects.size(); 2981 2982 float minBox = box.Min(axis); 2983 float maxBox = box.Max(axis); 2984 2985 float boxArea = box.SurfaceArea(); 2986 2987 float minBand = minBox + mSplitBorder*(maxBox - minBox); 2988 float maxBand = minBox + (1.0f - mSplitBorder)*(maxBox - minBox); 2989 2990 float minSum = 1e20f; 2991 2992 for(ci = splitCandidates->begin(); ci != ci_end; ++ ci) 2993 { 2994 EvalPvsIncr(ci, pvsl, pvsr); 2995 2996 if ((*ci).value > minBand && (*ci).value < maxBand) 2997 { 2998 AxisAlignedBox3 lbox = box; 2999 AxisAlignedBox3 rbox = box; 3000 3001 lbox.SetMax(axis, (*ci).value); 3002 rbox.SetMin(axis, (*ci).value); 3003 3004 float sum; 3005 3006 if (mSahUseFaces) 3007 sum = intersectionsLeft*lbox.SurfaceArea() + intersectionsRight*rbox.SurfaceArea(); 3008 else 3009 sum = objectsLeft*lbox.SurfaceArea() + objectsRight*rbox.SurfaceArea(); 3010 3011 // cout<<"pos="<<(*ci).value<<"\t q=("<<ql<<","<<qr<<")\t r=("<<rl<<","<<rr<<")"<<endl; 3012 // cout<<"cost= "<<sum<<endl; 3013 3014 if (sum < minSum) 3015 { 3016 minSum = sum; 3017 position = (*ci).value; 3018 3019 objectsBack = objectsLeft; 3020 objectsFront = objectsRight; 3021 } 3022 } 3023 } 3024 3025 float oldCost = mSahUseFaces ? totalIntersections : node->mObjects.size(); 3026 float newCost = mCt_div_ci + minSum/boxArea; 3027 float ratio = newCost/oldCost; 3028 3029 #if 0 3030 cout<<"===================="<<endl; 3031 cout<<"costRatio="<<ratio<<" pos="<<position<<" t="<<(position - minBox)/(maxBox - minBox) 3032 <<"\t o=("<<objectsBack<<","<<objectsFront<<")"<<endl; 3033 #endif 3034 3035 return ratio; 3036 */ 3037 return 0; 3038 } 3039 3040 3041 void OspTree::SortSplitCandidates(const RayInfoContainer &rays, 3042 const int axis, 3043 float minBand, 3044 float maxBand) 3045 { 3046 // TODO 3047 } 3048 3049 3050 3051 int OspTree::PrepareHeuristics(Intersectable *object) 3052 { 3053 ViewCellPvsMap::const_iterator vit, vit_end = object->mViewCellPvs.mEntries.end(); 3054 3055 int pvsSize = 0; 3056 3057 for (vit = object->mViewCellPvs.mEntries.begin(); vit != vit_end; ++ vit) 3058 { 3059 ViewCell *vc = (*vit).first; 3060 3061 if (!vc->Mailed()) 3062 { 3063 vc->Mail(); 3064 vc->mCounter = 1; 3065 ++ pvsSize; 3066 } 3067 else 3068 { 3069 ++ vc->mCounter; 3070 } 3071 } 3072 3073 return pvsSize; 3074 } 3075 3076 3077 int OspTree::PrepareHeuristics(const RayInfoContainer &rays) 3078 { 3079 Intersectable::NewMail(); 3080 KdNode::NewMail(); 3081 3082 int pvsSize = 0; 3083 3084 RayInfoContainer::const_iterator ri, ri_end = rays.end(); 3085 3086 //-- set all kd nodes as belonging to the front pvs 3087 3088 for (ri = rays.begin(); ri != ri_end; ++ ri) 3089 { 3090 Intersectable *oObject = (*ri).mRay->mOriginObject; 3091 3092 if (oObject) 3093 { 3094 pvsSize += PrepareHeuristics(oObject); 3095 } 3096 3097 Intersectable *tObject = (*ri).mRay->mTerminationObject; 3098 3099 if (tObject) 3100 { 3101 pvsSize += PrepareHeuristics(tObject); 3102 } 3103 } 3104 3105 return pvsSize; 3106 } 3107 3108 3109 void OspTree::EvalPvsIncr(const SortableEntry &ci, 3110 int &pvsLeft, 3111 int &pvsRight) const 3112 { 3113 Intersectable *obj = ci.mObject; 3114 3115 switch (ci.type) 3116 { 3117 case SortableEntry::BOX_MIN: 3118 AddContriToPvs(obj, pvsLeft); 3119 break; 3120 3121 case SortableEntry::BOX_MAX: 3122 RemoveContriFromPvs(obj, pvsRight); 3123 break; 3124 } 3125 } 3126 3127 3128 void OspTree::RemoveContriFromPvs(Intersectable *object, int &pvs) const 3129 { 3130 ViewCellPvsMap::const_iterator vit, vit_end = object->mViewCellPvs.mEntries.end(); 3131 3132 for (vit = object->mViewCellPvs.mEntries.begin(); vit != vit_end; ++ vit) 3133 { 3134 ViewCell *vc = (*vit).first; 3135 3136 if (-- vc->mCounter == 0) 3137 { 3138 -- pvs; 3139 } 3140 } 3141 } 3142 3143 3144 void OspTree::AddContriToPvs(Intersectable *object, int &pvs) const 3145 { 3146 ViewCellPvsMap::const_iterator vit, vit_end = object->mViewCellPvs.mEntries.end(); 3147 3148 for (vit = object->mViewCellPvs.mEntries.begin(); vit != vit_end; ++ vit) 3149 { 3150 ViewCell *vc = (*vit).first; 3151 3152 if (!vc->Mailed()) 3153 { 3154 vc->Mail(); 3155 ++ pvs; 3156 } 3157 } 3158 } 3159 3018 3160 3019 3161 /*********************************************************************/ -
GTP/trunk/Lib/Vis/Preprocessing/src/VspOspTree.h
r1074 r1077 882 882 float maxBand); 883 883 884 /** Prepares objects for SAH.885 @returns pvs size of the ray container886 */887 int PrepareHeuristics(const RayInfoContainer &rays);888 889 int PrepareHeuristics(Intersectable *object);890 891 884 /** Computes pvs increase with respect to the previous pvs for SAH. 892 885 */ … … 916 909 void RemoveContriFromPvs(KdLeaf *leaf, int &pvs) const; 917 910 void AddContriToPvs(KdLeaf *leaf, int &pvs) const; 911 912 /** Prepares objects for SAH. 913 @returns pvs size of the ray container 914 */ 915 int PrepareHeuristics(const RayInfoContainer &rays); 916 917 int PrepareHeuristics(Intersectable *object); 918 918 919 919 /** Subdivides the rays into front and back rays according to the split plane. … … 1333 1333 // For sorting objects 1334 1334 // -------------------------------------------------------------- 1335 struct SortableEntry1335 struct SortableEntry 1336 1336 { 1337 enum EType1337 enum 1338 1338 { 1339 ERayMin,1340 ERayMax1339 BOX_MIN, 1340 BOX_MAX 1341 1341 }; 1342 1342 1343 1343 int type; 1344 1344 float value; 1345 VssRay *ray;1346 1345 Intersectable *mObject; 1346 1347 1347 SortableEntry() {} 1348 SortableEntry(const int t, const float v, VssRay *r):type(t), 1349 value(v), ray(r) 1348 1349 SortableEntry(const int t, const float v, Intersectable *obj): 1350 type(t), value(v), mObject(obj) 1351 {} 1352 1353 bool operator<(const SortableEntry &b) const 1350 1354 { 1351 } 1352 1353 friend bool operator<(const SortableEntry &a, const SortableEntry &b) 1354 { 1355 return a.value < b.value; 1355 return value < b.value; 1356 1356 } 1357 1357 }; 1358 1358 1359 1359 1360 /** faster evaluation of split plane cost for kd axis aligned cells. 1360 1361 */ … … 1449 1450 /** Computes best cost for axis aligned planes. 1450 1451 */ 1451 float EvalLocalCostHeuristics(const RayInfoContainer &rays,1452 /* float EvalLocalCostHeuristics(const RayInfoContainer &rays, 1452 1453 const AxisAlignedBox3 &box, 1453 1454 const int pvsSize, 1454 1455 const int axis, 1455 1456 float &position); 1457 */ 1458 float EvalLocalCostHeuristics(BspLeaf *node, 1459 const AxisAlignedBox3 &box, 1460 const int axis, 1461 float &position, 1462 int &objectsBack, 1463 int &objectsFront); 1456 1464 1457 1465 /** Subdivides the rays into front and back rays according to the split plane. … … 1523 1531 float GetMemUsage() const; 1524 1532 1533 /** Evaluates the influence on the pvs of the visibility event ve. 1534 @param ve the visibility event 1535 @param pvsLeft updates the left pvs 1536 @param rightPvs updates the right pvs 1537 */ 1538 void EvalPvsIncr(const SortableEntry &ve, 1539 int &pvsLeft, 1540 int &pvsRight) const; 1541 1542 void RemoveContriFromPvs(Intersectable *object, int &pvs) const; 1543 void AddContriToPvs(Intersectable *object, int &pvs) const; 1544 1545 /** Prepares objects for SAH. 1546 @returns pvs size of the ray container 1547 */ 1548 int PrepareHeuristics(const RayInfoContainer &rays); 1549 1550 int PrepareHeuristics(Intersectable *object); 1525 1551 1526 1552 protected:
Note: See TracChangeset
for help on using the changeset viewer.