Index: /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/FrameBufferObject.cpp
===================================================================
--- /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/FrameBufferObject.cpp	(revision 2879)
+++ /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/FrameBufferObject.cpp	(revision 2881)
@@ -94,8 +94,10 @@
 		magfilterParam = GL_LINEAR; break;
 	case FILTER_MIPMAP_LINEAR: 
-		//minfilterParam = GL_LINEAR_MIPMAP_LINEAR;
-		minfilterParam = GL_NEAREST_MIPMAP_NEAREST;
-		//minfilterParam = GL_NEAREST_MIPMAP_LINEAR;
-		magfilterParam = GL_NEAREST; break;
+		//minfilterParam = GL_NEAREST_MIPMAP_NEAREST;
+		//magfilterParam = GL_NEAREST; 
+
+		minfilterParam = GL_NEAREST_MIPMAP_LINEAR;
+		magfilterParam = GL_LINEAR; 
+		break;
 	default:
 		minfilterParam = GL_NEAREST;
Index: /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg
===================================================================
--- /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg	(revision 2880)
+++ /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg	(revision 2881)
Index: /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/globillum.cg
===================================================================
--- /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/globillum.cg	(revision 2880)
+++ /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/globillum.cg	(revision 2881)
@@ -29,8 +29,14 @@
 
 
-struct pixel
+struct pixel2
 {
 	float4 ssao_col: COLOR0;
 	float4 illum_col: COLOR1;
+};
+
+
+struct pixel
+{
+	float4 illum_col: COLOR0;
 };
 
@@ -85,4 +91,5 @@
 		float2 texcoord = IN.texCoord.xy + offsetTransformed * AREA_SIZE * w;
 
+		// use lower lod level to improve cache coherence
 		float3 sample_position = tex2Dlod(positions, float4(texcoord, 0, 1)).xyz;
 		float3 sample_color = tex2Dlod(colors, float4(texcoord, 0, 2)).xyz;
@@ -114,5 +121,5 @@
 /** The mrt shader for screen space ambient occlusion + indirect illumination
 */
-pixel main(fragment IN, 
+pixel2 main(fragment IN, 
 		   uniform sampler2D colors,
 		   uniform sampler2D positions,
@@ -128,5 +135,5 @@
 		   )
 {
-	pixel OUT;
+	pixel2 OUT;
 
 	float4 norm = tex2D(normals, IN.texCoord.xy);
Index: /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SsaoShader.cpp
===================================================================
--- /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SsaoShader.cpp	(revision 2880)
+++ /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SsaoShader.cpp	(revision 2881)
@@ -112,7 +112,4 @@
 static void CreateNoiseTex2D(int w, int h)
 {
-	// hack: should be able to recalc noise texture
-	//if (noiseTex > 0) return;
-
 	//GLubyte *randomNormals = new GLubyte[mWidth * mHeight * 3];
 	float *randomNormals = new float[w * h * 3];
@@ -167,5 +164,5 @@
 	//-- the flip-flop fbos
 
-	w = 256; h = 256;
+	//w = 512; h = 512;
 	mNewFbo = new FrameBufferObject(w, h, FrameBufferObject::DEPTH_NONE);
 	
@@ -173,4 +170,7 @@
 	mNewFbo->AddColorBuffer(ColorBufferObject::BUFFER_FLOAT_32, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_LINEAR, false);
 	
+
+	///////////////////////
+
 	mOldFbo = new FrameBufferObject(w, h, FrameBufferObject::DEPTH_NONE);
 	
@@ -457,18 +457,4 @@
 	glDrawBuffers(1, mymrt);
 
-	glPushAttrib(GL_VIEWPORT_BIT);
-	glViewport(0, 0, 256, 256);
-
-	glMatrixMode(GL_PROJECTION);
-	glPushMatrix();
-	glLoadIdentity();
-
-	glMatrixMode(GL_MODELVIEW);
-	glPushMatrix();
-	glLoadIdentity();
-
-	const float offs = 0.5f;
-	glOrtho(-offs, offs, -offs, offs, 0, 1);
-
 
 	GLuint oldTex = mOldFbo->GetColorBuffer(0)->GetTexture();
@@ -537,11 +523,4 @@
 	cgGLDisableTextureParameter(sOldTexParam);
 
-	glMatrixMode(GL_PROJECTION);
-	glPopMatrix();
-
-	glMatrixMode(GL_MODELVIEW);
-	glPopMatrix();
-
-	glPopAttrib();
 
 	FrameBufferObject::Release();
@@ -805,9 +784,10 @@
 	glDrawBuffers(1, mymrt);
 
+	cgGLEnableProfile(RenderState::sCgFragmentProfile);
+
+	cgGLBindProgram(sCgCombinedIllumProgram);
+
 	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
 	
-	cgGLEnableProfile(RenderState::sCgFragmentProfile);
-
-	cgGLBindProgram(sCgCombinedIllumProgram);
 
 	cgGLSetTextureParameter(sColorsTexCombinedIllumParam, colorsTex);
Index: /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
===================================================================
--- /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp	(revision 2879)
+++ /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp	(revision 2881)
@@ -322,5 +322,5 @@
 		//cout << "model path: " << model_path << endl;
 
-		cout << "**** end parameters ****" << endl;
+		cout << "**** end parameters ****" << endl << endl;
 	}
 
@@ -537,5 +537,5 @@
 	// this fbo basicly stores the scene information we get from standard rendering of a frame
 	// we store colors, normals, positions (for the ssao)
-	fbo = new FrameBufferObject(texWidth, texHeight, FrameBufferObject::DEPTH_32);
+	fbo = new FrameBufferObject(texWidth, texHeight, FrameBufferObject::DEPTH_24);
 
 	// the diffuse color buffer
@@ -879,6 +879,4 @@
 		cgGLDisableProfile(RenderState::sCgVertexProfile);
 
-		glDrawBuffers(1, mrt);
-
 		glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
 
@@ -901,6 +899,4 @@
 		glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
 
-		glDrawBuffers(1, mrt);
-
 		break;
 	
@@ -980,10 +976,8 @@
 	if (renderType == RenderState::DEFERRED) 
 	{
-		fbo->Release();
+		FrameBufferObject::Release();
 
 		cgGLDisableProfile(RenderState::sCgVertexProfile);
 		cgGLDisableProfile(RenderState::sCgFragmentProfile);
-
-		glDrawBuffers(1, mrt);
 
 		if (useSsao)
@@ -991,5 +985,4 @@
 			if (!ssaoShader) ssaoShader = new SsaoShader(texWidth, texHeight, camera, myfar / 10.0f);
 			//DEL_PTR(deferredShader);
-			
 			ssaoShader->Render(fbo, oldViewProjMatrix, ssaoExpFactor);
 
@@ -999,5 +992,4 @@
 			if (!deferredShader) deferredShader = new DeferredShader(texWidth, texHeight);
 			//DEL_PTR(ssaoShader);
-
 			deferredShader->Render(fbo);
 		}
