- Timestamp:
- 01/17/06 23:28:10 (19 years ago)
- Location:
- trunk/VUT/GtpVisibilityPreprocessor
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/scripts/default.env
r546 r547 13 13 #;../data/vienna/vienna-plane.x3d 14 14 # filename ../data/vienna/viewcells-25-sel.x3d 15 filename ../data/atlanta/atlanta2.x3d15 # filename ../data/atlanta/atlanta2.x3d 16 16 # filename ../data/soda/soda.dat 17 #filename ../data/soda/soda5.dat17 filename ../data/soda/soda5.dat 18 18 } 19 19 … … 30 30 samplesPerPass 100000 31 31 initialSamples 300000 32 vssSamples 120000032 vssSamples 700000 33 33 vssSamplesPerPass 100000 34 34 useImportanceSampling true 35 35 loadInitialSamples false 36 36 storeInitialSamples false 37 useViewSpaceBox false37 useViewSpaceBox true 38 38 testBeamSampling true 39 39 } … … 182 182 maxViewCells 100000 183 183 #percentage of total visible objects where pvs is considered invalid 184 maxPvsRatio 0. 5184 maxPvsRatio 0.9 185 185 186 186 delayedConstruction true … … 195 195 # how much samples we use for visualization 196 196 samples 5000 197 #colorCode PVS197 colorCode PVS 198 198 #colorCode MergedLeaves 199 199 #colorCode MergedTreeDiff 200 colorCode Random200 #colorCode Random 201 201 exportRays false 202 202 exportGeometry true … … 259 259 VspBspTree { 260 260 Construction { 261 samples 800000261 samples 500000 262 262 epsilon 0.005 263 263 randomize false … … 271 271 # pvs = 1024 272 272 273 splitPlaneStrategy 102 6273 splitPlaneStrategy 1024 274 274 275 275 # maximal candidates for split planes … … 296 296 maxDepth 30 297 297 minPvs 10 298 #min Area0.0001299 min Area-1300 maxRayContribution 0. 3298 #minProbability 0.0001 299 minProbability -1 300 maxRayContribution 0.2 301 301 maxCostRatio 0.9 302 302 missTolerance 3 303 303 #maxAccRayLength 100 304 304 305 maxViewCells 5001305 maxViewCells 2501 306 306 307 307 # used for pvs criterium … … 323 323 PostProcess { 324 324 maxCostRatio 0.001 325 minViewCells 2000325 minViewCells 120 326 326 useRaysForMerge true 327 327 } -
trunk/VUT/GtpVisibilityPreprocessor/src/AxisAlignedBox3.cpp
r545 r547 2082 2082 face6->mVertices.push_back(Vector3(mMax.x, mMax.y, mMax.z)); 2083 2083 face6->mVertices.push_back(Vector3(mMin.x, mMax.y, mMax.z)); 2084 } 2084 2085 } -
trunk/VUT/GtpVisibilityPreprocessor/src/Environment.cpp
r542 r547 1708 1708 "vsp_bsp_term_min_pvs=", 1709 1709 "20"); 1710 RegisterOption("VspBspTree.Termination.min Area",1710 RegisterOption("VspBspTree.Termination.minProbability", 1711 1711 optFloat, 1712 "vsp_bsp_term_min_ area=",1712 "vsp_bsp_term_min_probability=", 1713 1713 "0.001"); 1714 1714 -
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCell.cpp
r520 r547 11 11 mPiercingRays(0), 12 12 mArea(0), 13 mVolume(0) 13 mVolume(0), 14 mValid(true) 14 15 { 15 16 } … … 19 20 mPiercingRays(0), 20 21 mArea(0), 21 mVolume(0) 22 mVolume(0), 23 mValid(true) 22 24 { 23 25 } … … 96 98 97 99 100 void ViewCell::SetValid(const bool valid) 101 { 102 mValid = true; 103 } 104 105 106 bool ViewCell::GetValid() const 107 { 108 return mValid; 109 } 110 111 98 112 /************************************************************************/ 99 113 /* class ViewCellsStatistics implementation */ -
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCell.h
r520 r547 131 131 void SetMesh(Mesh *mesh); 132 132 133 void SetValid(const bool valid); 134 bool GetValid() const; 135 133 136 protected: 134 137 … … 138 141 float mVolume; 139 142 float mArea; 143 144 145 bool mValid; 140 146 }; 141 147 -
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.cpp
r545 r547 212 212 BspTree::BspTree(): 213 213 mRoot(NULL), 214 m PvsUseArea(true),214 mUseAreaForPvs(true), 215 215 mGenerateViewCells(true) 216 216 { … … 410 410 << maxCostNodes * 100 / (double)Leaves() << endl; 411 411 412 app << "#N_PMINAREALEAVES ( Percentage of leaves with mininum area)\n"413 << min AreaNodes * 100 / (double)Leaves() << endl;412 app << "#N_PMINAREALEAVES ( Percentage of leaves with mininum probability )\n" 413 << minProbabilityNodes * 100 / (double)Leaves() << endl; 414 414 415 415 app << "#N_PMAXRAYCONTRIBLEAVES ( Percentage of leaves with maximal ray contribution )\n" … … 1535 1535 GenerateUniqueIdsForPvs(); 1536 1536 1537 if (m PvsUseArea) // use front and back cell areas to approximate volume1537 if (mUseAreaForPvs) // use front and back cell areas to approximate volume 1538 1538 { 1539 1539 // construct child geometry with regard to the candidate split plane … … 1607 1607 AddObjToPvs(ray->sourceObject.mObject, cf, frontPvs, backPvs); 1608 1608 1609 if (m PvsUseArea)1609 if (mUseAreaForPvs) 1610 1610 { 1611 1611 float len = 1; … … 1830 1830 1831 1831 if (data.mGeometry->GetArea() <= mTermMinArea) 1832 ++ mStat.min AreaNodes;1832 ++ mStat.minProbabilityNodes; 1833 1833 1834 1834 #ifdef _DEBUG -
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.h
r545 r547 130 130 int maxRayContribNodes; 131 131 // minimum area nodes 132 int min AreaNodes;132 int minProbabilityNodes; 133 133 /// nodes termination because of max cost ratio; 134 134 int maxCostNodes; … … 181 181 minRaysNodes = 0; 182 182 maxRayContribNodes = 0; 183 min AreaNodes = 0;183 minProbabilityNodes = 0; 184 184 maxCostNodes = 0; 185 185 … … 310 310 /** BSP leaf node implementation. 311 311 */ 312 class BspLeaf 312 class BspLeaf: public BspNode 313 313 { 314 314 friend class BspTree; … … 340 340 ObjectPvs *mPvs; 341 341 342 /// leaf area343 float m Area;342 /// Probability that the view point lies in this leaf 343 float mProbability; 344 344 345 345 protected: … … 886 886 887 887 /// if area or accumulated ray lenght should be used for PVS heuristics 888 bool m PvsUseArea;888 bool mUseAreaForPvs; 889 889 890 890 /// epsilon where two points are still considered equal -
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellsManager.cpp
r544 r547 25 25 mTotalAreaValid(false), 26 26 mTotalArea(0.0f), 27 mViewCellsFinished(false) 27 mViewCellsFinished(false), 28 mMaxPvsSize(99999) 28 29 { 29 30 mViewSpaceBox.Initialize(); … … 49 50 environment->GetBoolValue("ViewCells.Visualization.exportRays", mExportRays); 50 51 environment->GetBoolValue("ViewCells.Visualization.exportGeometry", mExportGeometry); 52 environment->GetFloatValue("ViewCells.maxPvsRatio", mMaxPvsRatio); 51 53 52 54 char buf[50]; … … 105 107 return (int)rays.size(); 106 108 } 109 110 111 bool ViewCellsManager::CheckValid(ViewCell *vc) const 112 { 113 if (vc->GetPvs().GetSize() > mMaxPvsSize) 114 return false; 115 116 return true; 117 } 118 107 119 108 120 bool ViewCellsManager::LoadViewCells(const string filename, ObjectContainer *objects) … … 347 359 } 348 360 361 349 362 ViewCellContainer &ViewCellsManager::GetViewCells() 350 363 { … … 375 388 // has to be recomputed 376 389 mTotalAreaValid = false; 390 } 391 392 393 int ViewCellsManager::GetMaxPvsSize() const 394 { 395 return mMaxPvsSize; 377 396 } 378 397 … … 1797 1816 float VspBspViewCellsManager::GetProbability(ViewCell *viewCell) 1798 1817 { 1799 #if 0 1800 return GetArea(viewCell) / GetViewSpaceBox().SurfaceArea(); 1801 #else 1802 return GetArea(viewCell) / GetAccVcArea(); 1803 #endif 1818 if (mVspBspTree->mUseAreaForPvs) 1819 return GetArea(viewCell) / GetAccVcArea(); 1820 else 1821 return GetVolume(viewCell) / mViewSpaceBox.GetVolume(); 1804 1822 } 1805 1823 … … 1807 1825 void VspBspViewCellsManager::CollectViewCells() 1808 1826 { 1809 mVspBspTree->CollectViewCells(mViewCells );1827 mVspBspTree->CollectViewCells(mViewCells, false); 1810 1828 } 1811 1829 … … 1852 1870 Debug << "saved rays: " << (int)savedRays.size() << endl; 1853 1871 1872 mMaxPvsSize = (int)(mMaxPvsRatio * (float)objects.size()); 1873 1854 1874 mVspBspTree->Construct(constructionRays, &mViewSpaceBox); 1855 1875 … … 1929 1949 1930 1950 // TODO: should be done BEFORE the ray casting 1931 merged = mVspBspTree->MergeViewCells(rays );1951 merged = mVspBspTree->MergeViewCells(rays, objects); 1932 1952 1933 1953 //-- stats and visualizations … … 2300 2320 ViewCell *vc) const 2301 2321 { 2302 if ( mColorCode == 0) // Random color2322 if (CheckValid(vc) && (mColorCode == 0)) // Random color 2303 2323 return; 2304 2324 2305 2325 float importance = 0; 2306 2326 2327 Material m; 2328 2307 2329 switch (mColorCode) 2308 2330 { … … 2319 2341 importance = (float)bspVc->mLeaves.size() / 2320 2342 (float)mViewCellsStats.maxLeaves; 2343 2344 if (CheckValid(vc)) 2345 m.mDiffuseColor.b = 1.0f; 2346 m.mDiffuseColor.r = importance; 2347 m.mDiffuseColor.g = 1.0f - m.mDiffuseColor.r; 2321 2348 } 2322 2349 break; … … 2325 2352 importance = (float)GetMaxTreeDiff(vc) / 2326 2353 (float)(mVspBspTree->GetStatistics().maxDepth * 2); 2354 2355 if (CheckValid(vc)) 2356 m.mDiffuseColor.b = 1.0f; 2357 m.mDiffuseColor.r = importance; 2358 m.mDiffuseColor.g = 1.0f - m.mDiffuseColor.r; 2327 2359 } 2328 2360 break; … … 2331 2363 } 2332 2364 2333 Material m; 2334 m.mDiffuseColor.b = 1.0f; 2365 m.mDiffuseColor.b = CheckValid(vc) ? 1.0f : 0.0f; 2335 2366 m.mDiffuseColor.r = importance; 2336 2367 m.mDiffuseColor.g = 1.0f - m.mDiffuseColor.r; 2368 2337 2369 //Debug << "importance: " << importance << endl; 2338 2370 exporter->SetForcedMaterial(m); -
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellsManager.h
r542 r547 251 251 virtual int CastBeam(Beam &beam); 252 252 253 /** Checks if view cell is considered as valid. 254 */ 255 virtual bool CheckValid(ViewCell *vc) const; 256 257 /** Returns maximal allowed pvs size. 258 */ 259 int GetMaxPvsSize() const; 260 261 262 /** Exports view cell geometry. 263 */ 264 virtual void ExportVcGeometry(Exporter *exporter, ViewCell *vc) const = 0; 265 253 266 protected: 254 267 … … 258 271 */ 259 272 void CreateUniqueViewCellIds(); 273 260 274 /** Recollects view cells and resets statistics. 261 275 */ … … 281 295 virtual void ExportColor(Exporter *exporter, ViewCell *vc) const = 0; 282 296 283 /** Exports view cell geometry. 284 */ 285 virtual void ExportVcGeometry(Exporter *exporter, ViewCell *vc) const = 0; 286 297 287 298 /** Creates meshes from the view cells. 288 299 */ … … 316 327 float mTotalAreaValid; 317 328 float mTotalArea; 329 330 int mMaxPvsSize; 331 332 float mMaxPvsRatio; 318 333 319 334 ViewCellsStatistics mViewCellsStats; … … 324 339 /// if view cells should be exported 325 340 bool mExportViewCells; 341 342 326 343 //-- visualization options 327 344 … … 380 397 void CreateMesh(ViewCell *vc); 381 398 399 void ExportVcGeometry(Exporter *exporter, ViewCell *vc) const; 400 382 401 protected: 383 402 … … 396 415 397 416 void ExportColor(Exporter *exporter, ViewCell *vc) const; 398 void ExportVcGeometry(Exporter *exporter, ViewCell *vc) const; 417 418 399 419 400 420 /// the BSP tree. … … 453 473 void CreateMesh(ViewCell *vc); 454 474 475 void ExportVcGeometry(Exporter *exporter, ViewCell *vc) const; 476 455 477 protected: 456 478 … … 459 481 460 482 void ExportColor(Exporter *exporter, ViewCell *vc) const; 461 void ExportVcGeometry(Exporter *exporter, ViewCell *vc) const; 483 462 484 463 485 /// the BSP tree. … … 509 531 void CreateMesh(ViewCell *vc); 510 532 533 void ExportVcGeometry(Exporter *exporter, ViewCell *vc) const; 534 511 535 protected: 512 536 … … 517 541 518 542 void ExportColor(Exporter *exporter, ViewCell *vc) const; 519 void ExportVcGeometry(Exporter *exporter, ViewCell *vc) const; 543 520 544 521 545 … … 573 597 int CastBeam(Beam &beam); 574 598 599 void ExportVcGeometry(Exporter *exporter, ViewCell *vc) const; 600 575 601 protected: 576 602 … … 591 617 592 618 void ExportColor(Exporter *exporter, ViewCell *vc) const; 593 void ExportVcGeometry(Exporter *exporter, ViewCell *vc) const;594 595 619 596 620 /// the view space partition BSP tree. -
trunk/VUT/GtpVisibilityPreprocessor/src/VspBspTree.cpp
r545 r547 36 36 37 37 float BspMergeCandidate::sOverallCost = 0; 38 bool BspMergeCandidate::sUseArea = false; 38 39 39 40 /********************************************************************/ … … 43 44 VspBspTree::VspBspTree(): 44 45 mRoot(NULL), 45 m PvsUseArea(true),46 mUseAreaForPvs(false), 46 47 mCostNormalizer(Limits::Small), 47 48 mViewCellsManager(NULL), 48 49 mOutOfBoundsCell(NULL), 49 mShowInvalidSpace(false),50 50 mStoreRays(false) 51 51 { … … 59 59 environment->GetIntValue("VspBspTree.Termination.minPvs", mTermMinPvs); 60 60 environment->GetIntValue("VspBspTree.Termination.minRays", mTermMinRays); 61 environment->GetFloatValue("VspBspTree.Termination.min Area", mTermMinArea);61 environment->GetFloatValue("VspBspTree.Termination.minProbability", mTermMinProbability); 62 62 environment->GetFloatValue("VspBspTree.Termination.maxRayContribution", mTermMaxRayContribution); 63 63 environment->GetFloatValue("VspBspTree.Termination.minAccRayLenght", mTermMinAccRayLength); … … 89 89 environment->GetBoolValue("VspBspTree.PostProcess.useRaysForMerge", mUseRaysForMerge); 90 90 91 environment->GetFloatValue("ViewCells.maxPvsRatio", mMaxPvsRatio);92 91 93 92 //-- termination criteria for axis aligned split … … 100 99 environment->GetFloatValue("VspBspTree.maxStaticMemory", mMaxMemory); 101 100 101 102 mStats.open("bspStats.log"); 103 102 104 //-- debug output 103 105 Debug << "******* VSP BSP options ******** " << endl; 104 106 Debug << "max depth: " << mTermMaxDepth << endl; 105 107 Debug << "min PVS: " << mTermMinPvs << endl; 106 Debug << "min area: " << mTermMinArea<< endl;108 Debug << "min probabiliy: " << mTermMinProbability << endl; 107 109 Debug << "min rays: " << mTermMinRays << endl; 108 110 Debug << "max ray contri: " << mTermMaxRayContribution << endl; … … 158 160 mOutOfBoundsCell = new BspViewCell(); 159 161 mOutOfBoundsCell->SetId(-1); 160 } 162 mOutOfBoundsCell->SetValid(false); 163 } 164 161 165 return mOutOfBoundsCell; 162 166 } … … 311 315 } 312 316 } 313 314 mMaxPvs = (int)(mMaxPvsRatio * (float)numObj); 315 316 Debug << "maximal pvs (i.e., pvs still considered as valid) : " << mMaxPvs << endl; 317 318 Debug << "maximal pvs (i.e., pvs still considered as valid) : " << mViewCellsManager->GetMaxPvsSize() << endl; 317 319 //-- store rays 318 320 for (rit = sampleRays.begin(); rit != rit_end; ++ rit) … … 334 336 } 335 337 336 mTermMinArea *= mBox.SurfaceArea(); // normalize 338 if (mUseAreaForPvs) 339 mTermMinProbability *= mBox.SurfaceArea(); // normalize 340 else 341 mTermMinProbability *= mBox.GetVolume(); 342 337 343 mStat.polys = (int)polys.size(); 338 344 … … 372 378 ConstructGeometry(mRoot, *geom); 373 379 380 const float prop = mUseAreaForPvs ? geom->GetArea() : geom->GetVolume(); 381 374 382 VspBspTraversalData tData(mRoot, 375 383 new PolygonContainer(polys), … … 377 385 rays, 378 386 ComputePvsSize(*rays), 379 geom->GetArea(),387 prop, 380 388 geom); 381 389 … … 386 394 387 395 long startTime = GetTime(); 396 // used for intermediate time measurements 388 397 long interTime = GetTime(); 398 389 399 mOutOfMemory = false; 390 400 … … 437 447 (((int)data.mRays->size() <= mTermMinRays) || 438 448 (data.mPvs <= mTermMinPvs) || 439 (data.m Area <= mTermMinArea) ||449 (data.mProbability <= mTermMinProbability) || 440 450 (mStat.Leaves() >= mMaxViewCells) || 441 451 (data.GetAvgRayContribution() > mTermMaxRayContribution) || … … 475 485 { 476 486 BspLeaf *leaf = dynamic_cast<BspLeaf *>(newNode); 477 BspViewCell *viewCell; 478 479 if (!CheckValid(tData)) 480 { 481 leaf->SetTreeValid(false); 482 PropagateUpValidity(leaf); 483 // view cell for invalid view space 484 viewCell = GetOrCreateOutOfBoundsCell(); 485 ++ mStat.invalidLeaves; 486 } 487 else 488 { // create new view cell for this leaf 489 viewCell = new BspViewCell(); 490 } 487 BspViewCell *viewCell = new BspViewCell(); 491 488 492 489 leaf->SetViewCell(viewCell); … … 506 503 leaf->mVssRays.push_back((*it).mRay); 507 504 } 508 509 viewCell->mLeaves.push_back(leaf); 510 viewCell->SetArea(tData.mArea); 511 leaf->mArea = tData.mArea; 505 506 if (!mViewCellsManager->CheckValid(viewCell)) 507 { 508 viewCell->SetValid(false); 509 510 leaf->SetTreeValid(false); 511 PropagateUpValidity(leaf); 512 513 ++ mStat.invalidLeaves; 514 } 515 516 viewCell->mLeaves.push_back(leaf); 517 518 if (mUseAreaForPvs) 519 viewCell->SetArea(tData.mProbability); 520 else 521 viewCell->SetVolume(tData.mProbability); 522 523 leaf->mProbability = tData.mProbability; 512 524 513 525 EvaluateLeafStats(tData); … … 591 603 592 604 // split front and back node geometry and compute area 593 if (mPvsUseArea) 594 { 595 // if geometry was not already computed 596 if (!frontData.mGeometry && !backData.mGeometry) 597 { 598 frontData.mGeometry = new BspNodeGeometry(); 599 backData.mGeometry = new BspNodeGeometry(); 600 601 tData.mGeometry->SplitGeometry(*frontData.mGeometry, 602 *backData.mGeometry, 603 interior->GetPlane(), 604 mBox, 605 mEpsilon); 605 606 // if geometry was not already computed 607 if (!frontData.mGeometry && !backData.mGeometry) 608 { 609 frontData.mGeometry = new BspNodeGeometry(); 610 backData.mGeometry = new BspNodeGeometry(); 611 612 tData.mGeometry->SplitGeometry(*frontData.mGeometry, 613 *backData.mGeometry, 614 interior->GetPlane(), 615 mBox, 616 mEpsilon); 606 617 607 //frontData.mArea = frontData.mGeometry->GetArea(); 608 //backData.mArea = backData.mGeometry->GetArea(); 609 frontData.mArea = frontData.mGeometry->GetVolume(); 610 backData.mArea = backData.mGeometry->GetVolume(); 611 } 612 } 613 else 614 { 615 frontData.mArea = (float)frontData.mRays->size(); 616 backData.mArea = (float)backData.mRays->size(); 617 } 618 if (mUseAreaForPvs) 619 { 620 frontData.mProbability = frontData.mGeometry->GetArea(); 621 backData.mProbability = backData.mGeometry->GetArea(); 622 } 623 else 624 { 625 frontData.mProbability = frontData.mGeometry->GetVolume(); 626 backData.mProbability = backData.mGeometry->GetVolume(); 627 } 628 } 629 618 630 619 631 //-- create front and back leaf … … 836 848 BspNodeGeometry **frontGeom, 837 849 BspNodeGeometry **backGeom, 838 float & frontArea,839 float & backArea,840 bool useKdSplit)850 float &pFront, 851 float &pBack, 852 const bool useKdSplit) 841 853 { 842 854 const bool useCostHeuristics = false; … … 845 857 float nPosition[3]; 846 858 float nCostRatio[3]; 847 float n FrontArea[3];848 float n BackArea[3];859 float nProbFront[3]; 860 float nProbBack[3]; 849 861 850 862 BspNodeGeometry *nFrontGeom[3]; … … 856 868 AxisAlignedBox3 box; 857 869 box.Initialize(); 870 858 871 //TODO: for kd split geometry already is box 859 if (1 && m PvsUseArea)872 if (1 && mUseAreaForPvs) 860 873 { 861 874 PolygonContainer::const_iterator it, it_end = tData.mGeometry->mPolys.end(); … … 872 885 } 873 886 874 int sAxis = box.Size().DrivingAxis();887 const int sAxis = box.Size().DrivingAxis(); 875 888 876 889 for (axis = 0; axis < 3; ++ axis) … … 885 898 nPosition[axis] = (box.Min()[axis] + box.Max()[axis]) * 0.5f; 886 899 Vector3 normal(0,0,0); normal[axis] = 1.0f; 887 900 901 // allows faster split because we have axis aligned kd tree boxes 888 902 if (useKdSplit) 889 903 { … … 891 905 box, 892 906 axis, 893 nPosition[axis]); 907 nPosition[axis], 908 nProbFront[axis], 909 nProbBack[axis]); 894 910 895 911 Vector3 pos; 896 912 897 913 pos = box.Max(); pos[axis] = nPosition[axis]; 898 const AxisAlignedBox3 backBox(box.Min(), pos);899 b ackBox.ExtractPolys(nBackGeom[axis]->mPolys);914 AxisAlignedBox3 bBox(box.Min(), pos); 915 bBox.ExtractPolys(nBackGeom[axis]->mPolys); 900 916 901 917 pos = box.Min(); pos[axis] = nPosition[axis]; 902 const AxisAlignedBox3 frontBox(pos, box.Max()); 903 frontBox.ExtractPolys(nFrontGeom[axis]->mPolys); 904 918 AxisAlignedBox3 fBox(pos, box.Max()); 919 fBox.ExtractPolys(nFrontGeom[axis]->mPolys); 905 920 } 906 921 else … … 908 923 nCostRatio[axis] = SplitPlaneCost(Plane3(normal, nPosition[axis]), 909 924 tData, *nFrontGeom[axis], *nBackGeom[axis], 910 n FrontArea[axis], nBackArea[axis]);925 nProbFront[axis], nProbBack[axis]); 911 926 } 912 927 } … … 936 951 //-- assign values 937 952 axis = bestAxis; 938 frontArea = nFrontArea[bestAxis];939 backArea = nBackArea[bestAxis];953 pFront = nProbFront[bestAxis]; 954 pBack = nProbBack[bestAxis]; 940 955 941 956 // assign best split nodes geometry … … 958 973 const AxisAlignedBox3 &box, 959 974 const int axis, 960 const float &position) const 961 { 975 const float &position, 976 float &pFront, 977 float &pBack) const 978 { 979 int pvsTotal = 0; 962 980 int pvsFront = 0; 963 981 int pvsBack = 0; 964 int pvsTotal = 0; 965 982 966 983 // create unique ids for pvs heuristics 967 984 GenerateUniqueIdsForPvs(); … … 984 1001 } 985 1002 986 //-- only one of these options should be one 987 //-- pvs + probability heuristics 988 float pBack, pFront, pOverall; 989 990 if (1) 991 { 1003 //-- pvs heuristics 1004 float pOverall; 1005 1006 // -- simplified computation for mid split 1007 1008 1009 pOverall = data.mProbability; 1010 1011 if (!mUseAreaForPvs) 1012 { // volume 1013 pBack = pFront = pOverall * 0.5f; 992 1014 // box length substitute for probability 1015 #if 0 993 1016 const float minBox = box.Min(axis); 994 1017 const float maxBox = box.Max(axis); … … 997 1020 pFront = maxBox - position; 998 1021 pOverall = maxBox - minBox; 1022 #endif 999 1023 } 1000 1024 else //-- area substitute for probability 1001 1025 { 1002 pOverall = box.SurfaceArea();1003 1004 const bool useMidSplit = true;1005 //const bool useMidSplit = false;1006 1007 //-- simplified computation for mid split1008 1026 const int axis2 = (axis + 1) % 3; 1009 1027 const int axis3 = (axis + 2) % 3; … … 1019 1037 //Debug << pFront << " " << pBack << " " << pOverall << endl; 1020 1038 1021 // float sum = raysBack*(position - minBox) + raysFront*(maxBox - position);1022 1039 const float newCost = pvsBack * pBack + pvsFront * pFront; 1023 // float oldCost = leaf->mRays.size();1024 1040 const float oldCost = (float)pvsSize * pOverall; 1025 1041 … … 1094 1110 int axis; 1095 1111 BspNodeGeometry *fGeom, *bGeom; 1096 float fArea, bArea;1112 float pFront, pBack; 1097 1113 1098 1114 candidateCost = SelectAxisAlignedPlane(plane, data, axis, 1099 1115 &fGeom, &bGeom, 1100 fArea, bArea,1116 pFront, pBack, 1101 1117 onlyAxisAligned); 1102 1118 … … 1109 1125 // we can do this because we always save the 1110 1126 // computed values from the axis aligned splits 1127 1111 1128 frontData.mGeometry = fGeom; 1112 1129 backData.mGeometry = bGeom; 1113 frontData.mArea = fArea; 1114 backData.mArea = bArea; 1115 1130 1131 frontData.mProbability = pFront; 1132 backData.mProbability = pBack; 1133 1116 1134 //! error also computed if cost ratio is missed 1117 1135 ++ mStat.splits[axis]; … … 1220 1238 BspNodeGeometry &geomFront, 1221 1239 BspNodeGeometry &geomBack, 1222 float & areaFront,1223 float & areaBack) const1240 float &pFront, 1241 float &pBack) const 1224 1242 { 1225 1243 float cost = 0; … … 1233 1251 // probability that view point lies in back / front node 1234 1252 float pOverall = 0; 1235 floatpFront = 0;1236 floatpBack = 0;1253 pFront = 0; 1254 pBack = 0; 1237 1255 1238 1256 int raysFront = 0; … … 1290 1308 1291 1309 const float raysSize = (float)data.mRays->size() + Limits::Small; 1310 1292 1311 if (mSplitPlaneStrategy & PVS) 1293 1312 { … … 1295 1314 GenerateUniqueIdsForPvs(); 1296 1315 1297 if (mPvsUseArea) // use front and back cell areas to approximate volume 1298 { 1299 // construct child geometry with regard to the candidate split plane 1300 data.mGeometry->SplitGeometry(geomFront, 1301 geomBack, 1302 candidatePlane, 1303 mBox, 1304 mEpsilon); 1305 1306 1316 // construct child geometry with regard to the candidate split plane 1317 data.mGeometry->SplitGeometry(geomFront, 1318 geomBack, 1319 candidatePlane, 1320 mBox, 1321 mEpsilon); 1322 1323 pOverall = data.mProbability; 1324 1325 if (!mUseAreaForPvs) // use front and back cell areas to approximate volume 1326 { 1307 1327 pFront = geomFront.GetVolume(); 1308 pBack = geomBack.GetVolume(); 1309 //areaFront = geomFront.GetArea(); 1310 //areaBack = geomBack.GetArea(); 1311 1312 pOverall = data.mArea; 1313 1314 } 1315 else // use number of rays to approximate volume 1316 { 1317 pOverall = (float)data.mRays->size(); 1318 pFront = (float)raysFront; 1319 pBack = (float)raysBack; 1328 pBack = pOverall - geomFront.GetVolume(); 1329 } 1330 else 1331 { 1332 pFront = geomFront.GetArea(); 1333 pBack = geomBack.GetArea(); 1320 1334 } 1321 1335 } … … 1471 1485 ++ mStat.maxRayContribNodes; 1472 1486 1473 if (data.m Area <= mTermMinArea)1474 ++ mStat.min AreaNodes;1487 if (data.mProbability <= mTermMinProbability) 1488 ++ mStat.minProbabilityNodes; 1475 1489 1476 1490 // accumulate depth to compute average depth … … 1586 1600 1587 1601 1588 void VspBspTree::CollectViewCells(ViewCellContainer &viewCells ) const1602 void VspBspTree::CollectViewCells(ViewCellContainer &viewCells, bool onlyValid) const 1589 1603 { 1590 1604 ViewCell::NewMail(); 1591 CollectViewCells(mRoot, viewCells, true);1605 CollectViewCells(mRoot, onlyValid, viewCells); 1592 1606 } 1593 1607 … … 1602 1616 nodeStack.push(mRoot); 1603 1617 1618 const bool addToUnbounded = false; 1619 1604 1620 while (!nodeStack.empty()) 1605 1621 { … … 1611 1627 BspLeaf *leaf = dynamic_cast<BspLeaf *>(node); 1612 1628 1613 if ( node->TreeValid())1629 if (!addToUnbounded && node->TreeValid()) 1614 1630 { 1615 1631 BspViewCell *viewCell = dynamic_cast<BspLeaf *>(node)->GetViewCell(); 1616 1632 1617 if ( viewCell->GetPvs().GetSize() > mMaxPvs)1633 if (!mViewCellsManager->CheckValid(viewCell)) 1618 1634 { 1619 while (!viewCell->mLeaves.empty()) 1635 vector<BspLeaf *>::const_iterator it, it_end = viewCell->mLeaves.end(); 1636 for (it = viewCell->mLeaves.begin();it != it_end; ++ it) 1620 1637 { 1621 BspLeaf *l = viewCell->mLeaves.back(); 1638 BspLeaf *l = *it; 1639 1622 1640 l->SetTreeValid(false); 1641 PropagateUpValidity(l); 1642 1643 if (addToUnbounded) 1644 l->SetViewCell(GetOrCreateOutOfBoundsCell()); 1645 1623 1646 ++ mStat.invalidLeaves; 1624 PropagateUpValidity(l);1625 1626 l->SetViewCell(GetOrCreateOutOfBoundsCell());1627 viewCell->mLeaves.pop_back();1628 1647 } 1629 1648 1630 mOutOfBoundsCell->GetPvs().AddPvs(viewCell->GetPvs()); 1631 1632 DEL_PTR(viewCell); 1649 // add to unbounded view cell or set to invalid 1650 if (addToUnbounded) 1651 { 1652 GetOrCreateOutOfBoundsCell()->GetPvs().AddPvs(viewCell->GetPvs()); 1653 DEL_PTR(viewCell); 1654 } 1655 else 1656 { 1657 viewCell->SetValid(false); 1658 } 1633 1659 } 1634 1660 } … … 1644 1670 } 1645 1671 1646 void VspBspTree::CollectViewCells(BspNode *root, 1672 1673 void VspBspTree::CollectViewCells(BspNode *root, 1674 bool onlyValid, 1647 1675 ViewCellContainer &viewCells, 1648 1676 bool onlyUnmailed) const … … 1662 1690 if (node->IsLeaf()) 1663 1691 { 1664 if (! mShowInvalidSpace &&node->TreeValid())1692 if (!onlyValid ||node->TreeValid()) 1665 1693 { 1666 1694 ViewCell *viewCell = dynamic_cast<BspLeaf *>(node)->GetViewCell(); … … 2357 2385 { 2358 2386 case -1: 2359 CollectViewCells(node, beam.mViewCells, true);2387 CollectViewCells(node, true, beam.mViewCells, true); 2360 2388 break; 2361 2389 case 0: … … 2427 2455 2428 2456 // set new size of view cell 2429 vc->SetArea(fVc->GetArea() + bVc->GetArea()); 2430 2457 if (mUseAreaForPvs) 2458 vc->SetArea(fVc->GetArea() + bVc->GetArea()); 2459 else 2460 vc->SetVolume(fVc->GetVolume() + bVc->GetVolume()); 2461 2431 2462 vector<BspLeaf *> fLeaves = fVc->mLeaves; 2432 2463 vector<BspLeaf *> bLeaves = bVc->mLeaves; … … 2480 2511 2481 2512 BspMergeCandidate::sOverallCost += 2482 leaf->m Area* leaf->mPvs->GetSize();2513 leaf->mProbability * leaf->mPvs->GetSize(); 2483 2514 2484 2515 // the same leaves must not be part of two merge candidates … … 2510 2541 vector<BspRay *> bspRays; 2511 2542 2543 ViewCell::NewMail(); 2512 2544 long startTime = GetTime(); 2513 2545 ConstructBspRays(bspRays, rays); … … 2525 2557 { 2526 2558 BspRay *ray = bspRays[i]; 2527 2559 2528 2560 // traverse leaves stored in the rays and compare and 2529 2561 // merge consecutive leaves (i.e., the neighbors in the tree) … … 2541 2573 2542 2574 BspMergeCandidate::sOverallCost += 2543 leaf->m Area* leaf->mPvs->GetSize();2575 leaf->mProbability * leaf->mPvs->GetSize(); 2544 2576 2545 2577 ++ numLeaves; … … 2566 2598 2567 2599 BspMergeCandidate::sOverallCost += 2568 leaf->m Area* leaf->mPvs->GetSize();2600 leaf->mProbability * leaf->mPvs->GetSize(); 2569 2601 2570 2602 ++ numLeaves; … … 2585 2617 found = true; // already in queue 2586 2618 } 2587 2619 2588 2620 if (!found) 2589 2621 { … … 2595 2627 leaf->Mail(); 2596 2628 prevLeaf->Mail(); 2597 2629 2598 2630 mMergeQueue.push(BspMergeCandidate(leaf, prevLeaf)); 2599 2631 } … … 2611 2643 { 2612 2644 vector<BspLeaf *> leaves; 2613 CollectLeaves(leaves, true , mMaxPvs);2645 CollectLeaves(leaves, true); 2614 2646 Debug << "found " << (int)leaves.size() << " new leaves" << endl << endl; 2615 2647 CollectMergeCandidates(leaves); … … 2652 2684 //NOTE: not sorted! 2653 2685 for (it = vc->mLeaves.begin(); it != it_end; ++ it) 2686 { 2654 2687 ray->intersections.push_back(BspIntersection(0, *it)); 2688 } 2655 2689 } 2656 2690 … … 2660 2694 2661 2695 2662 int VspBspTree::MergeViewCells(const VssRayContainer &rays) 2663 { 2664 BspMergeCandidate::sMaxPvsSize = mMaxPvs; 2696 int VspBspTree::MergeViewCells(const VssRayContainer &rays, const ObjectContainer &objects) 2697 { 2698 BspMergeCandidate::sMaxPvsSize = mViewCellsManager->GetMaxPvsSize(); 2699 BspMergeCandidate::sUseArea = mUseAreaForPvs; 2665 2700 2666 2701 MergeStatistics mergeStats; … … 2685 2720 2686 2721 int nViewCells = mStat.Leaves() - mStat.invalidLeaves; 2722 int pass = 0; 2723 const int nextPass = 200; 2687 2724 2688 2725 //-- use priority queue to merge leaf pairs … … 2704 2741 { 2705 2742 ViewCell::NewMail(); 2706 2743 const float mergeCost = mc.GetMergeCost(); 2744 2707 2745 MergeViewCells(mc.GetLeaf1(), mc.GetLeaf2()); 2708 2746 -- nViewCells; 2709 2747 2710 ++ mergeStats.merged;2711 2748 2712 2749 // increase absolute merge cost 2713 2750 BspMergeCandidate::sOverallCost += mc.GetMergeCost(); 2751 2752 2714 2753 2715 2754 if (showMergeStats) … … 2723 2762 mergeStats.maxTreeDist = dist; 2724 2763 mergeStats.accTreeDist += dist; 2764 2765 2766 if ((mergeStats.merged % nextPass == 0) || (nViewCells == mMergeMinViewCells)) 2767 { 2768 mStats 2769 << "#Pass\n" << pass ++ << endl 2770 << "#Merged\n" << mergeStats.merged << endl 2771 << "#Viewcells\n" << nViewCells << endl 2772 << "#OverallCost\n" << BspMergeCandidate::sOverallCost << endl 2773 << "#CurrentCost\n" << mergeCost << endl 2774 << "#RelCost\n" << mc.GetMergeCost() / BspMergeCandidate::sOverallCost << endl 2775 << "#CurrentPvs\n" << mc.GetLeaf1()->GetViewCell()->GetPvs().GetSize() << endl; 2776 2777 ViewCellContainer viewCells; 2778 CollectViewCells(mRoot, false, viewCells); 2779 2780 char s[64]; 2781 sprintf(s, "merged_viewcells%07d.x3d", nViewCells); 2782 Exporter *exporter = Exporter::GetExporter(s); 2783 2784 if (exporter) 2785 { 2786 Debug << "vc size " << viewCells.size() << endl; 2787 ViewCellContainer::const_iterator it, it_end = viewCells.end(); 2788 2789 for (it = viewCells.begin(); it != it_end; ++ it) 2790 { 2791 exporter->ExportGeometry(objects); 2792 mViewCellsManager->ExportVcGeometry(exporter, *it); 2793 } 2794 2795 delete exporter; 2796 } 2797 } 2725 2798 } 2799 2726 2800 } 2727 2801 // merge candidate not valid, because one of the leaves was already … … 2740 2814 Debug << mergeStats << endl << endl; 2741 2815 2816 2742 2817 //TODO: should return sample contributions? 2743 2818 return mergeStats.merged; … … 2836 2911 2837 2912 2838 float GetShuffledVcCost(BspLeaf *leaf, BspViewCell *vc1, BspViewCell *vc2 )2913 float GetShuffledVcCost(BspLeaf *leaf, BspViewCell *vc1, BspViewCell *vc2, bool useArea) 2839 2914 { 2840 2915 //const int pvs1 = SubtractedPvsSize(vc1, leaf, *leaf->mPvs); … … 2842 2917 const int pvs2 = AddedPvsSize(vc2->GetPvs(), *leaf->mPvs); 2843 2918 2844 const float area1 = vc1->GetArea() - leaf->mArea; 2845 const float area2 = vc2->GetArea() + leaf->mArea; 2846 2847 const float cost1 = pvs1 * area1; 2848 const float cost2 = pvs2 * area2; 2919 float p1, p2; 2920 2921 if (useArea) 2922 { 2923 p1 = vc1->GetArea() - leaf->mProbability; 2924 p2 = vc2->GetArea() + leaf->mProbability; 2925 } 2926 else 2927 { 2928 p1 = vc1->GetVolume() - leaf->mProbability; 2929 p2 = vc2->GetVolume() + leaf->mProbability; 2930 } 2931 2932 const float cost1 = pvs1 * p1; 2933 const float cost2 = pvs2 * p2; 2849 2934 2850 2935 return cost1 + cost2; … … 2860 2945 vc2->GetPvs().AddPvs(*leaf->mPvs); 2861 2946 2862 vc1->SetArea(vc1->GetArea() - leaf->mArea); 2863 vc2->SetArea(vc2->GetArea() + leaf->mArea); 2947 if (mUseAreaForPvs) 2948 { 2949 vc1->SetArea(vc1->GetArea() - leaf->mProbability); 2950 vc2->SetArea(vc2->GetArea() + leaf->mProbability); 2951 } 2952 else 2953 { 2954 vc1->SetVolume(vc1->GetVolume() - leaf->mProbability); 2955 vc2->SetVolume(vc2->GetVolume() + leaf->mProbability); 2956 } 2864 2957 2865 2958 /// add to second view cell … … 2890 2983 BspViewCell *vc2 = leaf2->GetViewCell(); 2891 2984 2892 const float cost1 = vc1->GetPvs().GetSize() * vc1->GetArea(); 2893 const float cost2 = vc2->GetPvs().GetSize() * vc2->GetArea(); 2985 float cost1; 2986 float cost2; 2987 2988 if (mUseAreaForPvs) 2989 { 2990 cost1 = vc1->GetPvs().GetSize() * vc1->GetArea(); 2991 cost2 = vc2->GetPvs().GetSize() * vc2->GetArea(); 2992 } 2993 else 2994 { 2995 cost1 = vc1->GetPvs().GetSize() * vc1->GetVolume(); 2996 cost2 = vc2->GetPvs().GetSize() * vc2->GetVolume(); 2997 } 2894 2998 2895 2999 const float oldCost = cost1 + cost2; … … 2900 3004 // the view cell should not be empty after the shuffle 2901 3005 if (vc1->mLeaves.size() > 1) 2902 shuffledCost1 = GetShuffledVcCost(leaf1, vc1, vc2 );3006 shuffledCost1 = GetShuffledVcCost(leaf1, vc1, vc2, mUseAreaForPvs); 2903 3007 if (vc2->mLeaves.size() > 1) 2904 shuffledCost2 = GetShuffledVcCost(leaf2, vc2, vc1 );3008 shuffledCost2 = GetShuffledVcCost(leaf2, vc2, vc1, mUseAreaForPvs); 2905 3009 2906 3010 // shuffling unsuccessful … … 2921 3025 return true; 2922 3026 } 3027 2923 3028 2924 3029 bool VspBspTree::ViewPointValid(const Vector3 &viewPoint) const … … 2952 3057 2953 3058 2954 bool VspBspTree::CheckValid(const VspBspTraversalData &data) const2955 {2956 return data.mPvs <= mMaxPvs;2957 }2958 2959 2960 3059 void VspBspTree::PropagateUpValidity(BspNode *node) 2961 3060 { … … 3019 3118 } 3020 3119 3120 3021 3121 float BspMergeCandidate::GetCost(ViewCell *vc) const 3022 3122 { 3023 return vc->GetPvs().GetSize() * vc->GetArea(); 3024 } 3123 if (sUseArea) 3124 return vc->GetPvs().GetSize() * vc->GetArea(); 3125 3126 return vc->GetPvs().GetSize() * vc->GetVolume(); 3127 } 3128 3025 3129 3026 3130 float BspMergeCandidate::GetLeaf1Cost() const … … 3030 3134 } 3031 3135 3136 3032 3137 float BspMergeCandidate::GetLeaf2Cost() const 3033 3138 { … … 3035 3140 return GetCost(vc); 3036 3141 } 3142 3037 3143 3038 3144 void BspMergeCandidate::EvalMergeCost() … … 3050 3156 const float oldCost = GetLeaf1Cost() + GetLeaf2Cost(); 3051 3157 3052 const float newCost = 3053 (float)newPvs * (vc1->GetArea() + vc2->GetArea()); 3158 const float newCost = sUseArea ? 3159 (float)newPvs * (vc1->GetArea() + vc2->GetArea()) : 3160 (float)newPvs * (vc1->GetVolume() + vc2->GetVolume()); 3161 3054 3162 3055 3163 if (newPvs > sMaxPvsSize) // strong penalty if pvs size too large -
trunk/VUT/GtpVisibilityPreprocessor/src/VspBspTree.h
r544 r547 52 52 /// rays piercing this node 53 53 RayInfoContainer *mRays; 54 /// area of current node55 float m Area;54 /// the probability that this node contains view point 55 float mProbability; 56 56 /// geometry of node as induced by planes 57 57 BspNodeGeometry *mGeometry; … … 77 77 mRays(NULL), 78 78 mPvs(0), 79 m Area(0.0),79 mProbability(0.0), 80 80 mGeometry(NULL), 81 81 mMaxCostMisses(0) … … 87 87 const int depth, 88 88 RayInfoContainer *rays, 89 int pvs,90 float area,89 const int pvs, 90 const float p, 91 91 BspNodeGeometry *geom): 92 92 mNode(node), … … 95 95 mRays(rays), 96 96 mPvs(pvs), 97 m Area(area),97 mProbability(p), 98 98 mGeometry(geom), 99 99 mMaxCostMisses(0) … … 109 109 mRays(rays), 110 110 mPvs(0), 111 m Area(0),111 mProbability(0), 112 112 mGeometry(geom), 113 113 mMaxCostMisses(0) … … 119 119 { 120 120 #if 1 121 return mPvs * m Area;121 return mPvs * mProbability; 122 122 #endif 123 123 #if 0 … … 128 128 #endif 129 129 #if 0 130 return m Area* (float)mRays->size();130 return mProbabiliy * (float)mRays->size(); 131 131 #endif 132 132 } … … 190 190 @param viewCells returns the view cells 191 191 */ 192 void CollectViewCells(ViewCellContainer &viewCells ) const;192 void CollectViewCells(ViewCellContainer &viewCells, bool onlyValid) const; 193 193 194 194 /** A ray is cast possible intersecting the tree. … … 250 250 /** Merges view cells according to some cost heuristics. 251 251 */ 252 int MergeViewCells(const VssRayContainer &rays );252 int MergeViewCells(const VssRayContainer &rays, const ObjectContainer &objects); 253 253 254 254 /** Refines view cells using shuffling, i.e., border leaves … … 298 298 299 299 void CollectViewCells(BspNode *root, 300 bool onlyValid, 300 301 ViewCellContainer &viewCells, 301 302 bool onlyUnmailed = false) const; 302 303 303 /** returns maximal valid pvs. 304 */ 305 int GetMaxPvs() { return mMaxPvs;} 306 304 307 305 /** Checks validy of view cells. 308 306 if not valid, sets regions invalid and deletes view cell. … … 339 337 }; 340 338 339 /** faster evaluation of split plane cost for kd axis aligned cells. 340 */ 341 341 float EvalAxisAlignedSplitCost(const VspBspTraversalData &data, 342 342 const AxisAlignedBox3 &box, 343 343 const int axis, 344 const float &position) const; 344 const float &position, 345 float &pFront, 346 float &pBack) const; 345 347 346 348 /** Returns view cell corresponding to … … 409 411 BspNodeGeometry &geomFront, 410 412 BspNodeGeometry &geomBack, 411 float & areaFront,412 float & areaBack) const;413 float &pFront, 414 float &pBack) const; 413 415 414 416 /** Subdivide leaf. … … 464 466 BspNodeGeometry **frontGeom, 465 467 BspNodeGeometry **backGeom, 466 float & frontArea,467 float & backArea,468 bool useKdSplit);468 float &pFront, 469 float &pBack, 470 const bool useKdSplit); 469 471 470 472 /** Sorts split candidates for surface area heuristics for axis aligned splits. … … 482 484 const int &axis, 483 485 float &position); 484 485 /** Evaluates cost ratio for axis aligned splits.486 */487 /*float EvalCostRatio(const VspBspTraversalData &tData,488 const AxisAlignedBox3 &box,489 const int axis,490 const float position,491 int &raysBack,492 int &raysFront,493 int &pvsBack,494 int &pvsFront);*/495 486 496 487 /** Selects an axis aligned split plane. … … 606 597 BspViewCell *vc2) const; 607 598 608 /** 609 Checks if this traversal data corresponds to 610 a valid view space region. 611 */ 612 bool CheckValid(const VspBspTraversalData &data) const; 613 599 614 600 /** Propagates valid flag up the tree. 615 601 */ … … 646 632 /// maximal possible depth 647 633 int mTermMaxDepth; 648 /// mininum area649 float mTermMin Area;634 /// mininum probability 635 float mTermMinProbability; 650 636 /// mininum PVS 651 637 int mTermMinPvs; … … 654 640 /// minimal accumulated ray length 655 641 float mTermMinAccRayLength; 642 643 ofstream mStats; 656 644 657 645 //-- termination criteria for axis aligned split … … 686 674 float mPvsFactor; 687 675 688 /// if area or accumulated ray lenghtshould be used for PVS heuristics689 bool m PvsUseArea;676 /// if area or volume should be used for PVS heuristics 677 bool mUseAreaForPvs; 690 678 /// tolerance for polygon split 691 679 float mEpsilon; … … 719 707 bool mUseRaysForMerge; 720 708 721 /// maximal allowed pvs so that view cell is valid722 int mMaxPvs;723 724 float mMaxPvsRatio;725 726 709 /// View cell corresponding to the space outside the valid view space 727 710 BspViewCell *mOutOfBoundsCell; 728 729 /// if invalid space should be shown730 bool mShowInvalidSpace;731 711 732 712 int mCurrentViewCellsId; … … 797 777 /// overall cost used to normalize cost ratio 798 778 static float sOverallCost; 779 // if area or volume should be used for the merge heuristics 780 static bool sUseArea; 799 781 800 782 /** Evaluates the merge costs of the leaves. -
trunk/VUT/GtpVisibilityPreprocessor/src/X3dExporter.cpp
r540 r547 517 517 { 518 518 Mesh *mesh = new Mesh; 519 // add 6vertices of the box519 // add 8 vertices of the box 520 520 int index = (int)mesh->mVertices.size(); 521 521 for (int i=0; i < 8; i++) { -
trunk/VUT/GtpVisibilityPreprocessor/src/default.env
r535 r547 289 289 maxDepth 30 290 290 minPvs 2 291 #min Area0.0001292 min Area0.000291 #minProbability 0.0001 292 minProbabilty 0.000 293 293 maxRayContribution 0.005 294 294 maxCostRatio 0.9
Note: See TracChangeset
for help on using the changeset viewer.