Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp	(revision 2811)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp	(revision 2813)
@@ -89,5 +89,5 @@
 
 static int winWidth = 1024;
-static int winHeight = 1024;
+static int winHeight = 768;
 static float winAspectRatio = 1.0f;
 
@@ -98,6 +98,8 @@
 
 // rendertexture
-const static int texWidth = 1024;
-const static int texHeight = 1024;
+//const static int texWidth = 1024;
+//const static int texHeight = 768;
+const static int texWidth = 2048;
+const static int texHeight = 2048;
 
 int renderedObjects = 0;
@@ -505,5 +507,5 @@
 	glGenRenderbuffersEXT(1, &colorsBuffer);
 	glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, colorsBuffer);
-	glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_RGBA16F_ARB, texWidth, texHeight);
+	glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_RGBA32F_ARB, texWidth, texHeight);
 	
 	glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_RENDERBUFFER_EXT, colorsBuffer);
@@ -512,5 +514,5 @@
 	glBindTexture(GL_TEXTURE_2D, colorsTex);
 
-	glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16F_ARB,  texWidth, texHeight, 0, GL_RGBA, GL_FLOAT, NULL);
+	glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA32F_ARB,  texWidth, texHeight, 0, GL_RGBA, GL_FLOAT, NULL);
 	glGenerateMipmapEXT(GL_TEXTURE_2D);
 	glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, colorsTex, 0);
@@ -525,6 +527,6 @@
 	glGenRenderbuffersEXT(1, &positionsBuffer);
 	glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, positionsBuffer);
-	glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_RGBA16F_ARB, texWidth, texHeight);
-	//glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT, samples, GL_RGBA16F_ARB, texWidth, texHeight);
+	glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_RGBA32F_ARB, texWidth, texHeight);
+	//glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT, samples, GL_RGBA32F_ARB, texWidth, texHeight);
 	
 	glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT1_EXT, GL_RENDERBUFFER_EXT, positionsBuffer);
@@ -532,5 +534,5 @@
 	glGenTextures(1, &positionsTex);
 	glBindTexture(GL_TEXTURE_2D, positionsTex);
-	glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16F_ARB,  texWidth, texHeight, 0, GL_RGBA, GL_FLOAT, NULL);
+	glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA32F_ARB,  texWidth, texHeight, 0, GL_RGBA, GL_FLOAT, NULL);
 	glGenerateMipmapEXT(GL_TEXTURE_2D);
 	glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT1_EXT, GL_TEXTURE_2D, positionsTex, 0);
@@ -550,5 +552,5 @@
 	glGenRenderbuffersEXT(1, &normalsBuffer);
 	glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, normalsBuffer);
-	glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_RGBA16F_ARB, texWidth, texHeight);
+	glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_RGBA32F_ARB, texWidth, texHeight);
 	
 	glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT2_EXT, GL_RENDERBUFFER_EXT, normalsBuffer);
@@ -556,5 +558,5 @@
 	glGenTextures(1, &normalsTex);
 	glBindTexture(GL_TEXTURE_2D, normalsTex);
-	glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16F_ARB,  texWidth, texHeight, 0, GL_RGBA, GL_FLOAT, NULL);
+	glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA32F_ARB,  texWidth, texHeight, 0, GL_RGBA, GL_FLOAT, NULL);
 	glGenerateMipmapEXT(GL_TEXTURE_2D);
 	glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT2_EXT, GL_TEXTURE_2D, normalsTex, 0);
@@ -591,5 +593,5 @@
 	// create color buffer
 	glGenRenderbuffersEXT(1, &occlusionbuffer);
-	//glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_RGBA16F_ARB, texWidth, texHeight);
+	//glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_RGBA32F_ARB, texWidth, texHeight);
 	glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT, samples, GL_FLOAT_RGBA_NV, texWidth2, texHeight2);
 	glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, occlusionbuffer);
@@ -598,5 +600,5 @@
 	glGenTextures(1, &occlusionTex);
 	glBindTexture(GL_TEXTURE_2D, occlusionTex);
-	glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16F_ARB,  texWidth2, texHeight2, 0, GL_RGBA, GL_FLOAT, NULL);
+	glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA32F_ARB,  texWidth2, texHeight2, 0, GL_RGBA, GL_FLOAT, NULL);
 	glGenerateMipmapEXT(GL_TEXTURE_2D);
 	glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, colorTex, 0);
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/deferred.cg
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/deferred.cg	(revision 2812)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/deferred.cg	(revision 2813)
@@ -67,6 +67,7 @@
 
   //const float areaSize = 4.0f;  
