- Timestamp:
- 11/20/05 22:57:44 (19 years ago)
- Location:
- trunk/VUT/GtpVisibilityPreprocessor/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/src/Environment.cpp
r421 r424 1270 1270 "-1"); 1271 1271 1272 RegisterOption("BspTree.Termination.ct_div_ci", 1273 optFloat, 1274 "-bsp_term_ct_div_ci=", 1275 "0.0"); 1276 1277 RegisterOption("BspTree.Termination.maxDepth", 1278 optInt, 1279 "-bsp_term_max_depth=", 1280 "100"); 1281 1272 1282 RegisterOption("BspTree.Termination.AxisAligned.maxCostRatio", 1273 1283 optFloat, 1274 "-bsp_term_ max_cost_ratio=",1284 "-bsp_term_axis_aligned_max_cost_ratio=", 1275 1285 "1.5"); 1276 1286 1277 1287 RegisterOption("BspTree.Termination.AxisAligned.ct_div_ci", 1278 1288 optFloat, 1279 "-bsp_term_ ct_div_ci=",1280 " 1.0");1289 "-bsp_term_axis_aligned_ct_div_ci=", 1290 "0.5"); 1281 1291 1282 1292 RegisterOption("BspTree.AxisAligned.splitBorder", 1283 1293 optFloat, 1284 "-bsp_ split_border=",1294 "-bsp__axis_aligned_split_border=", 1285 1295 "0.1"); 1286 1296 1287 1297 RegisterOption("BspTree.Termination.AxisAligned.maxPolys", 1288 1298 optInt, 1289 "-bsp_term_ max_polygons=",1299 "-bsp_term_axis_aligned_max_polygons=", 1290 1300 "50"); 1291 1301 … … 1297 1307 RegisterOption("BspTree.Termination.AxisAligned.maxRays", 1298 1308 optInt, 1299 "-bsp_term_ max_rays=",1309 "-bsp_term_axis_aligned_max_rays=", 1300 1310 "-1"); 1301 1302 RegisterOption("BspTree.Termination.maxDepth",1303 optInt,1304 "-bsp_term_max_depth=",1305 "100");1306 1311 1307 1312 RegisterOption("BspTree.splitPlaneStrategy", … … 1330 1335 "false"); 1331 1336 1337 RegisterOption("BspTree.Factor.verticalSplits", optFloat, "-bsp_factor_vertical=", "1.0"); 1338 RegisterOption("BspTree.Factor.largestPolyArea", optFloat, "-bsp_factor_largest_poly=", "1.0"); 1339 RegisterOption("BspTree.Factor.blockedRays", optFloat, "-bsp_factor_blocked=", "1.0"); 1340 RegisterOption("BspTree.Factor.leastRaySplits", optFloat, "-bsp_factor_least_ray_splits=", "1.0"); 1341 RegisterOption("BspTree.Factor.balancedRays", optFloat, "-bsp_factor_balanced_rays=", "1.0"); 1342 RegisterOption("BspTree.Factor.pvsFactor", optFloat, "-bsp_factor_pvs=", "1.0"); 1343 RegisterOption("BspTree.Factor.leastSplits", optFloat, "-bsp_factor_least_splits=", "1.0"); 1344 RegisterOption("BspTree.Factor.balancedPolys", optFloat, "-bsp_factor_balanced_polys=", "1.0"); 1345 RegisterOption("BspTree.Factor.balancedViewCells", optFloat, "-bsp_factor_balanced_view_cells=", "1.0"); 1346 1332 1347 RegisterOption("Preprocessor.type", 1333 1334 1335 1348 optString, 1349 "-preprocessor=", 1350 "sampling"); 1336 1351 1337 1352 -
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.cpp
r423 r424 274 274 mRoot(NULL), 275 275 mGenerateViewCells(false), 276 //-- factors for bsp tree split plane heuristics277 mVerticalSplitsFactor(1.0f),278 mLargestPolyAreaFactor(1.0f),279 mBlockedRaysFactor(1.0f),280 mLeastRaySplitsFactor(1.0f),281 mBalancedRaysFactor(1.0f),282 mPvsFactor(1.0f),283 mLeastSplitsFactor(1.0f),284 mBalancedPolysFactor(1.0f),285 mBalancedViewCellsFactor(1.0f),286 //------------------------------------287 276 mStoreLeavesWithRays(false), 288 277 mPvsUseArea(true) … … 299 288 environment->GetFloatValue("BspTree.Termination.maxAccRayLenght", mTermMaxAccRayLength); 300 289 290 //-- factors for bsp tree split plane heuristics 291 environment->GetFloatValue("BspTree.Factor.verticalSplits", mVerticalSplitsFactor); 292 environment->GetFloatValue("BspTree.Factor.largestPolyArea", mLargestPolyAreaFactor); 293 environment->GetFloatValue("BspTree.Factor.blockedRays", mBlockedRaysFactor); 294 environment->GetFloatValue("BspTree.Factor.leastRaySplits", mLeastRaySplitsFactor); 295 environment->GetFloatValue("BspTree.Factor.balancedRays", mBalancedRaysFactor); 296 environment->GetFloatValue("BspTree.Factor.pvsFactor", mPvsFactor); 297 environment->GetFloatValue("BspTree.Factor.leastSplits" , mLeastSplitsFactor); 298 environment->GetFloatValue("BspTree.Factor.balancedPolys", mBalancedPolysFactor); 299 environment->GetFloatValue("BspTree.Factor.balancedViewCells", mBalancedViewCellsFactor); 300 environment->GetFloatValue("BspTree.Termination.ct_div_ci", mCtDivCi); 301 301 302 //-- termination criteria for axis aligned split 302 environment->GetFloatValue("BspTree.Termination.AxisAligned.ct_div_ci", m CtDivCi);303 environment->GetFloatValue("BspTree.Termination.AxisAligned.ct_div_ci", mAaCtDivCi); 303 304 environment->GetFloatValue("BspTree.Termination.AxisAligned.maxCostRatio", mMaxCostRatio); 304 305 environment->GetIntValue("BspTree.Termination.AxisAligned.maxPolys", … … 1034 1035 1035 1036 float oldCost = (float)polys.size(); 1036 float newCost = m CtDivCi + minSum / boxArea;1037 float newCost = mAaCtDivCi + minSum / boxArea; 1037 1038 float ratio = newCost / oldCost; 1038 1039 … … 1491 1492 1492 1493 if (!mPvsUseArea) // use front and back cell areas to approximate volume 1493 { 1494 { 1494 1495 float len = Distance(entP, extP); 1495 1496 pOverall += len; -
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.h
r423 r424 810 810 float mTermMaxAccRayLength; 811 811 812 float mCtDivCi; 813 814 /// if intersected leaves should be stored with a sample 812 815 bool mStoreLeavesWithRays; 813 816 814 817 /// axis aligned split criteria 815 float m CtDivCi;818 float mAaCtDivCi; 816 819 float mSplitBorder; 817 820 float mMaxCostRatio; 818 821 819 822 // factors guiding the split plane heuristics 820 float mLeastSplitsFactor;821 float mBalancedPolysFactor;822 float mBalancedViewCellsFactor;823 823 float mVerticalSplitsFactor; 824 824 float mLargestPolyAreaFactor; … … 827 827 float mBalancedRaysFactor; 828 828 float mPvsFactor; 829 float mLeastSplitsFactor; 830 float mBalancedPolysFactor; 831 float mBalancedViewCellsFactor; 829 832 830 833 //-- thresholds used for view cells merge -
trunk/VUT/GtpVisibilityPreprocessor/src/VspKdTree.cpp
r423 r424 531 531 532 532 // returns selected plane for subdivision 533 int 534 VspKdTree::SelectPlane(VspKdTreeLeaf *leaf, 535 const AxisAlignedBox3 &box, 536 float &position, 537 int &raysBack, 538 int &raysFront, 539 int &pvsBack, 540 int &pvsFront) 533 int VspKdTree::SelectPlane(VspKdTreeLeaf *leaf, 534 const AxisAlignedBox3 &box, 535 float &position, 536 int &raysBack, 537 int &raysFront, 538 int &pvsBack, 539 int &pvsFront) 541 540 { 542 541 int minDirDepth = 6; … … 615 614 // this is the main ray classification loop! 616 615 for(RayInfoContainer::iterator ri = leaf->mRays.begin(); 617 ri != leaf->mRays.end(); ri++)616 ri != leaf->mRays.end(); ++ ri) 618 617 { 619 618 if (!(*ri).mRay->IsActive()) … … 640 639 641 640 // float sum = raysBack*(position - minBox) + raysFront*(maxBox - position); 642 float sum = pvsBack *(position - minBox) + pvsFront * (maxBox - position);643 644 newCost = mCtDivCi + sum / sizeBox;641 float sum = pvsBack * (position - minBox) + pvsFront * (maxBox - position); 642 643 newCost = mCtDivCi + sum / sizeBox; 645 644 646 645 // cout<<axis<<" "<<pvsSize<<" "<<pvsBack<<" "<<pvsFront<<endl; … … 677 676 if (!mOnlyDrivingAxis || axis == sAxis) 678 677 { 679 nPosition[axis] = (sBox.Min()[axis] + sBox.Max()[axis]) *0.5f;678 nPosition[axis] = (sBox.Min()[axis] + sBox.Max()[axis]) * 0.5f; 680 679 681 680 nCostRatio[axis] = EvalCostRatio(leaf, … … 728 727 int rl = 0, rr = (int)leaf->mRays.size(); 729 728 int pl = 0, pr = leaf->GetPvsSize(); 729 730 730 float minBox = box.Min(axis); 731 731 float maxBox = box.Max(axis); … … 739 739 740 740 Intersectable::NewMail(); 741 741 742 // set all object as belonging to the fron pvs 742 743 for(RayInfoContainer::iterator ri = leaf->mRays.begin(); 743 ri != leaf->mRays.end(); 744 ri != leaf->mRays.end(); ++ ri) 744 745 { 745 746 if ((*ri).mRay->IsActive())
Note: See TracChangeset
for help on using the changeset viewer.