Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/default.env
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/default.env	(revision 2830)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/default.env	(revision 2836)
@@ -5,5 +5,5 @@
 maxBatchSize=50
 trianglesPerVirtualLeaf=500
-keyForwardMotion=30.0f
+keyForwardMotion=20.0f
 keyRotation=1.5f
 winWidth=1024
@@ -12,3 +12,2 @@
 useFullScreen=0
 numSsaoSamples=8
-
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp	(revision 2835)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp	(revision 2836)
@@ -2095,5 +2095,5 @@
 		cgGLSetParameter1f(sNoiseMultiplierParam, RandomValue(3.0f, 17.0f));
 
-		//GenerateSamples(); cgGLSetParameterArray2f(sSamplesParamSsao, 0, NUM_SAMPLES, (const float *)samples);
+		GenerateSamples(); cgGLSetParameterArray2f(sSamplesParamSsao, 0, NUM_SAMPLES, (const float *)samples);
 	}
 	else
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/deferred.cg
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/deferred.cg	(revision 2835)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/deferred.cg	(revision 2836)
@@ -7,5 +7,5 @@
 //#define SAMPLE_INTENSITY 0.125f
 // rule of thumb: approx 1 / NUM_SAMPLES
-#define SAMPLE_INTENSITY 0.16 //0.0625f
+#define SAMPLE_INTENSITY 0.22 //0.0625f
 
 #define AREA_SIZE 5e-1f
@@ -14,7 +14,8 @@
 struct fragment
 {
-  float4 pos: WPOS; // normalized screen position
-  float4 texCoord: TEXCOORD0; 
-  float3 view: COLOR0;
+	 // normalized screen position
+	float4 pos: WPOS;
+	float4 texCoord: TEXCOORD0; 
+	float3 view: COLOR0;
 };
 
@@ -68,6 +69,4 @@
 
 	const float areaSize = 5e-1f;
-	//const float areaSize = 3e-1f;
-	//const float sampleIntensity = 0.2f;
 
 	for (int i = 0; i < NUM_SAMPLES; i ++) 
@@ -164,9 +163,10 @@
 			(SAMPLE_INTENSITY * distanceScale) / (distanceScale + length_to_sample * length_to_sample);
 
+		const float view_correction_scale = 0.5f;
 		// if normal perpenticular to view dir, only half of the samples count
-		float view_correction = 1.0f + 0.5f * (1.0f - dot(currentViewDir, currentNormal));
+		float view_correction = 1.0f + view_correction_scale * (1.0f - dot(currentViewDir, currentNormal));
 
 		total_ao += cos_angle * distance_intensity * view_correction;
-		total_color += cos_angle * distance_intensity * view_correction * sample_color;
+		total_color += cos_angle * distance_intensity * view_correction * sample_color * 0.3f;
 	}
 
@@ -234,17 +234,20 @@
 	float ao = new_col.w;
 
-	//float4 attenuated_color = ao * col + new_col;
-	float4 attenuated_color = ao * col;
+	float4 attenuated_color = ao * col + new_col;
+	//float4 attenuated_color = ao * col;
 
 	//OUT.color = ao;
-	//OUT.color = ao * col; 
+	//OUT.color = ao * col;
+	//float4 col1 = attenuated_color;
+
+	const float x = 0.1f;
+
 	float4 dummy = centerPosition * maxDepth;
 	dummy.w = 1.0f;
+
 	float4 oldPos = mul(oldModelViewProj, dummy);
 
 	float newDepth = oldPos.z / oldPos.w;
  
-	const float x = 0.1f;
-
 	float2 tex = (oldPos.xy / oldPos.w) * 0.5f + 0.5f;
 	float4 col1 = tex2D(oldTex, tex);
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/mrt.cg
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/mrt.cg	(revision 2834)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/mrt.cg	(revision 2836)
@@ -78,8 +78,13 @@
   pix.pos = IN.worldPos * maxDepth;
   pix.norm.xyz = IN.normal * 0.5f + 0.5f;
+
   // hack: squeeze some information about ambient into the texture
   pix.norm.w = ambient.x;
   // hack: store projection coordinate for scaling ssao
   pix.pos.w = IN.projPos.w;
+
+  if (pix.col.w < 0.9f)
+	  discard;
+
   pix.col.w = IN.mypos.z / IN.mypos.w;
 