-  const float areaSize = 4e-3f;
-  const float sampleIntensity = 0.1f;
+  const float areaSize = 5e-1f;
+  //const float areaSize = 1e-4f;
+  const float sampleIntensity = 0.2f;
   
   for (int i = 0; i < SAMPLES; i ++) {
@@ -76,15 +77,15 @@
     float3 noise = tex2D(noiseTexture, IN.texCoord.xy).xyz * 2.0f - 1.0f;
 
-    // float2 offsetTransformed = offset;
-    float2 offsetTransformed;
-    offsetTransformed.x = noise.r*offset.x - noise.g*offset.y;
-    offsetTransformed.y = noise.g*offset.x + noise.r*offset.y;
+    float2 offsetTransformed = offset;
+    //float2 offsetTransformed;
+    //offsetTransformed.x = noise.r*offset.x - noise.g*offset.y;
+    //offsetTransformed.y = noise.g*offset.x + noise.r*offset.y;
 		
-    float2 texcoord = IN.texCoord.xy + offsetTransformed * areaSize;// * (1.0f - centerPositionW.w);
+    // weight with projected coordinate to reach similar kernel size for near and far
+    float2 texcoord = IN.texCoord.xy + offsetTransformed * areaSize * centerPositionW.w;
     
     float3 sample_position = tex2D(positions, texcoord).xyz;
     
     float3 vector_to_sample = sample_position - centerPosition;
-    // vector_to_sample.z = -vector_to_sample.z;
     float length_to_sample = length(vector_to_sample);
     float3 direction_to_sample = vector_to_sample / (length_to_sample + 1e-9f);
@@ -95,5 +96,5 @@
     
     // distance between current position and sample position controls AO intensity.
-    const float maxdist = 5e-1f;
+    const float maxdist = 1e-1f;
     //const float scale = 50.0f;
 
@@ -116,6 +117,6 @@
 {
   pixel OUT;
-  //float4 lightDir = float4(1.0f, 1.0f, 1.0f, 0.0f);
-float4 lightDir = float4(0.0f, 1.0f, 0.0f, 0.0f);
+  float4 lightDir = float4(1.0f, 1.0f, 1.0f, 0.0f);
+  //float4 lightDir = float4(0.0f, 1.0f, 0.0f, 0.0f);
   
   float4 color = tex2D(colors, IN.texCoord.xy);
@@ -126,5 +127,5 @@
   float4 position = tex2D(positions, IN.texCoord.xy);
 
-  float4 ambient = float4(0.1f);
+  float4 ambient = float4(0.3f);
 
   // float3 L = normalize(lightPosition - position);
@@ -135,12 +136,12 @@
 
   float ao = ssao(IN, positions, normals, ProjTrafo, noiseTexture);
-  OUT.color = ao; //(ambient + diffuse) * color;
-  //OUT.color = (ambient + diffuse) * color;
+  OUT.color = ao; 
+  //OUT.color = ao * (ambient + diffuse) * color;
+
+  //float4 currentPos = tex2D(normals, IN.texCoord.xy) * 0.5f + 0.5f;
+  //float4 currentPos = tex2D(positions, IN.texCoord.xy);
+  //OUT.color = currentPos.w;
   
-  //float4 currentPos = tex2D(positions, IN.texCoord.xy);
-  //OUT.color = currentPos;
-  //float4 currentPos = tex2D(normals, IN.texCoord.xy) * 0.5f + 0.5f;
-  //OUT.color = currentPos;
-  
+    
   return OUT;
 }
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/mrt.cg
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/mrt.cg	(revision 2811)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/mrt.cg	(revision 2813)
@@ -26,5 +26,5 @@
   float4 texCoord: TEXCOORD0;    
 
-  float4 dummy: WPOS;
+  float4 projPos: WPOS;
   float4 color: COLOR0;  
   float4 worldPos: TEXCOORD1; // world position
@@ -66,4 +66,5 @@
   pix.col = tex2D(tex, IN.texCoord.xy);
   pix.pos = IN.worldPos * maxDepth;
+  pix.pos.w = IN.projPos.w;
   pix.norm = IN.normal;
 
