Index: /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaderenv.h
===================================================================
--- /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaderenv.h	(revision 3216)
+++ /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaderenv.h	(revision 3221)
@@ -6,8 +6,8 @@
 //-- ssao + gi parameters
 
-//#define NUM_SAMPLES 8
-#define NUM_SAMPLES 16
+#define NUM_SAMPLES 8
+//#define NUM_SAMPLES 16
 //#define NUM_SAMPLES 24
-//#define NUM_SAMPLES 96
+//#define NUM_SAMPLES 48
 
 #define DISTANCE_SCALE 1e-2f
@@ -58,4 +58,5 @@
 #define DYNAMIC_OBJECTS_THRESHOLD 1e-8f
 
+#define USE_GTX
 
 #endif // __SHADERENV_H
Index: /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg
===================================================================
--- /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg	(revision 3213)
+++ /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg	(revision 3221)
@@ -325,5 +325,5 @@
 		validSamples = max(validSamples, (1.0f - tooFarAway) * pixelValid);
 
-#ifdef USE_GTX
+#ifdef QWQ//USE_GTX
 		// we can bail out early and use a minimal #samples)
 		// if some conditions are met as long as the hardware supports it
Index: /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SampleGenerator.cpp
===================================================================
--- /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SampleGenerator.cpp	(revision 3162)
+++ /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SampleGenerator.cpp	(revision 3221)
@@ -29,5 +29,5 @@
 	// the solution is a possion sampling with respect to the adjusted min distance
 	// better solutions have been proposed, i.e., using hierarchical sampling
-	const float maxTries = 1000;
+	const int maxTries = 1000;
 	const float f_reduction = 0.9f;
 
Index: /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/StatsWriter.h
===================================================================
--- /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/StatsWriter.h	(revision 3221)
+++ /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/StatsWriter.h	(revision 3221)
@@ -0,0 +1,69 @@
+#ifndef _STATSWRITER_H__
+#define _STATSWRITER_H__
+
+#include "common.h"
+#include <fstream>
+#include "Vector3.h"
+
+
+namespace CHCDemoEngine
+{
+
+struct FrameStats
+{
+	FrameStats() {}
+	FrameStats(int frame, int fps, float time, int nodes, int triangles, int objects):
+	mFrame(frame), mFPS(fps), mTime(time), mNodes(nodes), mTriangles(triangles), mObjects(objects)
+	{}
+
+
+
+	////////////////
+
+	int mFrame;
+	int mFPS;
+	float mTime;
+	int mNodes;
+	int mTriangles;
+	int mObjects;
+
+
+	friend std::ostream& operator<< (std::ostream &s, const FrameStats &A);
+};
+
+
+/// Overload << operator for C++-style output
+inline std::ostream& operator<< (std::ostream &s, const FrameStats &A)
+{
+	s << "#FRAME" << "\n" << A.mFrame << std::endl;
+	s << "#FPS" << "\n" << A.mFPS << std::endl;
+	s << "TIME" << "\n" << A.mTime << std::endl;
+	s << "#NODES" << "\n" << A.mNodes << std::endl;
+	s << "#TRIANGLES" << "\n" << A.mTriangles << std::endl;
+	s << "#OBJECTS" << "\n" << A.mObjects << std::endl;
+}
+
+
+/** Writes out stats
+*/
+class StatsWriter
+{
+public:
+
+	StatsWriter(const std::string &filename);
+
+	~StatsWriter();
+	/** Writes current data
+	*/
+	void WriteFrameStats(const FrameStats &stats);
+	
+
+protected:
+
+	std::ofstream mFile;
+};
+
+
+} // _STATSWRITER_H__
+
+#endif
Index: /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/StatsWriter.cpp
===================================================================
--- /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/StatsWriter.cpp	(revision 3221)
+++ /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/StatsWriter.cpp	(revision 3221)
@@ -0,0 +1,32 @@
+#include "StatsWriter.h"
+#include "Camera.h"
+#include "Vector3.h"
+#include <sstream>
+
+using namespace std;
+
+
+namespace CHCDemoEngine
+{
+
+
+StatsWriter::StatsWriter(const std::string &filename):
+mFile(filename.c_str())
+{
+}
+
+
+StatsWriter::~StatsWriter()
+{
+	mFile.close();
+}
+
+
+void StatsWriter::WriteFrameStats(const FrameStats &stats)
+{
+	mFile << stats << endl;
+}
+
+
+
+}
Index: /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
===================================================================
--- /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp	(revision 3220)
+++ /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp	(revision 3221)
@@ -1009,8 +1009,4 @@
 void MainLoop() 
 {	
-#if TODO
-	GPUProgramParameters *vtxParams = 
-		buddha->GetShape(0)->GetMaterial()->GetTechnique(1)->GetVertexProgramParameters();
-
 	Matrix4x4 oldTrafo = buddha->GetTransform()->GetMatrix();
 	Vector3 buddhaPos = motionPath->GetCurrentPosition();
@@ -1019,4 +1015,5 @@
 	buddha->GetTransform()->SetMatrix(trafo);
 
+#if TODO
 	/*for (int i = 0; i < 10; ++ i)
 	{
@@ -1030,15 +1027,16 @@
 		}
 	}*/
+#endif
+
+
+	/////////////////////////
+	//-- update animations
 
 	Matrix4x4 rotMatrix = RotationZMatrix(M_PI * 1e-3f);
 	dynamicObjects[1]->GetTransform()->MultMatrix(rotMatrix);
 
-
-	/////////////////////////
-	//-- update animations
-	
 	motionPath->Move(0.01f);
 
-#endif
+
 
 
@@ -1225,5 +1223,5 @@
 
 	// if no lense flare => just set sun to invisible
-	int sunVisiblePixels = useLenseFlare  &&  useDeferred ? TestSunVisible() : 0;
+	const int sunVisiblePixels = useLenseFlare  &&  useDeferred ? TestSunVisible() : 0;
 
 
@@ -1236,4 +1234,6 @@
 	RenderSky();
 
+
+	//////////////////////////////
 
 	if (useDeferred)
Index: /GTP/trunk/App/Demos/Vis/FriendlyCulling/FriendlyCulling.vcproj
===================================================================
--- /GTP/trunk/App/Demos/Vis/FriendlyCulling/FriendlyCulling.vcproj	(revision 3212)
+++ /GTP/trunk/App/Demos/Vis/FriendlyCulling/FriendlyCulling.vcproj	(revision 3221)
@@ -260,4 +260,12 @@
 			</File>
 			<File
+				RelativePath=".\src\StatsWriter.cpp"
+				>
+			</File>
+			<File
+				RelativePath=".\src\StatsWriter.h"
+				>
+			</File>
+			<File
 				RelativePath=".\src\WalkThroughRecorder.cpp"
 				>
