Index: /GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.cpp	(revision 679)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.cpp	(revision 682)
@@ -154,5 +154,6 @@
 	Debug << "use random axis: " << mUseRandomAxis << endl;
 	Debug << "breath first splits: " << mBreathFirstSplits << endl;
-	
+	Debug << "empty view cells merge: " << mEmptyViewCellsMergeAllowed << endl;
+
 	Debug << "octree: " << mSimulateOctree << endl;
 
@@ -1825,12 +1826,10 @@
 		
 		// clamp because of possible precision issues
-		if (1)
-		{
-			if (!splitSuccessFull || (pFront <= 0) || (pBack <= 0) || 
-				!geomFront.Valid() || !geomBack.Valid())
-			{
-				Debug << "error f: " << pFront << " b: " << pBack << endl;
-				return 999;
-			}
+		if (0 && 
+			(!splitSuccessFull || (pFront <= 0) || (pBack <= 0) || 
+			!geomFront.Valid() || !geomBack.Valid()))
+		{
+			Debug << "error f: " << pFront << " b: " << pBack << endl;
+			return 999;
 		}
 	}
@@ -3388,5 +3387,5 @@
 				// in the tree?
 				if (mEmptyViewCellsMergeAllowed ||
-					(!leaf->GetViewCell()->GetPvs().Empty() && ! (*nit)->GetViewCell()->GetPvs().Empty()) ||
+					!leaf->GetViewCell()->GetPvs().Empty() || !(*nit)->GetViewCell()->GetPvs().Empty() ||
                     leaf->IsSibling(*nit))
 				{
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp	(revision 679)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp	(revision 682)
@@ -1573,9 +1573,4 @@
 					"rays.out");
 
-	RegisterOption("Preprocessor.useGlRenderer",
-					optBool,
-					"useGlRenderer",
-					"false");
-
 	RegisterOption("Preprocessor.loadPolygonsAsMeshes",
 					optBool,
@@ -1588,18 +1583,26 @@
 				   "10000");
 
+	
+	RegisterOption("Preprocessor.useGlRenderer",
+					optBool,
+					"preprocessor_use_gl_renderer=",
+					"false");
+
 	RegisterOption("Preprocessor.useGlDebugger",
 					optBool,
-					"useGlDebugger",
+					"preprocessor_use_gl_debugger=",
 					"false");
 
 	RegisterOption("Preprocessor.detectEmptyViewSpace",
 				   optBool,
-				   "detectEmptyViewSpace",
+				   "preprocessor_detect_empty_viewspace=",
 				   "false");
 	
 	RegisterOption("Preprocessor.quitOnFinish",
 				   optBool,
-				   "quitOnFinish",
+				   "preprocessor_quit_on_finish=",
 				   "true");
+
+
 
 	/**************************************************************************************/
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellBsp.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellBsp.cpp	(revision 681)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellBsp.cpp	(revision 682)
@@ -3023,10 +3023,9 @@
 	// get cross section of new polygon
 	Polygon3 *planePoly = box.CrossSection(splitPlane);
-
+	//Vector3 ndummy = planePoly->GetSupportingPlane().mNormal;
 	// split polygon with all other polygons
 	planePoly = SplitPolygon(planePoly, epsilon);
 
-	bool splitsGeom = (planePoly != NULL)
-
+	bool splitsGeom = (planePoly != NULL);
 
 	//-- new polygon splits all other polygons
@@ -3099,12 +3098,15 @@
 	if (planePoly)
 	{
+		// add polygon with reverse orientation to front cell
+		Plane3 reversePlane(splitPlane);
+		reversePlane.ReverseOrientation();
+
+		//Debug << "poly normal : " << ndummy << " split plane normal " << splitPlane.mNormal << endl;
 		// add polygon with normal pointing into positive half space to back cell
 		back.Add(planePoly, splitPlane);
 		//back.mPolys.push_back(planePoly);
-
-		// add polygon with reverse orientation to front cell
-		Plane3 reversePlane(splitPlane);
-		reversePlane.ReverseOrientation();
-		front.Add(planePoly->CreateReversePolygon(), reversePlane);
+		Polygon3 *reversePoly = planePoly->CreateReversePolygon();
+		front.Add(reversePoly, reversePlane);
+		Debug << "poly normal : " << reversePoly->GetSupportingPlane().mNormal << " split plane normal " << reversePlane.mNormal << endl;
 	}
 
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp	(revision 681)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp	(revision 682)
@@ -3483,17 +3483,24 @@
 			BspNodeGeometry back;
 
-	
 			BspLeaf *leaf = dynamic_cast<BspViewCell *>(*it)->mLeaf;
-
 			mVspBspTree->ConstructGeometry(leaf, geom);
-			
-			geom.SplitGeometry(front,
-							   back,
-							   *clipPlane,
-							   mViewSpaceBox, 
-							   0.0001f);
-
-			if (back.Size() >= 3)
-				exporter->ExportPolygons(back.GetPolys());
+
+			const int cf = Polygon3::ClassifyPlane(geom.GetPolys(), *clipPlane, 0.0005);
+
+			if (cf == Polygon3::BACK_SIDE)
+			{
+				exporter->ExportPolygons(geom.GetPolys());
+			}
+			else if (cf == Polygon3::SPLIT)
+			{
+				geom.SplitGeometry(front,
+								   back,
+								   *clipPlane,
+								   mViewSpaceBox, 
+								   0.0001f);
+	
+				if (back.Size() >= 3)
+					exporter->ExportPolygons(back.GetPolys());
+			}
 		}
 	}
