Index: GTP/trunk/Lib/Vis/Preprocessing/scripts/default.env
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/scripts/default.env	(revision 655)
+++ GTP/trunk/Lib/Vis/Preprocessing/scripts/default.env	(revision 656)
@@ -13,7 +13,7 @@
 #;../data/vienna/vienna-plane.x3d
 #	filename ../data/vienna/viewcells-25-sel.x3d
-	filename ../data/atlanta/atlanta2.x3d
+#	filename ../data/atlanta/atlanta2.x3d
 #	filename ../data/soda/soda.dat
-#	filename ../data/soda/soda5.dat
+	filename ../data/soda/soda5.dat
 }
 
@@ -25,5 +25,5 @@
 	type vss
 #	type rss
-	detectEmptyViewSpace false
+	detectEmptyViewSpace true
 }
 
@@ -332,6 +332,7 @@
 		globalCostMissTolerance 4
 		minGlobalCostRatio      0.0000001
+#		minGlobalCostRatio      0.0001
 		maxViewCells		40000
-		useSplitCostQueue	true
+	
 
 		# used for pvs criterium
@@ -344,4 +345,6 @@
 	}
 	
+	useSplitCostQueue	false
+
 	useCostHeuristics true
 	splitUseOnlyDrivingAxis false
Index: GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellBsp.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellBsp.h	(revision 648)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellBsp.h	(revision 656)
@@ -168,4 +168,5 @@
 	/// accumulated number of rays refs
 	int accumRays;
+	int pvs;
 
 	// Constructor
@@ -193,5 +194,5 @@
 		polys = 0;
 		accumDepth = 0;
-        
+        pvs = 0;
 		maxDepthNodes = 0;
 		minPvsNodes = 0;
Index: GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.cpp	(revision 655)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.cpp	(revision 656)
@@ -415,13 +415,13 @@
 
 // TODO: return memory usage in MB
