Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/deferred.cg
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/deferred.cg	(revision 2874)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/deferred.cg	(revision 2876)
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg	(revision 2874)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg	(revision 2876)
@@ -65,5 +65,5 @@
 	float total_ao = 0.0;
 
-	for (int i = 0; i < NUM_SAMPLES; i ++) 
+	for (int i = 0; i < NUM_SAMPLES; ++ i) 
 	{
 		float2 offset = samples[i];
@@ -85,18 +85,18 @@
 
 		float3 vector_to_sample = sample_position - centerPosition.xyz;
-		float length_to_sample = length(vector_to_sample);
+		const float length_to_sample = length(vector_to_sample);
+
 		float3 direction_to_sample = vector_to_sample / length_to_sample;
 
 		// Angle between current normal and direction to sample controls AO intensity.
-		float cos_angle = dot(direction_to_sample, currentNormal);
-		cos_angle = max(cos_angle, 0.0f);
+		const float cos_angle = max(dot(direction_to_sample, currentNormal), 0.0f);
 
 		// distance between current position and sample position controls AO intensity.
-		float distance_intensity = 
+		const float distance_intensity = 
 			(SAMPLE_INTENSITY * DISTANCE_SCALE) / (DISTANCE_SCALE + length_to_sample * length_to_sample);
 
 		// if surface normal perpenticular to view dir, some samples probably count less 
 		// => compensate for this
-		float view_correction = 1.0f + VIEW_CORRECTION_SCALE * (1.0f - dot(currentViewDir, currentNormal));
+		const float view_correction = 1.0f + VIEW_CORRECTION_SCALE * (1.0f - dot(currentViewDir, currentNormal));
 
 		total_ao += cos_angle * distance_intensity * view_correction;
@@ -104,5 +104,4 @@
 
 	return max(0.0f, 1.0f - total_ao);
-	//return dot(currentViewDir, currentNormal);
 }
 
@@ -165,5 +164,5 @@
 	if ((tex.x >= 0.0f) && (tex.x < 1.0f) && 
 		(tex.y >= 0.0f) && (tex.y < 1.0f) && 
-		(abs(depthDif)  < 1e-3f))
+		(abs(depthDif) < 1e-3f))
 	{
 		OUT.illum_col.x = ao * expFactor + oldCol.x * (1.0f - expFactor);
@@ -177,7 +176,4 @@
 	OUT.illum_col.w = currentDepth;
 
-	//OUT.combined_col = float4(newDepth / oldDepth * 100, 0, 0, 1) ;
-	//OUT.combined_col = float4(newDepth, 0, 0, 1) ;
-
 	return OUT;
 }
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/globillum.cg
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/globillum.cg	(revision 2875)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/globillum.cg	(revision 2876)
@@ -87,20 +87,20 @@
 
 		float3 sample_position = tex2Dlod(positions, float4(texcoord, 0, 1)).xyz;
-		float3 sample_color = tex2Dlod(colors, float4(texcoord, 0, 1)).xyz;
+		float3 sample_color = tex2Dlod(colors, float4(texcoord, 0, 2)).xyz;
 
 		float3 vector_to_sample = sample_position - centerPosition.xyz;
-		float length_to_sample = length(vector_to_sample);
+		const float length_to_sample = length(vector_to_sample);
+
 		float3 direction_to_sample = vector_to_sample / length_to_sample;
 
 		// Angle between current normal and direction to sample controls AO intensity.
-		float cos_angle = dot(direction_to_sample, currentNormal);
-		cos_angle = max(cos_angle, 0.0f);
+		float cos_angle = max(dot(direction_to_sample, currentNormal), 0);
 
 		// distance between current position and sample position controls AO intensity.
-		float distance_intensity = 
+		const float distance_intensity = 
 			(SAMPLE_INTENSITY * DISTANCE_SCALE) / (DISTANCE_SCALE + length_to_sample * length_to_sample);
 
 		// if normal perpenticular to view dir, only half of the samples count
-		float view_correction = 1.0f + VIEW_CORRECTION_SCALE * (1.0f - dot(currentViewDir, currentNormal));
+		const float view_correction = 1.0f + VIEW_CORRECTION_SCALE * (1.0f - dot(currentViewDir, currentNormal));
 
 		total_color.w -= cos_angle * distance_intensity * view_correction;
