Index: /GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.h
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.h	(revision 1845)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.h	(revision 1889)
@@ -264,7 +264,8 @@
 	Intersectable *GetIntersectable(const VssRay &ray, const bool isTermination) const;
   
-  Intersectable *GetIntersectable(Intersectable *obj,
-								  const Vector3 &point) const;
+	Intersectable *GetIntersectable(Intersectable *obj, const Vector3 &point) const;
   
+	float AvgRayContribution(const float pvs, const float rays) const;
+
 	/** Export object space partition bounding boxes.
 	*/
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp	(revision 1888)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp	(revision 1889)
@@ -1635,21 +1635,21 @@
 void ViewCellsManager::CompressViewCells()
 {
+	if (!(ViewCellsTreeConstructed() && mCompressViewCells))
+		return;
+
 	////////////
 	//-- compression
-
-	if (ViewCellsTreeConstructed() && mCompressViewCells)
-	{
-		int pvsEntries = mViewCellsTree->CountStoredPvsEntries(mViewCellsTree->GetRoot());
-		
-		cout << "number of entries before compress: " << pvsEntries << endl;
-		Debug << "number of entries before compress: " << pvsEntries << endl;
-
-		mViewCellsTree->SetViewCellsStorage(ViewCellsTree::COMPRESSED);
-
-		pvsEntries = mViewCellsTree->CountStoredPvsEntries(mViewCellsTree->GetRoot());
-		
-		Debug << "number of entries after compress: " << pvsEntries << endl;
-		cout << "number of entries after compress: " << pvsEntries << endl;
-	}
+	
+	int pvsEntries = mViewCellsTree->CountStoredPvsEntries(mViewCellsTree->GetRoot());
+
+	cout << "number of entries before compress: " << pvsEntries << endl;
+	Debug << "number of entries before compress: " << pvsEntries << endl;
+
+	mViewCellsTree->SetViewCellsStorage(ViewCellsTree::COMPRESSED);
+
+	pvsEntries = mViewCellsTree->CountStoredPvsEntries(mViewCellsTree->GetRoot());
+
+	Debug << "number of entries after compress: " << pvsEntries << endl;
+	cout << "number of entries after compress: " << pvsEntries << endl;
 }
 
@@ -5855,6 +5855,4 @@
 	viewCell->SetArea(area);
 }
-	
-
 
 
@@ -5865,34 +5863,49 @@
 
 
+static void PrintCompressionStats(HierarchyManager *hm, const int pvsEntries)
+{
+	float mem = (float)pvsEntries * ObjectPvs::GetEntrySize();
+		
+	float fullmem = mem + 
+			(hm->GetVspTree()->GetStatistics().Leaves() * 16 + 
+			 hm->mBvHierarchy->GetStatistics().Leaves() * 16) / float(1024 * 1024);
+
+	cout << "entries: " << pvsEntries << ", mem=" << mem << ", fullmem=" << fullmem <<endl;
+	Debug << "entries: " << pvsEntries << ", mem=" << mem << ", fullmem=" << fullmem <<endl;
+}
+
+
 void VspOspViewCellsManager::CompressViewCells()
 {
-	if (!mCompressObjects)
-	{
-		cout << "compressing in the view space" << endl;
-		Debug << "compressing in the view space" << endl;
-		ViewCellsManager::CompressViewCells();
+	if (!(ViewCellsTreeConstructed() && mCompressViewCells))
 		return;
-	}
 
 	////////////
 	//-- compression
 
-	if (ViewCellsTreeConstructed() && mCompressViewCells)
-	{
-		int pvsEntries = mViewCellsTree->CountStoredPvsEntries(mViewCellsTree->GetRoot());
-		
-		cout << "compressing in the objects" << endl;
-		Debug << "compressing in the objects" << endl;
-		float mem = (float)pvsEntries * ObjectPvs::GetEntrySize();
-
-		cout << "number of entries before compress: " << pvsEntries << ", mem=" << mem << endl;
-		Debug << "number of entries before compress: " << pvsEntries << ", mem=" << mem << endl;
+	int pvsEntries = mViewCellsTree->CountStoredPvsEntries(mViewCellsTree->GetRoot());
+
+	cout << "before compression: " << endl;
+	Debug << "before compression: " << endl;
+	
+	PrintCompressionStats(mHierarchyManager, pvsEntries);
+
+	if (mCompressObjects)
+	{
+		cout << "compressing in the objects: " << endl;
+		Debug << "compressing in the objects: " << endl;
 
 		pvsEntries = mHierarchyManager->CompressObjectSpace();
-		mem = (float)pvsEntries * ObjectPvs::GetEntrySize();
-
-		Debug << "number of entries after compress: " << pvsEntries << ", mem=" << mem << endl;
-		cout << "number of entries after compress: " << pvsEntries << ", mem=" << mem << endl;
-	}
+	}
+	else
+	{
+		cout << "compressing in the view space: " << endl;
+		Debug << "compressing in the view space: " << endl;
+
+		mViewCellsTree->SetViewCellsStorage(ViewCellsTree::COMPRESSED);
+		pvsEntries = mViewCellsTree->CountStoredPvsEntries(mViewCellsTree->GetRoot());
+	}
+
+	PrintCompressionStats(mHierarchyManager, pvsEntries);
 }
 
@@ -5912,4 +5925,5 @@
 	return vm;
 }
+
 
 void
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp	(revision 1845)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp	(revision 1889)
@@ -284,4 +284,10 @@
 
 
+float HierarchyManager::AvgRayContribution(const float pvs, const float rays) const
+{
+	return (float)pvs / rays;
+}
+
+
 void HierarchyManager::EvalSubdivisionStats()
 {
