Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg	(revision 3092)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg	(revision 3093)
@@ -169,6 +169,6 @@
 
 	const float depthDif = length(oldSamplePos - worldPos.xyz);
-	//const float dummy5 = abs(oldEyeSpaceDepth - eyeSpaceDepth);
-	const float dummy5 = length(oldTexCoords - texcoord0) * 1e5f;
+	const float dummy5 = abs(oldEyeSpaceDepth - eyeSpaceDepth);
+	//const float dummy5 = length(oldTexCoords - texcoord0) * 1e5f;
 	//const float dummy5 = depthDif;
 
@@ -223,5 +223,5 @@
 	illum_col.y = newWeight;
 	illum_col.w = eyeSpaceDepth;
-	illum_col.y = dummy5;
+	//illum_col.y = dummy5;
 
 	return illum_col;
@@ -365,6 +365,5 @@
 			 uniform sampler2D ssaoTex,
 			 uniform float2 filterOffs[NUM_SSAO_FILTERSAMPLES],
-			 uniform float filterWeights[NUM_SSAO_FILTERSAMPLES]
-)
+			 uniform float filterWeights[NUM_SSAO_FILTERSAMPLES])
 {
 	float average = .0f;
@@ -397,6 +396,6 @@
 	//if (ao.y < 10.0f) ao.x = Filter(IN.texCoord, ssaoTex, filterOffs, filterWeights);
 
-	//OUT.illum_col = col * ao.x;
-	OUT.illum_col = float4(ao.y, ao.y, ao.y, col.w);
+	OUT.illum_col = col * ao.x;
+	//OUT.illum_col = float4(ao.y, ao.y, ao.y, 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 3092)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.cpp	(revision 3093)
@@ -152,22 +152,10 @@
 
 	// note: slightly larger texture could hide ambient occlusion error on border but costs resolution
-	const float offs = 0.5f;
-	
 	glBegin(GL_QUADS);
 
-	/*glTexCoord2f(0, 0); glMultiTexCoord3fARB(GL_TEXTURE1_ARB, bl.x, bl.y, bl.z); glVertex3f(-offs, -offs, -0.5f);
-	glTexCoord2f(1, 0); glMultiTexCoord3fARB(GL_TEXTURE1_ARB, br.x, br.y, br.z); glVertex3f( offs, -offs, -0.5f);
-	glTexCoord2f(1, 1); glMultiTexCoord3fARB(GL_TEXTURE1_ARB, tr.x, tr.y, tr.z); glVertex3f( offs,  offs, -0.5f);
-	glTexCoord2f(0, 1); glMultiTexCoord3fARB(GL_TEXTURE1_ARB, tl.x, tl.y, tl.z); glVertex3f(-offs,  offs, -0.5f);
-
-	glTexCoord2f(0, 0); glMultiTexCoord3fARB(GL_TEXTURE1_ARB, bl.x, bl.y, bl.z); glVertex2f(-offs, -offs);
-	glTexCoord2f(1, 0); glMultiTexCoord3fARB(GL_TEXTURE1_ARB, br.x, br.y, br.z); glVertex2f(offs, -offs);
-	glTexCoord2f(1, 1); glMultiTexCoord3fARB(GL_TEXTURE1_ARB, tr.x, tr.y, tr.z); glVertex2f(offs, offs);
-	glTexCoord2f(0, 1); glMultiTexCoord3fARB(GL_TEXTURE1_ARB, tl.x, tl.y, tl.z); glVertex2f(-offs, offs);
-*/	
-	glTexCoord2f(0, 0); glMultiTexCoord3fARB(GL_TEXTURE1_ARB, bl.x, bl.y, bl.z); glVertex2f(0, 0);
-	glTexCoord2f(1, 0); glMultiTexCoord3fARB(GL_TEXTURE1_ARB, br.x, br.y, br.z); glVertex2f(1, 0);
-	glTexCoord2f(1, 1); glMultiTexCoord3fARB(GL_TEXTURE1_ARB, tr.x, tr.y, tr.z); glVertex2f(1, 1);
-	glTexCoord2f(0, 1); glMultiTexCoord3fARB(GL_TEXTURE1_ARB, tl.x, tl.y, tl.z); glVertex2f(0, 1);
+	glTexCoord2f(0, 0); glMultiTexCoord3fARB(GL_TEXTURE1_ARB, bl.x, bl.y, bl.z); glVertex2f( .0f,  .0f);
+	glTexCoord2f(1, 0); glMultiTexCoord3fARB(GL_TEXTURE1_ARB, br.x, br.y, br.z); glVertex2f(1.0f,  .0f);
+	glTexCoord2f(1, 1); glMultiTexCoord3fARB(GL_TEXTURE1_ARB, tr.x, tr.y, tr.z); glVertex2f(1.0f, 1.0f);
+	glTexCoord2f(0, 1); glMultiTexCoord3fARB(GL_TEXTURE1_ARB, tl.x, tl.y, tl.z); glVertex2f( .0f, 1.0f);
 
 	glEnd();
@@ -552,5 +540,6 @@
 	sCgSsaoProgram->SetTexture(3, noiseTex);
 
-	sCgSsaoProgram->SetValue3f(4, mEyePos.x, mEyePos.y, mEyePos.z);
+	//sCgSsaoProgram->SetValue3f(4, mEyePos.x, mEyePos.y, mEyePos.z);
+	sCgSsaoProgram->SetValue3f(4, 0, 0, 0);
 
 	sCgSsaoProgram->SetValue1f(5, (mUseTemporalCoherence && !mRegenerateSamples) ? tempCohFactor : 0);
@@ -588,5 +577,8 @@
 	tr = mOldCornersView[3];
 
-	sCgSsaoProgram->SetValue3f(13, mOldEyePos.x, mOldEyePos.y, mOldEyePos.z);
+	Vector3 d = mOldEyePos - mEyePos;
+
+	//sCgSsaoProgram->SetValue3f(13, mOldEyePos.x, mOldEyePos.y, mOldEyePos.z);
+	sCgSsaoProgram->SetValue3f(13, d.x, d.y, d.z);
 	sCgSsaoProgram->SetValue3f(14, bl.x, bl.y, bl.z);
 	sCgSsaoProgram->SetValue3f(15, br.x, br.y, br.z);
@@ -1026,5 +1018,6 @@
 	Matrix4x4 matViewing, matProjection;
 
-	mCamera->GetModelViewMatrix(matViewing);
+	//mCamera->GetModelViewMatrix(matViewing);
+	mCamera->GetViewOrientationMatrix(matViewing);
 	mCamera->GetProjectionMatrix(matProjection);
 
