Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaderenv.h
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaderenv.h	(revision 3340)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaderenv.h	(revision 3343)
@@ -8,8 +8,8 @@
 #define NUM_PRECOMPUTED_SAMPLES 4096
 
-#define NUM_SAMPLES 8
+//#define NUM_SAMPLES 8
 //#define NUM_SAMPLES 16
 //#define NUM_SAMPLES 24
-//#define NUM_SAMPLES 24
+#define NUM_SAMPLES 48
 
 //#define MIN_SAMPLES 48
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg	(revision 3342)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg	(revision 3343)
@@ -522,5 +522,5 @@
 	
 	float oldWeight = temporalVals.y;
-	float oldIdx = /*temporalCoherence > 1 ? */temporalVals.z/* : 0*/;
+	float oldIdx = temporalCoherence > 1 ? temporalVals.z : 0;
 	
 #else
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/combineSsaoSep.cg
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/combineSsaoSep.cg	(revision 3341)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/combineSsaoSep.cg	(revision 3343)
@@ -249,7 +249,7 @@
 	}
 
-	OUT.illum_col.xyz = float3(ao.w * 5e-1f, 0, 0);
+	//OUT.illum_col.xyz = float3(ao.w * 5e-1f, 0, 0);
 	//OUT.illum_col.xyz = float3(ao.z * 1e-1f);
-	OUT.illum_col.xyz = float3(ao.y * 1e-1f);//, 0, 0);
+	//OUT.illum_col.xyz = float3(ao.y * 1e-1f);//, 0, 0);
 	//OUT.illum_col.xyz = ao.xyz;
 
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SampleGenerator.cpp
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SampleGenerator.cpp	(revision 3339)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SampleGenerator.cpp	(revision 3343)
@@ -41,15 +41,19 @@
 	// the maximal possible radius: our radius is a fraction of this radius
 	// this is used as a measure of the quality of distribution of the point samples
-	const float rmax = 2.0f * mRadius * sqrt(1.0f / (2.0f * sqrt(3.0f) * mNumSamples));
+	//const float rmax = 2.0f * mRadius * sqrt(1.0f / (2.0f * sqrt(3.0f) * mNumSamples));
+	float rmax = 0.5f; //mRadius * sqrt(1.0f / (2.0f * sqrt(3.0f) * mNumSamples));
 
 	// generates poisson distribution on disc
 	// start with some thresholds: all samples lie on the circumference of circle
 	 
-	float minDist = 2.0f * rmax;
+	//float minDist = 2.0f * rmax;
+	float minDist = rmax;
 	float sqrMinDist = minDist * minDist;
 
 	int tries = 0;
 
-	cout << "minDist before= " << minDist << endl;
+	//cout << "minDist before= " << minDist / rmax << endl;
+	cout << "minDist before= " << rmax << endl;
+
 	Sample2 *s = (Sample2 *)samples;
 
@@ -124,5 +128,7 @@
 	}
 
-	cout << "minDist after= " << (float)minDist / mNumSamples<< " #tries: " << tries << endl;
+	rmax = mRadius * sqrt(1.0f / (2.0f * sqrt(3.0f) * mNumSamples));
+	cout << "minDist after= " << (float)minDist * mNumSamples << " #tries: " << tries << " samples: " << mNumSamples << endl;
+	cout << "minDist after= " << (float)minDist / rmax << " #tries: " << tries << endl;
 }
 
@@ -225,8 +231,10 @@
 
 
-QuadraticDiscSampleGenerator2D::QuadraticDiscSampleGenerator2D(int numSamples, float radius):
+QuadraticDiscSampleGenerator2D::QuadraticDiscSampleGenerator2D(int numSamples, 
+															   float radius):
 //PoissonDiscSampleGenerator2D(numSamples, radius)
 RandomSampleGenerator2D(numSamples, radius)
-{}
+{
+}
 
 
@@ -237,8 +245,4 @@
 	int numSamples = 0;
 	float x[2];
-
-	static float total1 = 0;
-	static float total2 = 0;
-	static int totalSamples = 0;
 
 	for (int i = 0; i < mNumSamples; ++ i)
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SampleGenerator.h
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SampleGenerator.h	(revision 3313)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SampleGenerator.h	(revision 3343)
@@ -29,4 +29,6 @@
 
 /** Class generating random samples on a disc or in a sphere, respectively.
+	Note: Rewrite this!! it does not work well enough, rather, sample generator should
+	be either poisson or halton or random that can be used to create samples on a disc ...
 */
 class SampleGenerator
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.cpp
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.cpp	(revision 3342)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.cpp	(revision 3343)
@@ -234,5 +234,5 @@
 	default: // SAMPLING_DEFAULT
 		{
-			RandomSampleGenerator2D g(NUM_SAMPLES, 1.0f);
+			RandomSampleGenerator2D g(NUM_PRECOMPUTED_SAMPLES, 1.0f);
 			g.Generate((float *)samples2);
 		}
@@ -845,5 +845,4 @@
 		{
 			CreateSampleTex(samples2, NUM_PRECOMPUTED_SAMPLES);
-			cout<<"here34"<<endl;
 		}
 		else
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/sibenik.env
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/sibenik.env	(revision 3342)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/sibenik.env	(revision 3343)
@@ -101,7 +101,7 @@
 ssaoUseFullResolution=1
 # ssao kernel radius
-ssaoKernelRadius=1.0f
+ssaoKernelRadius=0.5f
 # ssao sample intensity
-ssaoSampleIntensity=0.9f
+ssaoSampleIntensity=2.0f
 #ssaoSampleIntensity=0.8f
 # ssao temporal coherence factor
