Index: /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/FrameBufferObject.cpp
===================================================================
--- /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/FrameBufferObject.cpp	(revision 2976)
+++ /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/FrameBufferObject.cpp	(revision 2977)
@@ -164,5 +164,4 @@
 	if (useMipMap) 
 	{
-		//glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_FALSE);
 		glGenerateMipmapEXT(GL_TEXTURE_2D);
 	}
Index: /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/deferred.cg
===================================================================
--- /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/deferred.cg	(revision 2976)
+++ /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/deferred.cg	(revision 2977)
@@ -97,7 +97,8 @@
 	float logLumScaled = logLum * INV_LOGLUM_RANGE - logLumOffset;
 
-	const static float factor = 0.2f;
-	
-	OUT.color.w = lerp(oldColor.w, logLumScaled, factor);
+	if (oldColor.w > 0)
+		OUT.color.w = lerp(oldColor.w, logLumScaled, 0.2f);
+	else
+		OUT.color.w = logLumScaled;
 
 	return OUT;
Index: /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
===================================================================
--- /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp	(revision 2976)
+++ /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp	(revision 2977)
@@ -617,5 +617,5 @@
 
 	// the diffuse color buffer
-	fbo->AddColorBuffer(ColorBufferObject::BUFFER_FLOAT_32, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_LINEAR, ColorBufferObject::FILTER_LINEAR);
+	fbo->AddColorBuffer(ColorBufferObject::BUFFER_FLOAT_32, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_NEAREST, ColorBufferObject::FILTER_NEAREST);
 
 	// the positions buffer
@@ -626,5 +626,5 @@
 
 	// another color buffer
-	fbo->AddColorBuffer(ColorBufferObject::BUFFER_FLOAT_32, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_LINEAR, ColorBufferObject::FILTER_LINEAR);
+	fbo->AddColorBuffer(ColorBufferObject::BUFFER_FLOAT_32, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_NEAREST, ColorBufferObject::FILTER_NEAREST);
 
 	PrintGLerror("fbo");
Index: /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.cpp
===================================================================
--- /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.cpp	(revision 2976)
+++ /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.cpp	(revision 2977)
@@ -113,7 +113,4 @@
 static CGparameter sIntensityTexDownSampleParam;
 
-static unsigned int pbo[] = {0, 0};
-
-static unsigned int sCurrentPBOIdx = 0;
 //#define USE_3D_SSAO
 
@@ -273,15 +270,4 @@
 	mFbo->AddColorBuffer(ColorBufferObject::BUFFER_FLOAT_32, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_LINEAR);
 	mFbo->AddColorBuffer(ColorBufferObject::BUFFER_FLOAT_32, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_LINEAR);
-
-	glGenBuffersARB(2, pbo);
-
-	int dataSize = 1024 * 1768 * 4 * sizeof(float);
-
-	glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, pbo[0]);
-	glBufferDataARB(GL_PIXEL_PACK_BUFFER_ARB, dataSize, 0, GL_STREAM_READ_ARB);
-	glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, pbo[1]);
-	glBufferDataARB(GL_PIXEL_PACK_BUFFER_ARB, dataSize, 0, GL_STREAM_READ_ARB);
-
-	glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, 0);
 }
 
@@ -795,7 +781,8 @@
 {
 	GLuint colorsTex = fbo->GetColorBuffer(colorBufferIdx)->GetTexture();
-	GLuint oldColorsTex = fbo->GetColorBuffer(3 - colorBufferIdx)->GetTexture();
 	GLuint positionsTex = fbo->GetColorBuffer(1)->GetTexture();
 	GLuint normalsTex = fbo->GetColorBuffer(2)->GetTexture();
+
+	GLuint oldColorsTex = fbo->GetColorBuffer(3 - colorBufferIdx)->GetTexture();
 
 	fbo->Bind();
@@ -864,6 +851,6 @@
 
 	// generate mip map levels for position texture
-	glBindTexture(GL_TEXTURE_2D, positionsTex);
-	glGenerateMipmapEXT(GL_TEXTURE_2D);
+	//glBindTexture(GL_TEXTURE_2D, positionsTex);
+	//glGenerateMipmapEXT(GL_TEXTURE_2D);
 
 	// read the second buffer, write to the first buffer
@@ -1159,42 +1146,4 @@
 											 float &middleGrey)
 {
-	// read pixels from framebuffer to PBO
-/*	glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, pbo[sCurrentPBOIdx]);
-	
-	glBindTexture(GL_TEXTURE_2D, fbo->GetColorBuffer(colorBufferIdx)->GetTexture());
-	glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_FLOAT, NULL);
-
-	/////////////
-	//-- map the PBO to process its data by CPU
-
-	sCurrentPBOIdx = 1 - sCurrentPBOIdx;
-
-	glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, pbo[sCurrentPBOIdx]);
-	GLfloat *ptr = (GLfloat *)glMapBufferARB(GL_PIXEL_PACK_BUFFER_ARB, GL_READ_ONLY_ARB);
-
-	if (ptr)
-	{
-		float lumScaled = ptr[4 * 2 - 1];
-		float logLum = lumScaled * LOGLUM_RANGE + MINLOGLUM;
-		imageKey = exp(logLum);
-
-		cout << "key: " << imageKey << " " << lumScaled << endl;
-		glUnmapBufferARB(GL_PIXEL_PACK_BUFFER_ARB);
-	}
-*/
-	float *pixels = (float *)fbo->GetColorBuffer(colorBufferIdx)->ReadTexture();
-
-	float lumScaled = pixels[3];//4 * 2 - 1];
-	
-	float logLum = lumScaled * LOGLUM_RANGE + MINLOGLUM;
-	imageKey = exp(logLum);
-	
-	delete [] pixels;
-	cout << "key: " << imageKey << " " << lumScaled << endl;
-
-	// back to conventional pixel operation
-	glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, 0);
-
-
 	// hack: estimate value where sky burns out
 	whiteLum = log(1e4f);
