Index: /GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp	(revision 2606)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp	(revision 2647)
@@ -1692,10 +1692,10 @@
 	RegisterOption("ViewCells.importRandomViewCells",
 				   optBool, 
-				   "view_cells_import_random_viewcells=", 
+				   "view_cells_import_random_viewcells", 
 				   "false");
 
 	RegisterOption("ViewCells.exportRandomViewCells",
 				   optBool, 
-				   "view_cells_export_random_viewcells=", 
+				   "view_cells_export_random_viewcells", 
 				   "false");
 
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp	(revision 2645)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp	(revision 2647)
@@ -1554,5 +1554,5 @@
 		  viewPoints.push_back(*rit);
 	  }
-
+	  
 	  if (viewPoints.size() != renderer->mPvsErrorBuffer.size()) {
 		renderer->mPvsErrorBuffer.resize(viewPoints.size());
@@ -1563,5 +1563,5 @@
 	} else
 	  renderer->EvalPvsStat();
-
+	
 	mStats <<
 	  "#AvgPvsRenderError\n" <<renderer->mPvsStat.GetAvgError()<<endl<<
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/default.env
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/default.env	(revision 2638)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/default.env	(revision 2647)
@@ -554,7 +554,7 @@
 Preprocessor {
   # internal
-  #rayCastMethod 0
+  # rayCastMethod 0
   # Intel
-  #rayCastMethod 1
+  rayCastMethod 1
   # Havran - 2 - static scene
   # rayCastMethod 2
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/RandomViewCellsHandler.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/RandomViewCellsHandler.cpp	(revision 2598)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/RandomViewCellsHandler.cpp	(revision 2647)
@@ -214,6 +214,7 @@
 {
 	// export ten view cells with 100 random view points inside each
-	const int numViewCells = 100;
-	const int numViewPoints = 10;
+  const int numViewCells = 100;
+  //  const int numViewPoints = 10;
+  const int numViewPoints = 100;
 
 	GenerateRandomViewCells(mViewCellPointsList, numViewCells, numViewPoints);
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp	(revision 2643)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp	(revision 2647)
@@ -138,4 +138,5 @@
 												 mPvsStatFrames);
 	
+	Debug<<"Info: will evaluate pixel error with "<<mPvsStatFrames<<" samples"<<endl;
 	
 	mPvsErrorBuffer.resize(mPvsStatFrames);
@@ -1571,4 +1572,36 @@
   
   glFinish();
+
+  static bool first = true;
+  if (first) {
+	
+
+	bool exportRandomViewCells;
+	Environment::GetSingleton()->GetBoolValue("ViewCells.exportRandomViewCells",
+											  exportRandomViewCells);
+	
+	if (0 && exportRandomViewCells)
+	  {
+		char buff[512];
+		Environment::GetSingleton()->GetStringValue("Scene.filename", buff);
+		string filename(buff);
+
+		string viewCellPointsFile;
+		
+		if (strstr(filename.c_str(), ".obj"))
+		  viewCellPointsFile = ReplaceSuffix(filename, ".obj", ".vc");
+		else if (strstr(filename.c_str(), ".dat"))
+		  viewCellPointsFile = ReplaceSuffix(filename, ".dat", ".vc");
+		else if (strstr(filename.c_str(), ".x3d"))
+		  viewCellPointsFile = ReplaceSuffix(filename, ".x3d", ".vc");
+		
+		
+		cout << "exporting random view cells" << endl;
+		preprocessor->mViewCellsManager->ExportRandomViewCells(viewCellPointsFile);
+		cout << "finished" << endl;
+	  }
+	first = false;
+  }
+
   cout<<endl<<flush;
 }
@@ -1630,4 +1663,6 @@
   
   glFinish();
+
+  
   cout << endl << flush;
 }
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp	(revision 2643)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp	(revision 2647)
@@ -321,6 +321,17 @@
 								 preprocessor->mKdTree);
 		
+	}
+
+	bool exportRandomViewCells;
+	Environment::GetSingleton()->GetBoolValue("ViewCells.exportRandomViewCells",
+											  exportRandomViewCells);
+	
+	if (exportRandomViewCells)
+	  {
+		cout << "exporting random view cells" << endl;
+		preprocessor->mViewCellsManager->ExportRandomViewCells(viewCellPointsFile);
+		cout << "finished" << endl;
 	  }
-	
+
 	if (preprocessor->mUseGlRenderer || preprocessor->mUseGlDebugger)
 	{
@@ -366,14 +377,4 @@
 		}
 
-		bool exportRandomViewCells;
-		Environment::GetSingleton()->GetBoolValue("ViewCells.exportRandomViewCells",
-			exportRandomViewCells);
-
-		if (exportRandomViewCells)
-		{
-			cout << "exporting random view cells" << endl;
-			preprocessor->mViewCellsManager->ExportRandomViewCells(viewCellPointsFile);
-			cout << "finished" << endl;
-		}
 
 		/*bool evaluatePixelError;
