Index: /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg
===================================================================
--- /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg	(revision 3344)
+++ /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg	(revision 3345)
@@ -20,5 +20,5 @@
 {
 	float4 illum_col: COLOR0;
-	float4 col: COLOR1;
+	//float4 col: COLOR1;
 };
 
@@ -117,5 +117,5 @@
 	const float oldEyeSpaceDepth = oldPixel.w;
 
-	// vector from eye pos to old sample 
+	// vector from eye pos to old sample
 	const float3 viewVec = Interpol(oldTexCoords, oldbl, oldbr, oldtl, oldtr);
 	const float invLen = 1.0f / length(viewVec);
@@ -148,11 +148,11 @@
 		
 		//w = ComputeConvergence(oldTex, oldTexCoords, float2(1024.0f, 768.0f));
-		w = oldPixel.y;
+		w = floor(oldPixel.y);
+		//w = oldPixel.y;
 		idx = floor(oldPixel.z);
-
 	}
 	else
 	{	
-		w = 0.0f;
+		w = .0f;
 		idx = .0f;
 	}
@@ -501,5 +501,5 @@
 #ifdef PERFORMANCE_TEST	
 
-	float3 diffVec = tex2Dlod(attribsTex, float4(IN.texCoord, 0, 0)).xyz;
+	float3 diffVec = tex2Dlod(attribsTex, float4(IN.texCoord, .0f, .0f)).xyz;
 
 	const float sqrMoveSpeed = SqrLen(diffVec);
@@ -521,14 +521,15 @@
 	const float oldSsao = temporalVals.x;
 	
-	float oldWeight = temporalVals.y;
-	float oldIdx = temporalCoherence > 1 ? temporalVals.z : 0;
-	
+	float oldIdx = temporalCoherence > 1 ? temporalVals.y : .0f;
+	//float oldWeight = temporalVals.y;
+	float oldWeight = clamp(oldIdx, 0, temporalCoherence);
+
 #else
 
 	const bool isMovingObject = false;
-	const float oldSsao = 0;
-	
-	float oldWeight = 0;
-	float oldIdx = 0;
+	const float oldSsao = .0f;
+	
+	float oldWeight = .0f;
+	float oldIdx = .0f;
 	
 #endif
@@ -582,7 +583,6 @@
 		else if (ao.y > partlyResetThres)
 		{
-			oldWeight = min(oldWeight, 4.0f * newWeight);
-			//oldWeight = .0f; 
-			//oldIdx = .0f;
+			oldWeight = min(oldWeight, 4.0f * NUM_SAMPLES); oldIdx = oldWeight;
+			//oldWeight = .0f; oldIdx = .0f;
 		}
 	}
@@ -596,8 +596,10 @@
 
 	// the new weight for the next frame
-	const float combinedWeight = clamp(newWeight + oldWeight, .0f, temporalCoherence);
-
-	OUT.illum_col.y = combinedWeight;
-	OUT.illum_col.z = oldIdx + newWeight; // the new index
+	const float newIdx = newWeight + oldIdx;
+	//const float combinedWeight = clamp(newIdx, .0f, temporalCoherence);
+	const float combinedWeight = clamp(newIdx, .0f, min(newWeight + oldWeight, temporalCoherence));
+
+	//OUT.illum_col.y = combinedWeight;
+	OUT.illum_col.y = newIdx; // the new index
 	OUT.illum_col.w = eyeSpaceDepth;
 
@@ -605,6 +607,6 @@
 
 	// this value can be used to check if this pixel belongs to a moving object
-	OUT.col.x = SqrLen(diffVec);
-	//OUT.illum_col.z = SqrLen(diffVec);
+	//OUT.col.x = SqrLen(diffVec);
+	OUT.illum_col.z = SqrLen(diffVec);
 
 #else
Index: /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/deferred.cg
===================================================================
--- /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/deferred.cg	(revision 3341)
+++ /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/deferred.cg	(revision 3345)
@@ -254,5 +254,6 @@
 	// retrieve the sample from the last frame
 	const float4 oldPixel = tex2Dlod(oldTex, float4(oldTexCoords, .0f, .0f));
-	const float oldDiff = tex2Dlod(myTex, float4(oldTexCoords, .0f, .0f)).x;
+	//const float oldDiff = tex2Dlod(myTex, float4(oldTexCoords, .0f, .0f)).x;
+	const float oldDiff = tex2Dlod(myTex, float4(oldTexCoords, .0f, .0f)).z;
 
 	// calculate eye space position of sample in old frame
@@ -338,6 +339,5 @@
 	const float3 normal = normalize(tex2Dlod(normalsTex, float4(IN.texCoord, 0, 0)).xyz);
 
-//#ifdef PERFORMANCE_TEST
-#if 1
+#ifdef PERFORMANCE_TEST
 	// do reprojection and filter out the pixels that are not save
 	const float2 pValid = PixelValid(oldTex,
@@ -353,5 +353,5 @@
 									 );
 #else
-	const float2 pValid = float2(0,0);
+	const float2 pValid = float2(0, 0);
 #endif
 
Index: /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.cpp
===================================================================
--- /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.cpp	(revision 3343)
+++ /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.cpp	(revision 3345)
@@ -821,5 +821,5 @@
 	// read the second buffer, write to the first buffer
 	mIllumFbo->Bind();
-	glDrawBuffers(2, mrt + mIllumFboIndex);
+	glDrawBuffers(1, mrt + mIllumFboIndex);
 
 	int i = 0;
Index: /GTP/trunk/App/Demos/Vis/FriendlyCulling/toto.txt
===================================================================
--- /GTP/trunk/App/Demos/Vis/FriendlyCulling/toto.txt	(revision 3344)
+++ /GTP/trunk/App/Demos/Vis/FriendlyCulling/toto.txt	(revision 3345)
@@ -223,2 +223,6 @@
 fix shadows!
 make images with / without filter
+use nicer buddha
+
+make samplingstrategy different: poisson has same status as halton,
+use one of both (parent class randomsampler)
