Index: /GTP/trunk/Lib/Vis/Preprocessing/src/Mutation.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/Mutation.cpp	(revision 2353)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/Mutation.cpp	(revision 2574)
@@ -447,5 +447,5 @@
 
 #else
-cerr << "warning: reverse mutation not supported!" << endl;
+  cerr << "warning: reverse mutation not supported!" << endl;
 #endif
   
@@ -633,8 +633,8 @@
 	mRays[index].mMutations++;
 	mRays[index].mUnsuccessfulMutations++;
-
+	
 	return true;
   }
-  
+
   return GenerateMutation(index, sray);
 }
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/run_test2
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/run_test2	(revision 2515)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/run_test2	(revision 2574)
@@ -3,5 +3,5 @@
 
 #COMMAND="./release/preprocessor.exe -preprocessor_quit_on_finish+"
-COMMAND="../scripts/preprocessor.sh -preprocessor_quit_on_finish+ -preprocessor_use_gl_renderer+ -preprocessor_evaluate_filter- -samples_per_evaluation=5000000 -samples_per_pass=1000000 -total_samples=100000000"
+COMMAND="../scripts/preprocessor.sh -preprocessor_quit_on_finish+ -preprocessor_use_gl_renderer- -preprocessor_evaluate_filter- -samples_per_evaluation=5000000 -samples_per_pass=500000 -total_samples=6000000"
 
 
@@ -29,8 +29,11 @@
 #VIEWCELLS=../data/test1/test-viewcells.xml
 
+SCENE=../data/Arena/arena-high-lods.obj
+VIEWCELLS=../data/Arena/viewcells-5000.xml.gz
 
-SCENE=../data/vienna/vienna_cropped.obj
-VIEWCELLS=../data/vienna/vienna_cropped-gradient-viewcells.xml.gz
-#VIEWCELLS=../data/vienna/vienna-seq-viewcells-20000.xml.gz
+
+#SCENE=../data/vienna/vienna_cropped.obj
+#VIEWCELLS=../data/vienna/vienna_cropped-gradient-viewcells.xml.gz
+#VIEWCELLS=../data/vienna/vienna-sequential-30000-single-viewcell.xml
 
 
@@ -45,8 +48,9 @@
 
 $COMMAND -preprocessor=combined -scene_filename=$SCENE -view_cells_filename=$VIEWCELLS \
--rss_distributions=mutation+object_direction+spatial \
--view_cells_use_kd_pvs+ -af_use_kd_pvs+ \
+-rss_distributions=direction+spatial+mutation \
+-view_cells_use_kd_pvs+ -af_use_kd_pvs+ -view_cells_filter_width=1.0 \
 -preprocessor_visibility_file=$PREFIX-i-mixed-b1-n4a.xml \
 -preprocessor_stats=$PREFIX-i-mixed-b1-n4a.log \
 -preprocessor_histogram_file=$PREFIX-i-mixed-b1-n4a.hlog
 
+#-rss_distributions=mutation+object_direction+spatial \
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h	(revision 2571)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h	(revision 2574)
@@ -575,5 +575,6 @@
 									 const float filterSize,
 									 ObjectPvs &pvs,
-									 vector<AxisAlignedBox3> *filteredBoxes = NULL);
+									 vector<AxisAlignedBox3> *filteredBoxes = NULL,
+									 const bool onlyNewObjects = false);
 
 	void ApplySpatialFilter(KdTree *kdTree,
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp	(revision 2572)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp	(revision 2574)
@@ -54,5 +54,6 @@
 mThread(NULL),
 mGlobalLinesRenderer(NULL),
-mUseHwGlobalLines(false)
+mUseHwGlobalLines(false),
+mTotalRaysCast(0)
 {
 	Environment::GetSingleton()->GetBoolValue("Preprocessor.useGlRenderer", mUseGlRenderer);
@@ -1232,5 +1233,5 @@
 #endif
 	}
-
+	cerr<<"Deternmining PVS objects"<<endl;
 	DeterminePvsObjects(vssRays);
 }
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/default.env
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/default.env	(revision 2060)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/default.env	(revision 2574)
@@ -106,5 +106,5 @@
 #	distributions rss+spatial+object_direction
 #	distributions rss+object_direction+spatial+object+direction
-	distributions mutation+spatial+object_direction
+	distributions mutation+spatial+object_direction+filter_based
 #	distributions rss+object_direction
 #	distributions object_direction
@@ -182,4 +182,5 @@
 #	splitMethod SAH
 	splitBorder 0.01
+	pvsArea 1e-3
 }
 
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.h
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.h	(revision 2342)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.h	(revision 2574)
@@ -261,4 +261,6 @@
 	int mSamplesPerPass;
 	int mSamplesPerEvaluation;
