Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaderenv.h
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaderenv.h	(revision 3313)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaderenv.h	(revision 3314)
@@ -64,5 +64,5 @@
 #define USE_GTX
 
-#define SSAO_FILTER_RADIUS 3
+#define SSAO_FILTER_RADIUS 5
 
 #define DEPTH_THRESHOLD 1e10f
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg	(revision 3313)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg	(revision 3314)
@@ -294,7 +294,10 @@
 		// we check if the sample could have been near enough to the current pixel 
 		// to have any influence in the current or last frame
+#if 0
 		const float tooFarAway = step(0.5f, lengthToSample - changeFactor);
-		//validSamples = max(validSamples, (1.0f - tooFarAway) * pixelValid * step(-0.1f, cosAngle));
+		validSamples = max(validSamples, (1.0f - tooFarAway) * pixelValid * step(-0.1f, cosAngle));
+#else
 		validSamples = max(validSamples, pixelValid);
+#endif
 
 #ifdef USE_GTX
@@ -420,5 +423,5 @@
 	const float partlyResetThres = 1.0f;
 	
-	if (1)//!isMovingObject)
+	if (!isMovingObject)
 	{
 		if (ao.y > completelyResetThres) 
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/combineSsaoSep.cg
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/combineSsaoSep.cg	(revision 3313)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/combineSsaoSep.cg	(revision 3314)
@@ -68,5 +68,6 @@
 	//samplePos = ReconstructSamplePos(ssaoTex, sampleTexCoord.xy, bl, br, tl, tr);
 
-	float len = min(SqrLen(centerPos - samplePos), 1e2f);
+	//float len = min(SqrLen(centerPos - samplePos), 1e2f);
+	float len = distance(centerPos, samplePos);
 	float spatialFactor = 1.0f / max(len, 1e-3f);
 
@@ -74,5 +75,7 @@
 
 	// combine the weights
-	float w = convergenceFactor * convergenceFactor * spatialFactor;// * normalFactor;
+	//float w = convergenceFactor * convergenceFactor * spatialFactor;
+	float w = convergenceFactor * spatialFactor;
+	//float w = spatialFactor;
 	float average = aoSample.x * w;
 
@@ -114,4 +117,41 @@
 }
 
+
+/** In between step that only filters in one direction
+*/
+pixel FilterSsaoHalfRes(fragment IN, 
+						uniform sampler2D colorsTex,
+						uniform sampler2D ssaoTex,
+						uniform float3 bl,
+						uniform float3 br,
+						uniform float3 tl,
+						uniform float3 tr,
+						uniform float2 res
+						 )
+{
+	pixel OUT;
+
+	const float depth = tex2Dlod(colorsTex, float4(IN.texCoord, 0, 0)).w;
+
+	OUT.illum_col = tex2Dlod(ssaoTex, float4(IN.texCoord, 0, 0));
+	// compute minimal convergence for savetly reasons, write it out
+	const float convergence = ComputeConvergenceHalfRes(ssaoTex, IN.texCoord, res * 0.5f);
+	OUT.illum_col.y = convergence;
+
+	const float2 xyStep = float2(1.0f / res.x, 0);
+
+	// filter reaches size 1 pixel when sample size reaches threshold 
+	// afterwards we do not use the filter anymore
+
+	// filter up to a certain convergance value and leave out background (sky) by checking depth
+	if ((convergence < SSAO_CONVERGENCE_THRESHOLD) && (depth < DEPTH_THRESHOLD))
+	{
+		// the filtered ssao value
+		OUT.illum_col.x = FilterXY(IN.texCoord, ssaoTex, colorsTex, bl, br, tl, tr, xyStep, convergence);
+	}
+
+	return OUT;
+}
+
 /** In between step that only filters in one direction
 */
@@ -149,39 +189,4 @@
 }
 
-/** In between step that only filters in one direction
-*/
-pixel FilterSsaoHalfRes(fragment IN, 
-						uniform sampler2D colorsTex,
-						uniform sampler2D ssaoTex,
-						uniform float3 bl,
-						uniform float3 br,
-						uniform float3 tl,
-						uniform float3 tr,
-						uniform float2 res
-						 )
-{
-	pixel OUT;
-
-	const float depth = tex2Dlod(colorsTex, float4(IN.texCoord, 0, 0)).w;
-
-	OUT.illum_col = tex2Dlod(ssaoTex, float4(IN.texCoord, 0, 0));
-	// compute minimal convergence for savetly reasons, write it out
-	const float convergence = ComputeConvergenceHalfRes(ssaoTex, IN.texCoord, res * 0.5f);
-	OUT.illum_col.y = convergence;
-
-	const float2 xyStep = float2(1.0f / res.x, 0);
-
-	// filter reaches size 1 pixel when sample size reaches threshold 
-	// afterwards we do not use the filter anymore
-
-	// filter up to a certain convergance value and leave out background (sky) by checking depth
-	if ((convergence < SSAO_CONVERGENCE_THRESHOLD) && (depth < DEPTH_THRESHOLD))
-	{
-		// the filtered ssao value
-		OUT.illum_col.x = FilterXY(IN.texCoord, ssaoTex, colorsTex, bl, br, tl, tr, xyStep, convergence);
-	}
-
-	return OUT;
-}
 
 /** Function combining image and indirect illumination buffer using a 
@@ -223,5 +228,5 @@
 	{
 		//OUT.illum_col.xyz = col.xyz * max(2e-2f, 1.0f - ao.x);
-		OUT.illum_col.xyz = max(2e-2f, 1.0f - ao.x);
+		OUT.illum_col.xyz = max(1e-3f, 1.0f - ao.x);
 	}
 	else
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp	(revision 3313)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp	(revision 3314)
@@ -625,5 +625,5 @@
 	if (0) LoadPompeiiFloor();
 
-#if 0
+#if 1
 	const Vector3 sceneCenter(470.398f, 240.364f, 181.7f);
 	//const Vector3 sceneCenter(470.398f, 240.364f, 180.3);
@@ -1151,10 +1151,12 @@
 
 		//const float rotAngle = M_PI * 1e-3f;
-		const float rotAngle = 0.3f * M_PI / 180.0f;
+		//const float rotAngle = 0.3f * M_PI / 180.0f;
+		const float rotAngle = 1.0f * M_PI / 180.0f;
 
 		Matrix4x4 rotMatrix = RotationZMatrix(rotAngle);
 		dynamicObjects[1]->GetTransform()->MultMatrix(rotMatrix);
 
-		motionPath->Move(0.005f);
+		const float moveSpeed = 5e-3f;
+		motionPath->Move(moveSpeed);
 	}
 
@@ -2596,5 +2598,6 @@
 {
 	const float radius = 5.0f;
-	const Vector3 center(480.398f, 268.364f, 181.3);
+	//const Vector3 center(480.398f, 268.364f, 181.3);
+	const Vector3 center(480.398f, 269.364f, 181.3);
 
 	VertexArray vertices;
