Index: /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Pvs.h
===================================================================
--- /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Pvs.h	(revision 3285)
+++ /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Pvs.h	(revision 3287)
@@ -11,5 +11,5 @@
 class Bvh;
 
-#define USE_TIMESTAMPS
+//#define USE_TIMESTAMPS
 
 struct PvsEntry
Index: /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SkyPreetham.cpp
===================================================================
--- /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SkyPreetham.cpp	(revision 3279)
+++ /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SkyPreetham.cpp	(revision 3287)
@@ -296,4 +296,9 @@
 		ambient *= 1e-1f;
 
+	//  could be too blueish ...
+	ambient.x *= 1.3f;
+	ambient.y *= 1.2f;
+	ambient.z = max(max(ambient.z, ambient.x), ambient.y);
+
 	// simulate the sun intensity by modulating the ambient term.
 	ambient *= (10.0f - 9.0f * DotProd(sunDir, Vector3::UNIT_Z()));
Index: /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
===================================================================
--- /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp	(revision 3286)
+++ /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp	(revision 3287)
@@ -386,4 +386,8 @@
 void LoadPompeiiFloor();
 
+void LoadOrUpdatePVSs(const Vector3 &pos);
+
+
+
 float pvsTotalSamples = .0f;
 float pvsTotalTime = .0f;
@@ -1214,4 +1218,5 @@
 	SetupEyeView();
 	
+
 	// set frame related parameters for GPU programs
 	GPUProgramParameters::InitFrame(camera, light);
@@ -1242,15 +1247,6 @@
 	glEnableClientState(GL_VERTEX_ARRAY);
 
-	if (usePvs)
-	{
-		if (!viewCellsTree)	
-		{
-			LoadVisibilitySolution();
-			applicationTimer.Start();
-			shotRays = visibilitySolutionInitialState;
-		}
-
-		if (viewCellsTree) LoadPvs();
-	}
+	if (usePvs) LoadOrUpdatePVSs(camera->GetPosition());
+
 
 	// render with the specified method (forward rendering, forward + depth, deferred)
@@ -1335,4 +1331,6 @@
 		//if (traverser->GetType() == RenderTraverser::CULL_COLLECTOR)
 		//	((PvsCollectionRenderer *)traverser)->SetViewCell(usePvs ? viewCell : NULL);
+
+		//renderState.LockCullFaceEnabled(true);
 
 		// actually render the scene geometry using the specified algorithm
@@ -1805,5 +1803,5 @@
 
 			// hack: load pvs on replay (remove later!)
-			usePvs = true;
+			//usePvs = true;
 		}
 		else
@@ -2534,4 +2532,8 @@
 	renderState.SetUseAlphaToCoverage(false);
 
+	const Vector3 lightPos = light->GetDirection() * -1e3f;
+	if (usePvs) LoadOrUpdatePVSs(lightPos);
+
+
 	// change CHC++ set of renderState variables 
 	// this must be done for each change of camera because
@@ -2671,5 +2673,5 @@
 
 
-void LoadPvs()
+void UpdatePvs(const Vector3 &pos)
 {
 	viewCell = viewCellsTree->GetViewCell(camera->GetPosition());
@@ -2798,2 +2800,15 @@
 	staticObjects.push_back(myplane);
 }
+
+
+void LoadOrUpdatePVSs(const Vector3 &pos)
+{
+	if (!viewCellsTree)	
+	{
+		LoadVisibilitySolution();
+		applicationTimer.Start();
+		shotRays = visibilitySolutionInitialState;
+	}
+
+	if (viewCellsTree) UpdatePvs(pos);
+}
Index: /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.cpp
===================================================================
--- /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.cpp	(revision 3270)
+++ /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.cpp	(revision 3287)
@@ -1358,5 +1358,5 @@
 
 	static char imageName[200];
-	sprintf(imageName, "%s_%05d.bmp", mSavedFrameSuffix.c_str(), mSavedFrameNumber);
+	sprintf(imageName, "%s_%05d.tga", mSavedFrameSuffix.c_str(), mSavedFrameNumber);
 
 	ILstring fileName = ILstring(imageName);
