Changeset 1889 for GTP/trunk/Lib/Vis
- Timestamp:
- 12/13/06 20:36:32 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp
r1845 r1889 284 284 285 285 286 float HierarchyManager::AvgRayContribution(const float pvs, const float rays) const 287 { 288 return (float)pvs / rays; 289 } 290 291 286 292 void HierarchyManager::EvalSubdivisionStats() 287 293 { -
GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.h
r1845 r1889 264 264 Intersectable *GetIntersectable(const VssRay &ray, const bool isTermination) const; 265 265 266 Intersectable *GetIntersectable(Intersectable *obj, 267 const Vector3 &point) const; 266 Intersectable *GetIntersectable(Intersectable *obj, const Vector3 &point) const; 268 267 268 float AvgRayContribution(const float pvs, const float rays) const; 269 269 270 /** Export object space partition bounding boxes. 270 271 */ -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r1888 r1889 1635 1635 void ViewCellsManager::CompressViewCells() 1636 1636 { 1637 if (!(ViewCellsTreeConstructed() && mCompressViewCells)) 1638 return; 1639 1637 1640 //////////// 1638 1641 //-- compression 1639 1640 if (ViewCellsTreeConstructed() && mCompressViewCells) 1641 { 1642 int pvsEntries = mViewCellsTree->CountStoredPvsEntries(mViewCellsTree->GetRoot()); 1643 1644 cout << "number of entries before compress: " << pvsEntries << endl; 1645 Debug << "number of entries before compress: " << pvsEntries << endl; 1646 1647 mViewCellsTree->SetViewCellsStorage(ViewCellsTree::COMPRESSED); 1648 1649 pvsEntries = mViewCellsTree->CountStoredPvsEntries(mViewCellsTree->GetRoot()); 1650 1651 Debug << "number of entries after compress: " << pvsEntries << endl; 1652 cout << "number of entries after compress: " << pvsEntries << endl; 1653 } 1642 1643 int pvsEntries = mViewCellsTree->CountStoredPvsEntries(mViewCellsTree->GetRoot()); 1644 1645 cout << "number of entries before compress: " << pvsEntries << endl; 1646 Debug << "number of entries before compress: " << pvsEntries << endl; 1647 1648 mViewCellsTree->SetViewCellsStorage(ViewCellsTree::COMPRESSED); 1649 1650 pvsEntries = mViewCellsTree->CountStoredPvsEntries(mViewCellsTree->GetRoot()); 1651 1652 Debug << "number of entries after compress: " << pvsEntries << endl; 1653 cout << "number of entries after compress: " << pvsEntries << endl; 1654 1654 } 1655 1655 … … 5855 5855 viewCell->SetArea(area); 5856 5856 } 5857 5858 5859 5857 5860 5858 … … 5865 5863 5866 5864 5865 static void PrintCompressionStats(HierarchyManager *hm, const int pvsEntries) 5866 { 5867 float mem = (float)pvsEntries * ObjectPvs::GetEntrySize(); 5868 5869 float fullmem = mem + 5870 (hm->GetVspTree()->GetStatistics().Leaves() * 16 + 5871 hm->mBvHierarchy->GetStatistics().Leaves() * 16) / float(1024 * 1024); 5872 5873 cout << "entries: " << pvsEntries << ", mem=" << mem << ", fullmem=" << fullmem <<endl; 5874 Debug << "entries: " << pvsEntries << ", mem=" << mem << ", fullmem=" << fullmem <<endl; 5875 } 5876 5877 5867 5878 void VspOspViewCellsManager::CompressViewCells() 5868 5879 { 5869 if (!mCompressObjects) 5870 { 5871 cout << "compressing in the view space" << endl; 5872 Debug << "compressing in the view space" << endl; 5873 ViewCellsManager::CompressViewCells(); 5880 if (!(ViewCellsTreeConstructed() && mCompressViewCells)) 5874 5881 return; 5875 }5876 5882 5877 5883 //////////// 5878 5884 //-- compression 5879 5885 5880 if (ViewCellsTreeConstructed() && mCompressViewCells) 5881 { 5882 int pvsEntries = mViewCellsTree->CountStoredPvsEntries(mViewCellsTree->GetRoot()); 5883 5884 cout << "compressing in the objects" << endl; 5885 Debug << "compressing in the objects" << endl; 5886 float mem = (float)pvsEntries * ObjectPvs::GetEntrySize(); 5887 5888 cout << "number of entries before compress: " << pvsEntries << ", mem=" << mem << endl; 5889 Debug << "number of entries before compress: " << pvsEntries << ", mem=" << mem << endl; 5886 int pvsEntries = mViewCellsTree->CountStoredPvsEntries(mViewCellsTree->GetRoot()); 5887 5888 cout << "before compression: " << endl; 5889 Debug << "before compression: " << endl; 5890 5891 PrintCompressionStats(mHierarchyManager, pvsEntries); 5892 5893 if (mCompressObjects) 5894 { 5895 cout << "compressing in the objects: " << endl; 5896 Debug << "compressing in the objects: " << endl; 5890 5897 5891 5898 pvsEntries = mHierarchyManager->CompressObjectSpace(); 5892 mem = (float)pvsEntries * ObjectPvs::GetEntrySize(); 5893 5894 Debug << "number of entries after compress: " << pvsEntries << ", mem=" << mem << endl; 5895 cout << "number of entries after compress: " << pvsEntries << ", mem=" << mem << endl; 5896 } 5899 } 5900 else 5901 { 5902 cout << "compressing in the view space: " << endl; 5903 Debug << "compressing in the view space: " << endl; 5904 5905 mViewCellsTree->SetViewCellsStorage(ViewCellsTree::COMPRESSED); 5906 pvsEntries = mViewCellsTree->CountStoredPvsEntries(mViewCellsTree->GetRoot()); 5907 } 5908 5909 PrintCompressionStats(mHierarchyManager, pvsEntries); 5897 5910 } 5898 5911 … … 5912 5925 return vm; 5913 5926 } 5927 5914 5928 5915 5929 void
Note: See TracChangeset
for help on using the changeset viewer.