Index: GTP/trunk/Lib/Vis/Preprocessing/scripts/run_gvs_vps.sh
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/scripts/run_gvs_vps.sh	(revision 2688)
+++ GTP/trunk/Lib/Vis/Preprocessing/scripts/run_gvs_vps.sh	(revision 2689)
@@ -30,11 +30,11 @@
 -scene_filename=$SCENE \
 -preprocessor=gvs \
--preprocessor_use_vbos- \
+-preprocessor_use_vbos+ \
 -gvs_epsilon=0.0001 \
 -gvs_total_samples=1000000 \
 -gvs_samples_per_pass=1000000 \
 -gvs_initial_samples=16 \
--gvs_max_viewcells=20 \
--gvs_min_contribution=50 \
+-gvs_max_viewcells=1 \
+-gvs_min_contribution=100 \
 -gvs_per_viewcell=true \
 -gvs_stats=$LOG_PREFIX-gvsStats.log \
Index: GTP/trunk/Lib/Vis/Preprocessing/scripts/demo1.env
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/scripts/demo1.env	(revision 2686)
+++ GTP/trunk/Lib/Vis/Preprocessing/scripts/demo1.env	(revision 2689)
@@ -170,5 +170,5 @@
 
 KdTree {
-	pvsArea   1e-3
+	pvsArea   1e-4
 	sahUseFaces false
 	Termination {
Index: GTP/trunk/Lib/Vis/Preprocessing/scripts/run_demo_vienna
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/scripts/run_demo_vienna	(revision 2687)
+++ GTP/trunk/Lib/Vis/Preprocessing/scripts/run_demo_vienna	(revision 2689)
@@ -8,6 +8,6 @@
 
 
-SCENE=../data/vienna/vienna_cropped.obj
-#SCENE=../data/vienna/city_full.obj
+#SCENE=../data/vienna/vienna_cropped.obj
+SCENE=../data/vienna/city_full.obj
 
 VIEWCELLS=../data/vienna/vienna_cropped-gradient-viewcells.xml.gz
@@ -36,4 +36,5 @@
 -preprocessor_stats=$PREFIX-i-mixed-b1-n4a.log \
 -preprocessor_detect_empty_viewspace- \
+-preprocessor_use_vbos- \
 -preprocessor_histogram_file=$PREFIX-i-mixed-b1-n4a.hlog \
 -view_cells_random_viewpoint_list=$VIEWPOINTS \
Index: GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp	(revision 2687)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp	(revision 2689)
@@ -257,4 +257,6 @@
 	RenderScene();
 
+	glFlush();
+
 	query->EndQuery();
 	glDisable(GL_STENCIL_TEST); 
@@ -307,4 +309,6 @@
 			// render pvs once
 			RenderPvs(pvs);
+
+			glFlush();
 
 			//mUseForcedColors = false;
Index: GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp	(revision 2687)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp	(revision 2689)
@@ -122,4 +122,7 @@
 		mViewPoint = Vector3(440.295, 196.959, -781.302);
 		mViewDirection = Vector3(-0.0566328, 0, -0.998395);
+
+		mViewPoint = Vector3(680.682, 189.552, -278.177);
+		mViewDirection = Vector3(0.942709, -0, -0.333584);
 	}
 
@@ -138,5 +141,4 @@
 	mUseGlLists = false;
 
-	bool mUseVbos;
 	Environment::GetSingleton()->GetBoolValue("Preprocessor.useVbos", mUseVbos);
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/IntersectableWrapper.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/IntersectableWrapper.cpp	(revision 2615)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/IntersectableWrapper.cpp	(revision 2689)
@@ -210,5 +210,5 @@
 					static_cast<TriangleIntersectable *>(leaf->mObjects[i]);
 				
-				// check if already rendered
+				// check if already accounted for
 				if (!obj->Mailed())
 				{
Index: GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp	(revision 2686)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp	(revision 2689)
@@ -390,5 +390,5 @@
 			//rendererWidget->SetWindowTitle("Global Visualization");
 
-			if (0 && !rendererWidget->GetUseVbos()) // viewer not working with vbo
+			if (1 && !rendererWidget->GetUseVbos()) // viewer not working with vbo
 			{
 				cout << "starting the qt viewer" << endl;
Index: GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.cpp	(revision 2687)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.cpp	(revision 2689)
@@ -951,7 +951,4 @@
 	AxisAlignedBox3 box = mCurrentViewCell->GetMesh()->mBox;
 	
-	//vector<KdLeaf *> leaves;
-	//mKdTree->GetBoxIntersections(box, leaves);
-
 	ObjectContainer kdobjects;
 	mKdTree->CollectKdObjects(box, kdobjects);
@@ -964,8 +961,6 @@
 		KdIntersectable *kdInt = static_cast<KdIntersectable *>(*oit);
 		
-		//mCurrentViewCell->GetPvs().AddSampleDirty(kdInt, 1.0f);
 		mCurrentViewCell->GetPvs().AddSampleDirtyCheck(kdInt, 1.0f);
-
-		mViewCellsManager->UpdateStatsForViewCell(mCurrentViewCell, kdInt);
+		//if (SHOW_QT_VISUALIZATION) mViewCellsManager->UpdateStatsForViewCell(mCurrentViewCell, kdInt);
 
 		myobjects.clear();
@@ -989,5 +984,5 @@
 
 					mTrianglePvs.push_back(triObj);
-					mGenericStats = mTrianglePvs.size();
+					mGenericStats = (int)mTrianglePvs.size();
 				}
 			}			
@@ -1029,5 +1024,4 @@
 		{
 			TriangleIntersectable *triObj = static_cast<TriangleIntersectable *>(*oit);
-             
 			// the triangle itself intersects => add object
 			if (box.Intersects(triObj->GetItem()))
