Index: GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.vcproj
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.vcproj	(revision 1718)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.vcproj	(revision 1723)
@@ -206,5 +206,5 @@
 				Name="VCLinkerTool"
 				AdditionalDependencies="xerces-c_2.lib glew32.lib zdll.lib zziplib.lib devil.lib glut32.lib OpenGL32.Lib glu32.lib Preprocessor.lib RTScene.lib RTWorld.lib QtCore4.lib qtmain.lib QtOpenGL4.lib Qt3Support4.lib QtTest4.lib QtGui4.lib QtGlRenderer.lib"
-				OutputFile="../bin/release/Preprocessor2.exe"
+				OutputFile="../bin/release/Preprocessor.exe"
 				LinkIncremental="1"
 				AdditionalLibraryDirectories="..\src\GL;..\lib\release;..\..\Preprocessing\lib\release;..\..\..\..\..\..\NonGTP\Boost\lib;..\..\..\..\..\..\NonGTP\Xerces\xercesc\lib;..\..\..\..\..\..\NonGTP\Zlib\lib;..\..\..\..\..\..\NonGTP\Devil\lib;..\MultiLevelRayTracing\RTScene\Release;..\MultiLevelRayTracing\RTWorld\Release;&quot;$(QTDIR)\lib&quot;;.\QtGlRenderer\Release"
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp	(revision 1713)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp	(revision 1723)
@@ -1242,10 +1242,5 @@
 	  "vss_store_storedInitialSamples=",
 	  "false");
-   
-   RegisterOption("VssPreprocessor.useViewSpaceBox",
-	  optBool,
-	  "vss_use_viewspace_box=",
-	  "false");   
-   
+  
 
 
@@ -1820,5 +1815,9 @@
 					"false");
 
-
+   RegisterOption("Preprocessor.useViewSpaceBox",
+	  optBool,
+	  "preprocessor_use_viewspace_box=",
+	  "false");   
+   
 	/*************************************************************************/
 	/*             VSS Preprocessor cells related options                    */
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp	(revision 1715)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp	(revision 1723)
@@ -161,4 +161,6 @@
 	Environment::GetSingleton()->GetBoolValue("Preprocessor.exportObj", mExportObj);
 	
+	Environment::GetSingleton()->GetBoolValue("Preprocessor.useViewSpaceBox", mUseViewSpaceBox);
+
 	Debug << "******* Preprocessor Options **********" << endl;
 	Debug << "detect empty view space=" << mDetectEmptyViewSpace << endl;
@@ -166,4 +168,5 @@
 	Debug << "load meshes: " << mLoadMeshes << endl;
 	Debug << "export obj: " << mExportObj << endl;
+	Debug << "use view space box: " << mUseViewSpaceBox << endl;
 }
 
@@ -515,19 +518,7 @@
 		// temp hack
 		//ExportObj("cropped_vienna.obj", mObjects);
-
 		mSceneGraph->GetRoot()->UpdateBox();
 				
 		cout << "finished loading" << endl;
-
-		
-		if (0)
-		{
-			Exporter *exporter = Exporter::GetExporter("testload.x3d");
-			if (exporter)
-			{
-				exporter->ExportGeometry(mObjects);
-				delete exporter;
-			}
-		}
 	}
 
@@ -658,15 +649,22 @@
 
 		// default view space is the extent of the scene