-float VspBspTree::GetMemUsage(/*const VspBspTraversalQueue &tstack*/) const
-{
-	return
-		(sizeof(VspBspTree) +
-		 (float)mBspStats.Leaves() * sizeof(BspLeaf) + 
-		 // the nodes in the stack is the minimal additional number of leaves
-		 //(float)tstack.size() * sizeof(BspLeaf) +
-		 mBspStats.Interior() * sizeof(BspInterior) +
-		 mBspStats.accumRays * sizeof(RayInfo)) / (1024.0f * 1024.0f);
+float VspBspTree::GetMemUsage() const
+{
+	return (float)
+		 (sizeof(VspBspTree) + 
+		  mBspStats.Leaves() * sizeof(BspLeaf) + 
+		  mCreatedViewCells * sizeof(BspViewCell) +
+		  mBspStats.pvs * sizeof(ObjectPvsData) +
+		  mBspStats.Interior() * sizeof(BspInterior) +
+		  mBspStats.accumRays * sizeof(RayInfo)) / (1024.0f * 1024.0f);
 }
 
@@ -1994,7 +1994,9 @@
 		mBspStats.maxPvs = data.mPvs;
 	
+	mBspStats.pvs += data.mPvs;
+
 	if (data.mDepth < mBspStats.minDepth)
 		mBspStats.minDepth = data.mDepth;
-
+	
 	if (data.mDepth >= mTermMaxDepth)
 		++ mBspStats.maxDepthNodes;
@@ -2019,4 +2021,5 @@
 
 	++ mCreatedViewCells;
+
 #ifdef _DEBUG
 	Debug << "BSP stats: "
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp	(revision 599)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp	(revision 656)
@@ -305,5 +305,5 @@
 
 #if USE_ASCII
-	ifstream samplesIn(fileName, ios::binary);
+	ifstream samplesIn(fileName);
 	if (!samplesIn.is_open())
 		return false;
Index: GTP/trunk/Lib/Vis/shared/scripts/EvalStats/stdafx.h
===================================================================
--- GTP/trunk/Lib/Vis/shared/scripts/EvalStats/stdafx.h	(revision 656)
+++ GTP/trunk/Lib/Vis/shared/scripts/EvalStats/stdafx.h	(revision 656)
@@ -0,0 +1,12 @@
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+
+#include <iostream>
+#include <tchar.h>
+
+// TODO: reference additional headers your program requires here
Index: GTP/trunk/Lib/Vis/shared/scripts/EvalStats/EvalStats.cpp
===================================================================
--- GTP/trunk/Lib/Vis/shared/scripts/EvalStats/EvalStats.cpp	(revision 656)
+++ GTP/trunk/Lib/Vis/shared/scripts/EvalStats/EvalStats.cpp	(revision 656)
@@ -0,0 +1,82 @@
+// EvalStats.cpp : Defines the entry point for the console application.
+//
+#include "stdafx.h"
+
+#include <string>
+#include <vector>
+#include <istream>
+#include <iostream>
+#include <fstream>
+
+
+using namespace std;
+
+bool extractRenderCost(ifstream &file, vector<float> &renderCosts)
+{
+	if (!file.is_open())
+		return false;
+		
+	string buf;
+	bool isRenderCost = false;
+
+	while (!(getline(file, buf)).eof())
+	{
+		if (buf[0] == '#')
+		{
+			char entry[50];	
+
+			sscanf(buf.c_str(), "#%s", entry);
+			
+			if (strcmp(entry, "TotalRenderCost") == 0)
+				isRenderCost = true;
+		}
+		else if (isRenderCost)
+		{
+			float rc;
+			sscanf(buf.c_str(), "%f", &rc);
+			
+			renderCosts.push_back(rc);
+			isRenderCost = false;
+		}
+	}
+
+	return true;
+}
+
+int _tmain(int argc, _TCHAR* argv[])
+{
+	vector<float> renderCosts1;
+	vector<float> renderCosts2;
+	
+	ifstream file1(argv[1]);
+	ifstream file2(argv[2]);
+
+	ofstream statsOut(argv[3]);
+
+	extractRenderCost(file1, renderCosts1);
+	extractRenderCost(file2, renderCosts2);
+
+	//statsOut << "rc1 size: " << (int)renderCosts1.size() << " " << (int)renderCosts2.size() << endl << endl;
+	int n = min((int)renderCosts1.size(), (int)renderCosts2.size());
+	
+	if (argc > 4)
+	{
+		char *endptr = NULL;
+			
+		int limit = strtol(argv[4], &endptr, 10);
+		
+		n = min(n, limit);
+	}
+
+	for (int i = 0; i < n; ++ i)
+	{
+		float costRatio = renderCosts2[i] != 0 ? 
+			renderCosts1[i] / renderCosts2[i] : renderCosts1[i] / 0.0000001f;
+
+		statsOut << "#ViewCells\n" << i + 1 << endl
+				 << "#RenderCostRatio\n" << costRatio * 100.0f << endl;
+	}
+
+	return 0;
+}
+
Index: GTP/trunk/Lib/Vis/shared/scripts/EvalStats/EvalStats.vcproj
===================================================================
--- GTP/trunk/Lib/Vis/shared/scripts/EvalStats/EvalStats.vcproj	(revision 656)
+++ GTP/trunk/Lib/Vis/shared/scripts/EvalStats/EvalStats.vcproj	(revision 656)
@@ -0,0 +1,153 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="EvalStats"
+	ProjectGUID="{935D1BDD-41B0-49F1-A86C-EB49B94DDB20}"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="Debug"
+			IntermediateDirectory="Debug"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="5"
+				UsePrecompiledHeader="3"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				OutputFile="$(OutDir)/EvalStats.exe"
+				LinkIncremental="2"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/EvalStats.pdb"
+				SubSystem="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="Release"
+			IntermediateDirectory="Release"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="4"
+				UsePrecompiledHeader="3"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				OutputFile="$(OutDir)/EvalStats.exe"
+				LinkIncremental="1"
+				GenerateDebugInformation="TRUE"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+			<File
+				RelativePath=".\EvalStats.cpp">
+			</File>
+			<File
+				RelativePath=".\stdafx.cpp">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						UsePrecompiledHeader="1"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						UsePrecompiledHeader="1"/>
+				</FileConfiguration>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+			<File
+				RelativePath=".\stdafx.h">
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+		</Filter>
+		<File
+			RelativePath=".\ReadMe.txt">
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: GTP/trunk/Lib/Vis/shared/scripts/EvalStats/stdafx.cpp
===================================================================
--- GTP/trunk/Lib/Vis/shared/scripts/EvalStats/stdafx.cpp	(revision 656)
+++ GTP/trunk/Lib/Vis/shared/scripts/EvalStats/stdafx.cpp	(revision 656)
@@ -0,0 +1,8 @@
+// stdafx.cpp : source file that includes just the standard includes
+// EvalStats.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