Index: /GTP/trunk/App/Demos/Vis/FriendlyCulling/ps_memory_plot2
===================================================================
--- /GTP/trunk/App/Demos/Vis/FriendlyCulling/ps_memory_plot2	(revision 3276)
+++ /GTP/trunk/App/Demos/Vis/FriendlyCulling/ps_memory_plot2	(revision 3287)
@@ -24,5 +24,6 @@
 #echo set xrange \[4200:4600\] >> $FILE
 #echo set xrange \[100:400\] >> $FILE
-echo set xrange \[1:500\] >> $FILE
+echo set xrange \[1600:2100\] >> $FILE
+#echo set xrange \[3000:3500\] >> $FILE
 #echo set xrange \[1600:2000\] >> $FILE
 # echo set boxwidth 0.4 >> $FILE
Index: /GTP/trunk/App/Demos/Vis/FriendlyCulling/plot_friendly
===================================================================
--- /GTP/trunk/App/Demos/Vis/FriendlyCulling/plot_friendly	(revision 3276)
+++ /GTP/trunk/App/Demos/Vis/FriendlyCulling/plot_friendly	(revision 3287)
@@ -7,5 +7,6 @@
 COMMAND3=./ps_memory_plot3
 
-PREFIX=pp_2
+#PREFIX=pp_2
+PREFIX=myvienna
 
 #FILES="$PREFIX-vfc.log $PREFIX_chc.log $PREFIX-vfc_pvs.log $PREFIX-chc++_b20.log $PREFIX-chc++_pvs_b20.log"
@@ -14,5 +15,6 @@
 #FILES="$PREFIX-chc++.log $PREFIX-chc++_b20.log"
 #FILES="$PREFIX-chc.log $PREFIX-vfc_pvs.log $PREFIX-vfc_pvs_smaller.log $PREFIX-chc++.log $PREFIX-chc++_pvs.log $PREFIX-chc++_pvs_smaller.log"
-FILES="$PREFIX-chc.log $PREFIX-vfc_pvs.log $PREFIX-chc++.log $PREFIX-chc++_pvs.log"
+FILES="$PREFIX-vfc.log $PREFIX-vfc_pvs.log $PREFIX-chc++.log"
+#FILES="$PREFIX-vfc.log $PREFIX-chc++.log $PREFIX-vfc_pvs.log"
 
 echo $FILES
Index: /GTP/trunk/App/Demos/Vis/FriendlyCulling/default.env
===================================================================
--- /GTP/trunk/App/Demos/Vis/FriendlyCulling/default.env	(revision 3286)
+++ /GTP/trunk/App/Demos/Vis/FriendlyCulling/default.env	(revision 3287)
@@ -17,10 +17,10 @@
 filename=city
 bvhname=city
-useLODs=1
+useLODs=0
 # shadow map size
 shadowSize=4096
 # the filenames given to recorded frames (+ number.bmp)
 #recordedFramesSuffix=frames/vienna_frame
-recordedFramesSuffix=frames_100_pgv/vienna_frame
+recordedFramesSuffix=vienna_frame
 #recordedFramesSuffix=frames_50_spgvu/vienna_frame
 # the filename for the statistics
@@ -49,5 +49,6 @@
 
 #visibilitySolutionInitialState=50000000
-visibilitySolutionInitialState=100000000
+#visibilitySolutionInitialState=300000000
+visibilitySolutionInitialState=500000000
 
 
@@ -99,9 +100,9 @@
 ## window options
 
-winWidth=800
-winHeight=600
+#winWidth=800
+#winHeight=600
 
-#winWidth=1024
-#winHeight=768
+winWidth=1024
+winHeight=768
 
 useFullScreen=0
@@ -127,4 +128,5 @@
 # skylight turbitity
 turbitity=3.0f
+#turbitity=2.0f
 #sky dome scale factor
 