-		AxisAlignedBox3 box = mSceneGraph->GetBox();
-					
-		if (0)
-		{
+		AxisAlignedBox3 viewSpaceBox;
+			
+		if (mUseViewSpaceBox)
+		{
+			viewSpaceBox = mSceneGraph->GetBox();
+
 			// use a small box outside of the scene
-			box.Scale(Vector3(0.1f,0.5f,0.5f));
-			box.Translate(Vector3(Magnitude(mSceneGraph->GetBox().Size())*0.5f, 0, 0));
-		}
-
-		mViewCellsManager->SetViewSpaceBox(box);
-	 
+			viewSpaceBox.Scale(Vector3(0.15f, 0.3f, 0.5f));
+			//viewSpaceBox.Translate(Vector3(Magnitude(mSceneGraph->GetBox().Size()) * 0.5f, 0, 0));
+			viewSpaceBox.Translate(Vector3(Magnitude(mSceneGraph->GetBox().Size()) * 0.3f, 0, 0));
+			mViewCellsManager->SetViewSpaceBox(viewSpaceBox);
+		}
+		else
+		{
+			viewSpaceBox = mSceneGraph->GetBox();
+			mViewCellsManager->SetViewSpaceBox(viewSpaceBox);
+		}
+
 		bool loadVcGeometry;
 		Environment::GetSingleton()->GetBoolValue("ViewCells.loadGeometry", loadVcGeometry);
Index: GTP/trunk/Lib/Vis/Preprocessing/src/RssPreprocessor.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/RssPreprocessor.cpp	(revision 1715)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/RssPreprocessor.cpp	(revision 1723)
@@ -496,5 +496,5 @@
 
 	long time = GetTime();
-	totalTime = TimeDiff(startTime, time)*1e-3;
+	totalTime = TimeDiff(startTime, time)*1e-3f;
 	lastTime = time;
 	
