Index: /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaderenv.h
===================================================================
--- /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaderenv.h	(revision 3087)
+++ /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaderenv.h	(revision 3088)
@@ -42,5 +42,5 @@
 #define MAX_LOD_LEVEL 10
 
-#define MIN_DEPTH_DIFF 1e-1f
+#define MIN_DEPTH_DIFF 1e-2f
 #define PRECISION_SCALE 1e-1f
 
Index: /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg
===================================================================
--- /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg	(revision 3087)
+++ /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg	(revision 3088)
@@ -54,5 +54,5 @@
 								   float3 bl, float3 br, float3 tl, float3 tr)
 {
-	const float eyeSpaceDepth = tex2Dlod(tex, float4(texcoord, 0, 0)).w;
+	const float eyeSpaceDepth = tex2D(tex, texcoord).w;
 	float3 viewVec = Interpol(texcoord, bl, br, tl, tr);
 	float3 samplePos = -viewVec * eyeSpaceDepth;
@@ -80,6 +80,6 @@
 							   uniform float3 oldbr,
 							   uniform float3 oldtl,
-							   uniform float3 oldtr,
-							   float dummy3
+							   uniform float3 oldtr
+							  // float dummy3
 							   )
 {
@@ -98,7 +98,7 @@
 
 	// retrieve the sample from the last frame
-	float4 oldCol = tex2Dlod(oldTex, float4(oldTexCoords, 0, 0));
-
-	float oldEyeSpaceDepth = oldCol.z / dummy3;
+	float4 oldCol = tex2D(oldTex, oldTexCoords);
+
+	float oldEyeSpaceDepth = oldCol.w;// dummy3;
 	float3 viewVec = Interpol(oldTexCoords, oldbl, oldbr, oldtl, oldtr);
 	float3 oldSamplePos = oldEyePos - viewVec * oldEyeSpaceDepth;
@@ -115,5 +115,4 @@
 float4 temporalSmoothing(float4 currentProjPos,
 						 float4 worldPos,
-						 float currentDepth,
 						 uniform sampler2D oldTex,
 						 const uniform float4x4 oldModelViewProj,
@@ -151,11 +150,13 @@
 
 	// retrieve the sample from the last frame
-	float4 oldCol = tex2Dlod(oldTex, float4(oldTexCoords, 0, 0));
+	//float4 oldCol = tex2Dlod(oldTex, float4(oldTexCoords, 0, 0));
+	float4 oldCol = tex2D(oldTex, oldTexCoords);
 
 	//eyeSpaceDepth = 1e6f;
 	
-	const float dummy3 = 1e-4f;
+	//const float dummy3 = 1e-4f;
 	//const float oldEyeSpaceDepth = 1e5f * dummy3;
-	const float oldEyeSpaceDepth = oldCol.z / dummy3;
+	//const float oldEyeSpaceDepth = oldCol.z / dummy3;
+	const float oldEyeSpaceDepth = oldCol.w;
 
 	//oldTexCoords.x += 0.5f / 1024.0f; oldTexCoords.y += 0.5f / 768.0f;
@@ -167,5 +168,5 @@
 	//const float oldDepth = oldCol.z;
 	const float depthDif = length(oldSamplePos - worldPos.xyz);
-	eyeSpaceDepth *= dummy3;
+	//eyeSpaceDepth *= dummy3;
 	
 	//const float depthDif = abs(oldEyeSpaceDepth - eyeSpaceDepth);// * 1e4f;
@@ -190,8 +191,9 @@
 							  eyePos,
 							  oldEyePos,
-							  oldbl, oldbr, oldtl, oldtr,
-							  dummy3);
-
-		if (sampleDif > MIN_DEPTH_DIFF) isValid = false;
+							  oldbl, oldbr, oldtl, oldtr
+							  //,dummy3
+							  );
+
+		//if (sampleDif > 1e-1f) isValid = false;
 	}
 
@@ -224,5 +226,5 @@
 	//illum_col.y = isValid / 16.0f;
 	illum_col.y = newWeight;
-	illum_col.z = eyeSpaceDepth;
+	illum_col.w = eyeSpaceDepth;
 	//illum_col.z = dummy2;
 
@@ -336,6 +338,6 @@
 	// reconstruct position from the eye space depth
 	const float3 viewDir = IN.view;
-	const float eyeDepth = tex2Dlod(colors, float4(IN.texCoord, 0, 0)).w;
-	const float3 eyeSpacePos = -viewDir * eyeDepth;
+	const float eyeSpaceDepth = tex2D(colors, IN.texCoord).w;
+	const float3 eyeSpacePos = -viewDir * eyeSpaceDepth;
 	const float4 worldPos = float4(eyePos + eyeSpacePos, 1.0f);
 
@@ -350,6 +352,4 @@
 	w *= SAMPLE_RADIUS;
 	
-	const float currentDepth = projPos.z * PRECISION_SCALE;
-
 	const float2 ao = ssao(IN, colors, noiseTex, samples, normal, eyeSpacePos, w, bl, br, tl, tr, normalize(viewDir));
 
@@ -358,6 +358,6 @@
 	//-- compute temporally smoothing
 	
-	OUT.illum_col = temporalSmoothing(projPos, worldPos, currentDepth, oldTex, oldModelViewProj, temporalCoherence, ao,
-		                              samples, colors, noiseTex, w, bl, br, tl, tr, IN.texCoord, eyePos, eyeDepth,
+	OUT.illum_col = temporalSmoothing(projPos, worldPos, oldTex, oldModelViewProj, temporalCoherence, ao,
+		                              samples, colors, noiseTex, w, bl, br, tl, tr, IN.texCoord, eyePos, eyeSpaceDepth,
 									  oldEyePos, oldbl, oldbr, oldtl, oldtr);
 
@@ -402,6 +402,6 @@
 	//	ao.x = Filter(IN.texCoord, ssaoTex, filterOffs, filterWeights);
 
-	OUT.illum_col = col * ao.x;
-	//OUT.illum_col = float4(ao.x, ao.x, ao.x, col.w);
+	//OUT.illum_col = col * ao.x;
+	OUT.illum_col = float4(ao.x, ao.x, ao.x, col.w);
 	//OUT.illum_col.xyz = float3(1.0f - ao.x, 1.0f - ao.y * 1e-2f, 1);
 	//OUT.illum_col.xyz = float3(1.0f - ao.x, ao.y, 0);
Index: /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.cpp
===================================================================
--- /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.cpp	(revision 3087)
+++ /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.cpp	(revision 3088)
@@ -261,5 +261,5 @@
 	for (int i = 0; i < 4; ++ i)
 	{
-		mIllumFbo->AddColorBuffer(ColorBufferObject::RGB_FLOAT_32, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_LINEAR);
+		mIllumFbo->AddColorBuffer(ColorBufferObject::RGBA_FLOAT_32, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_LINEAR);
 		InitBuffer(mIllumFbo, i);
 	}