+  
+  int mTotalRaysCast;
 
 	RayCaster *mRayCaster;
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/IntelRayCaster.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/IntelRayCaster.cpp	(revision 2572)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/IntelRayCaster.cpp	(revision 2574)
@@ -15,7 +15,8 @@
 FILE *fileOut = 0;
 bool saveRays = true;
+  const int saveRaysStart = 3000000;
 int cntSavedRaysFLUSH = 0;
 unsigned long int cntSavedRays = 0;
-const intSavedLIMIT = 1024;
+const int intSavedLIMIT = 1024;
 void
 InitSaving()
@@ -125,5 +126,5 @@
   }
 
-  if (saveRays) {    
+  if (saveRays && preprocessor->mTotalRaysCast > saveRaysStart) {    
     if (castDoubleRay)
 	{
@@ -257,5 +258,5 @@
 #endif
 
-  if (saveRays) {
+  if (saveRays && preprocessor->mTotalRaysCast > saveRaysStart) {
     if (castDoubleRay)
       fprintf(fileOut, "G\n");
@@ -305,5 +306,5 @@
 
 
-    if (saveRays) {
+    if (saveRays && preprocessor->mTotalRaysCast > saveRaysStart) {
       if (castDoubleRay)     
 	fprintf(fileOut, "%d %4.7f %4.7f %4.7f %4.7f %4.7f %4.7f %d %4.7f %d %4.7f\n",
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/Makefile
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/Makefile	(revision 2521)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/Makefile	(revision 2574)
@@ -1,5 +1,5 @@
 #############################################################################
 # Makefile for building: preprocessor
-# Generated by qmake (2.00a) (Qt 4.1.2) on: út 3. VII 21:32:32 2007
+# Generated by qmake (2.00a) (Qt 4.1.2) on: so 22. XII 21:22:31 2007
 # Project:  preprocessor.pro
 # Template: app
@@ -63,5 +63,5 @@
 	$(MAKE) -f $(MAKEFILE).Debug uninstall
 
-Makefile: preprocessor.pro  C:/Qt/4.1.2/mkspecs/win32-msvc.net\qmake.conf C:/Qt/4.1.2/mkspecs/qconfig.pri \
+Makefile: preprocessor.pro  C:/Qt/4.1.2/mkspecs/win32-msvc2005\qmake.conf C:/Qt/4.1.2/mkspecs/qconfig.pri \
 		C:\Qt\4.1.2\mkspecs\features\qt_config.prf \
 		C:\Qt\4.1.2\mkspecs\features\exclusive_builds.prf \
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/CombinedPreprocessor.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/CombinedPreprocessor.cpp	(revision 2066)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/CombinedPreprocessor.cpp	(revision 2574)
@@ -67,5 +67,5 @@
 
   int lastEvaluation = 0;
-  int totalVssRays = 0;
+  //  int totalVssRays = 0;
   mPass = 0;
   
@@ -86,10 +86,15 @@
 	
 	mMixtureDistribution->GenerateSamples(mSamplesPerPass, rays);
-	
+
+	cerr<<"Casting rays..."<<endl;
+	//	bool doubleRays = true;
 	bool doubleRays = true;
 	CastRays(rays, vssRays, doubleRays, pruneInvalidRays);
-	totalVssRays += (int)vssRays.size();
+	mTotalRaysCast += (int)vssRays.size();
+	cerr<<"Done..."<<endl;
 
+	cerr<<"Computing ray contributions..."<<endl;
 	mMixtureDistribution->ComputeContributions(vssRays);
+	cerr<<"Done..."<<endl;
 
 
@@ -114,6 +119,5 @@
 	  Debug<<"done."<<endl<<flush;
 	}
-
-
+	
 	mMixtureDistribution->UpdateDistributions(vssRays);
 	
@@ -125,5 +129,5 @@
 		"#Time\n" << time <<endl<<
 		"#TotalSamples\n" <<i<<endl<<
-		"#RssSamples\n" <<totalVssRays<<endl;
+		"#RssSamples\n" <<mTotalRaysCast<<endl;
 
 	  float last = 0.0f;
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/preprocessor.pro
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/preprocessor.pro	(revision 2148)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/preprocessor.pro	(revision 2574)
@@ -116,5 +116,6 @@
 RenderTexture.cpp Mutation.cpp Timer/RDTSCTimer.cpp \
 Timer/BenchTimer.cpp Timer/merror.cpp \
-Intersectable.cpp TraversalTree.cpp ObjectPvs.cpp ObjectsParser.cpp
+Intersectable.cpp TraversalTree.cpp ObjectPvs.cpp ObjectsParser.cpp \
+FilterBasedDistribution.cpp DifferenceSampling.cpp
 
 