Index: GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.h	(revision 1718)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.h	(revision 1723)
@@ -108,4 +108,54 @@
 
 
+class HierarchySubdivisionStats
+{
+public:
+	    
+	int mNumSplits;
+		
+	float mRenderCostDecrease;
+
+    float mTotalRenderCost;
+    
+	int mEntriesInPvs;
+    
+	float mMemoryCost;
+	
+	float mFullMemory;
+
+	int mViewSpaceSplits;
+
+	int mObjectSpaceSplits;
+
+
+	float VspOspRatio() const { return (float)mViewSpaceSplits / (float)mObjectSpaceSplits; }
+
+	float FpsPerMb() const { return 1.0f / (mTotalRenderCost * mMemoryCost); }
+
+	HierarchySubdivisionStats() { Reset(); }
+
+	void Reset()
+	{
+		mNumSplits = 0;
+		mRenderCostDecrease = 0;
+		mTotalRenderCost = 0;
+		mEntriesInPvs = 0;
+		mMemoryCost = 0;
+		mFullMemory = 0;
+		mViewSpaceSplits = 0;
+		mObjectSpaceSplits = 0;
+	}
+
+
+	void Print(ostream &app) const;
+
+	friend ostream &operator<<(ostream &s, const HierarchySubdivisionStats &stat)
+	{
+		stat.Print(s);
+		return s;
+	}
+};
+
+
 /** This class implements a structure holding two different hierarchies,
 	one for object space partitioning and one for view space partitioning.
Index: GTP/trunk/Lib/Vis/Preprocessing/src/VssPreprocessor.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/VssPreprocessor.cpp	(revision 1705)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/VssPreprocessor.cpp	(revision 1723)
@@ -36,5 +36,4 @@
   Environment::GetSingleton()->GetBoolValue("VssPreprocessor.loadInitialSamples", mLoadInitialSamples);
   Environment::GetSingleton()->GetBoolValue("VssPreprocessor.storeInitialSamples", mStoreInitialSamples);
-  Environment::GetSingleton()->GetBoolValue("VssPreprocessor.useViewSpaceBox", mUseViewSpaceBox);
   Environment::GetSingleton()->GetBoolValue("VssPreprocessor.testBeamSampling", mTestBeamSampling);
   Environment::GetSingleton()->GetBoolValue("VssPreprocessor.enlargeViewSpace", mEnlargeViewSpace);
@@ -376,21 +375,5 @@
 	int totalSamples = 0;
 
-	if (mUseViewSpaceBox)
-	{
-		AxisAlignedBox3 viewSpaceBox;
-		viewSpaceBox.Initialize();
-
-		viewSpaceBox = AxisAlignedBox3(mKdTree->GetBox());
-		AxisAlignedBox3 tbox(mViewCellsManager->GetViewSpaceBox());
-
-		const Vector3 size = tbox.Size();
-		viewSpaceBox.SetMax(0, tbox.Max(0) + size[0] * 0.5f);
-		viewSpaceBox.SetMin(0, tbox.Min(0) + size[0]);
-		 
-		// change the view space of the view cells manager
-		mViewCellsManager->SetViewSpaceBox(viewSpaceBox);
-	}
-
-	mSceneGraph->CollectObjects(&mObjects);
+	//mSceneGraph->CollectObjects(&mObjects);
 
 	if (!mLoadViewCells)
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.h	(revision 1695)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.h	(revision 1723)
@@ -196,10 +196,9 @@
 
 	int mPass;
-  
-  bool mDelayVisibilityComputation;
-  bool mStopComputation;
+ 
+    bool mDelayVisibilityComputation;
+	bool mStopComputation;
   
 	bool mExportObj;
-
 
 protected:
@@ -231,5 +230,6 @@
 	GlRendererBuffer *renderer;
 
-
+	/// if box around view space should be used
+	bool mUseViewSpaceBox;
 };
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp	(revision 1718)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp	(revision 1723)
@@ -844,4 +844,5 @@
 	float minBorder = nodeBbox.Max(axis);
 	float maxBorder = nodeBbox.Min(axis);
+
 	float areaLeft = 0, areaRight = 0;
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/VssPreprocessor.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/VssPreprocessor.h	(revision 1563)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/VssPreprocessor.h	(revision 1723)
@@ -36,6 +36,5 @@
   /// if initial samples should be stored in file
   bool mStoreInitialSamples;
-  /// if box around view space should be used
-  bool mUseViewSpaceBox;
+ 
   // rays cast during the processing
   VssRayContainer mVssRays;
Index: GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp	(revision 1718)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp	(revision 1723)
@@ -42,6 +42,6 @@
 // HACK
 const static bool SAMPLE_AFTER_SUBDIVISION = true;
-//const static bool CLAMP_TO_BOX = false;
-const static bool CLAMP_TO_BOX = true;
+const static bool CLAMP_TO_BOX = false;
+//const static bool CLAMP_TO_BOX = true;
 
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Exporter.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Exporter.cpp	(revision 1707)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Exporter.cpp	(revision 1723)
@@ -234,5 +234,5 @@
 	ObjectContainer::const_iterator oit, oit_end = objects.end();
 
-	if (0&&!exportSingleMesh)
+	if (!exportSingleMesh)
 	{
 		for (oit = objects.begin(); oit != oit_end; ++ oit)
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Pvs.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Pvs.h	(revision 1715)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Pvs.h	(revision 1723)
@@ -422,5 +422,5 @@
 						  const float pdf)
 {
-  mSamples--;
+  -- mSamples;
   
   std::map<T, S, LtSample<T> >::
Index: GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp	(revision 1715)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp	(revision 1723)
@@ -149,5 +149,5 @@
 }
 
-
+#include "ViewCellsManager.h"
 int
 main(int argc, char **argv)
@@ -244,24 +244,23 @@
 		}
 	}
+	
+	
+	// parse view cells related options
+	if (!preprocessor->PrepareViewCells())
+	{
+		Cleanup();
+		exit(1);
+	}
+
 	if (0){
 	Exporter *exporter= Exporter::GetExporter("test1.wrl");
-	AxisAlignedBox3 bbox = preprocessor->mKdTree->GetBox(); 
-	bbox.Scale(Vector3(0.5, 1, 0.5));
+	AxisAlignedBox3 bbox = preprocessor->mViewCellsManager->GetViewSpaceBox(); 
     exporter->SetWireframe();
-	exporter->ExportBox(preprocessor->mKdTree->GetBox());
 	exporter->ExportBox(bbox);
 	exporter->SetFilled();
-	exporter->ExportGeometry(preprocessor->mObjects, true, &bbox);
+	exporter->ExportGeometry(preprocessor->mObjects, true);
 	delete exporter;
 	}
 	
-	
-	// parse view cells related options
-	if (!preprocessor->PrepareViewCells())
-	{
-		Cleanup();
-		exit(1);
-	}
-
 	if (0) 
 	{
Index: GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp	(revision 1719)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp	(revision 1723)
@@ -79,4 +79,21 @@
 
 
+void HierarchySubdivisionStats::Print(ostream &app) const
+{
+	app << "#Pass\n" << 0 << endl
+		<< "#Splits\n" << mNumSplits << endl 
+		<< "#TotalRenderCost\n" << mTotalRenderCost << endl
+		<< "#TotalEntriesInPvs\n" << mEntriesInPvs << endl
+		<< "#Memory\n" << mMemoryCost << endl
+		<< "#StepsView\n" << mViewSpaceSplits << endl
+		<< "#StepsObject\n" << mObjectSpaceSplits << endl
+		<< "#VspOspRatio\n" << VspOspRatio() << endl
+		<< "#FullMem\n" << mFullMemory << endl
+		<< "#RenderCostDecrease\n" << mRenderCostDecrease << endl
+		<< "#FpsPerMb\n" << FpsPerMb() << endl
+		<< endl;
+}
+
+
 void HierarchyManager::ParseEnvironment()
 {
@@ -265,20 +282,18 @@
 {
 	// question: should I also add the mem usage of the hierarchies?
-	const float objectSpaceMem = 0;//GetObjectSpaceMemUsage();
-	const float viewSpaceMem = 0;//mVspTree->GetMemUsage();
-	
-	// calculate cost in MB
-	const float memoryCost = mHierarchyStats.mMemory  / float(1024 * 1024)
-							 + objectSpaceMem + viewSpaceMem;
-
-	//cout << "pvs entries " << mHierarchyStats.pvsEntries << endl;
-	AddSubdivisionStats(mHierarchyStats.Leaves(),
-						mHierarchyStats.mRenderCostDecrease,
-						mHierarchyStats.mTotalCost,
-						mHierarchyStats.mPvsEntries,
-						memoryCost,
-						1.0f / (mHierarchyStats.mTotalCost * memoryCost),
-						(float)mVspTree->mVspStats.Leaves() / (float)GetObjectSpaceSubdivisionLeaves()
-						);
+	const float objectSpaceMem = GetObjectSpaceMemUsage();
+	const float viewSpaceMem = mVspTree->GetMemUsage();
+		
+	HierarchySubdivisionStats stats;
+	stats.mNumSplits = mHierarchyStats.Leaves();
+	stats.mTotalRenderCost = mHierarchyStats.mTotalCost;
+	stats.mEntriesInPvs = mHierarchyStats.mPvsEntries;
+	stats.mMemoryCost = mHierarchyStats.mMemory  / float(1024 * 1024);
+	stats.mFullMemory = mHierarchyStats.mMemory  / float(1024 * 1024)
+						+ objectSpaceMem + viewSpaceMem;
+	stats.mViewSpaceSplits = mVspTree->mVspStats.Leaves();
+	stats.mObjectSpaceSplits = GetObjectSpaceSubdivisionLeaves();
+	
+	stats.Print(mSubdivisionStats);
 }
 
@@ -299,5 +314,6 @@
 			<< "#Memory\n" << memory << endl
 			<< "#FpsPerMb\n" << renderCostPerStorage << endl
-			<< "#VspOspRatio\n" << vspOspRatio << endl;
+			<< "#VspOspRatio\n" << vspOspRatio << endl
+			<< endl;
 }
 
@@ -882,5 +898,6 @@
 
 			cout << "\nstarting object space subdivision after " 
-				 << mVspTree->mVspStats.nodes << " (" << mMinStepsOfSameType << ") " << endl;
+				 << mVspTree->mVspStats.nodes << " (" << mMinStepsOfSameType << ") steps, mem=" 
+				 << mHierarchyStats.mMemory / float(1024 * 1024) << " MB" << endl;
 
 			SubdivisionCandidate *ospSc = PrepareObjectSpaceSubdivision(sampleRays, objects);
@@ -897,7 +914,8 @@
 			mViewSpaceSubdivisionType = mSavedViewSpaceSubdivisionType;
 
-			cout << "\nstarting view space subdivision at depth " 
+			cout << "\nstarting view space subdivision at " 
 				 << GetObjectSpaceSubdivisionLeaves() << " (" 
-				 << mMinStepsOfSameType << ") " << endl;
+				 << mMinStepsOfSameType << ") , mem=" 
+				 << mHierarchyStats.mMemory / float(1024 * 1024) << " MB" << endl;
 
 			SubdivisionCandidate *vspSc = PrepareViewSpaceSubdivision(sampleRays, objects);
@@ -1602,24 +1620,4 @@
 
 
-static void UpdateStats(ofstream &stats,
-						const int splits,
-						const float totalRenderCost,
-						const int entriesInPvs,
-						const float memoryCost,
-						const int viewSpaceSplits,
-						const int objectSpaceSplits)
-{
-	stats << "#Pass\n" << 0 << endl
-		   << "#Splits\n" << splits << endl 
-		   << "#TotalRenderCost\n" << totalRenderCost << endl
-		   << "#TotalEntriesInPvs\n" << entriesInPvs << endl
-		   << "#Memory\n" << memoryCost << endl
-		   << "#ViewSpaceSplits\n" << viewSpaceSplits << endl
-		   << "#ObjectSpaceSplits\n" << objectSpaceSplits << endl
-		   << "#VspOspRatio\n" << (float)viewSpaceSplits / (float)objectSpaceSplits << endl
-		   << endl;
-}
-
-
 class HierarchyNodeWrapper;
 
@@ -1863,17 +1861,21 @@
 								   const ObjectContainer &objects)
 {
-	float totalRenderCost = (float)objects.size();
-	int entriesInPvs = 1;
-	int steps = 0;
-	int viewSpaceSplits = 0;
-	int objectSpaceSplits = 0;
+	HierarchySubdivisionStats subStats;
+	subStats.Reset();
+
+	/////////////
+	//-- initial situation
+
+	subStats.mNumSplits = 0;
+	subStats.mTotalRenderCost = (float)objects.size();
+	subStats.mEntriesInPvs = 1;
+	subStats.mMemoryCost = (float)ObjectPvs::GetEntrySize();
+	subStats.mFullMemory = subStats.mMemoryCost;
+	subStats.mViewSpaceSplits = 0;
+	subStats.mObjectSpaceSplits = 0;
+	
+	subStats.Print(stats);
 
 	cout << "exporting vsposp stats ... " << endl;
-	const float memoryCost = (float)entriesInPvs * (float)ObjectPvs::GetEntrySize();
-
-	/////////////
-	//-- first view cell
-
-	UpdateStats(stats, 2, totalRenderCost, entriesInPvs, memoryCost, viewSpaceSplits, objectSpaceSplits);
 
 	//-- go through tree in the order of render cost decrease
@@ -1898,5 +1900,5 @@
 			
 			isLeaf = newNode->IsLeaf();
-			rcDecr = oldNode->mRenderCostDecr;
+			subStats.mRenderCostDecrease = oldNode->mRenderCostDecr;
 			entriesIncr = oldNode->mPvsEntriesIncr;
 		}
@@ -1909,5 +1911,5 @@
 			
 			isLeaf = newNode->IsLeaf();
-			rcDecr = oldNode->mRenderCostDecr;
+			subStats.mRenderCostDecrease = oldNode->mRenderCostDecr;
 			entriesIncr = oldNode->mPvsEntriesIncr;
 		}		
@@ -1915,25 +1917,29 @@
 		if (!isLeaf)
 		{
-			totalRenderCost -= rcDecr;
-			entriesInPvs += entriesIncr;
+			subStats.mTotalRenderCost -= subStats.mRenderCostDecrease;
+			subStats.mEntriesInPvs += entriesIncr;
+
 			// if (rcDecr <= 0)
 			if (nextCandidate->Type() == SubdivisionCandidate::VIEW_SPACE)
 			{
-				++ viewSpaceSplits;
+				++ subStats.mViewSpaceSplits;
 				cout << "v";//cout << "vsp t: " << timeStamp << " rc: " << rcDecr << " pvs: " << entriesIncr << endl;
 			}
 			else
 			{
-				++ objectSpaceSplits;
+				++ subStats.mObjectSpaceSplits;
 				cout << "o";//"osp t: " << timeStamp << " rc: " << rcDecr << " pvs: " << entriesIncr << endl;
 			}
 
-			++ steps;
-
-			if ((steps % 500) == 499)
-				cout << steps << " steps taken" << endl;
-
-			const float memoryCost = (float)entriesInPvs * (float)ObjectPvs::GetEntrySize();
-			UpdateStats(stats, steps, totalRenderCost, entriesInPvs, memoryCost, viewSpaceSplits, objectSpaceSplits);
+			++ subStats.mNumSplits;
+
+			if ((subStats.mNumSplits % 500) == 499)
+				cout << subStats.mNumSplits << " steps taken" << endl;
+
+			subStats.mMemoryCost = (float)subStats.mEntriesInPvs * (float)ObjectPvs::GetEntrySize();
+			subStats.mFullMemory = subStats.mMemoryCost;
+
+			subStats.Print(stats);
+			
 		}
 
@@ -2023,33 +2029,39 @@
 											const int splitsStepSize)
 {
+	HierarchySubdivisionStats subStats;
+	
 	int splits = 0;
 
-	float renderCost;
-	float memory;
-	int pvsEntries;
-	int viewSpaceSplits;
-	int objectSpaceSplits;
-
 	while (1)
 	{
-		const int numSplits = ExtractStatistics(splits, 
+		subStats.mNumSplits = ExtractStatistics(splits, 
 												99999.0, 
-												renderCost, 
-												memory, 
-												pvsEntries,
-												viewSpaceSplits,
-												objectSpaceSplits);
+												subStats.mTotalRenderCost, 
+												subStats.mMemoryCost, 
+												subStats.mEntriesInPvs,
+												subStats.mViewSpaceSplits,
+												subStats.mObjectSpaceSplits);
+
 		
-		UpdateStats(splitsStats, 
-					numSplits, 
-					renderCost, 
-					pvsEntries, 
-					memory, 
-					viewSpaceSplits, 
-					objectSpaceSplits);
+		const float objectSpaceHierarchyMem = float(
+											  subStats.mObjectSpaceSplits * sizeof(BvhLeaf *) + 
+											  (subStats.mObjectSpaceSplits - 1) * sizeof(BvhInterior *) + 
+											  sizeof(BvHierarchy)
+											  ) / float(1024 * 1024);
+
+			
+		const float viewSpaceHierarchyMem = float(
+											subStats.mViewSpaceSplits * sizeof(VspLeaf *) + 
+											(subStats.mViewSpaceSplits - 1) * sizeof(VspInterior *) + 
+											sizeof(VspTree)
+											)  / float(1024 * 1024);
+
+		subStats.mFullMemory = subStats.mMemoryCost + objectSpaceHierarchyMem + viewSpaceHierarchyMem;
+		
+		subStats.Print(splitsStats);
 
 		splits += splitsStepSize;
 
-		if (numSplits == mHierarchyStats.Leaves())
+		if (subStats.mNumSplits == mHierarchyStats.Leaves())
 			break;
 	}
