Index: /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaderenv.h
===================================================================
--- /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaderenv.h	(revision 2901)
+++ /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaderenv.h	(revision 2903)
@@ -11,7 +11,7 @@
 
 // for quadradtc falloff
-//#define SAMPLE_INTENSITY 0.28f
+#define SAMPLE_INTENSITY 0.28f
 //#define SAMPLE_INTENSITY 0.32f
-#define SAMPLE_INTENSITY 2.4f
+//#define SAMPLE_INTENSITY 2.4f
 
 //#define AREA_SIZE 25e-1f
Index: /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao3d.cg
===================================================================
--- /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao3d.cg	(revision 2902)
+++ /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao3d.cg	(revision 2903)
@@ -40,5 +40,4 @@
 		   uniform float3 currentNormal,
 		   uniform float3 currentViewDir,
-		   uniform float noiseMultiplier,
 		   uniform float4 centerPosition,
 		   const uniform float4x4 modelViewProj,
@@ -64,7 +63,7 @@
 		// add random noise: r stores costheta, g stores sintheta
 
-		float3 mynoise = (float3)tex2D(noiseTexture, IN.texCoord.xy);// * noiseMultiplier);
-		//const float3 offsetTransformed = myreflect(offset, mynoise) * AREA_SIZE;
-		const float3 offsetTransformed = offset * AREA_SIZE;
+		float3 mynoise = (float3)tex2D(noiseTexture, IN.texCoord.xy);
+		const float3 offsetTransformed = myreflect(offset, mynoise) * AREA_SIZE;
+		//const float3 offsetTransformed = offset * AREA_SIZE;
 
 		// compute position
@@ -116,5 +115,4 @@
 		   uniform sampler2D noiseTexture,
 		   uniform float3 samples[NUM_SAMPLES],
-		   uniform float noiseMultiplier,
 		   uniform sampler2D oldTex,
 		   const uniform float4x4 oldModelViewProj,
@@ -147,5 +145,5 @@
 	realPos.w = 1.0f;
 
-	const float ao = ssao(IN, positions, noiseTexture, samples, normal, viewDir, noiseMultiplier, centerPosition, mymodelViewProj, realPos);
+	const float ao = ssao(IN, positions, noiseTexture, samples, normal, viewDir, centerPosition, mymodelViewProj, realPos);
 	//const float ao = ssao(IN, positions, samples, normal, viewDir, centerPosition, mymodelViewProj, realPos);
 		
Index: /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg
===================================================================
--- /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg	(revision 2898)
+++ /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg	(revision 2903)
@@ -41,5 +41,4 @@
 		   uniform float3 currentNormal,
 		   uniform float3 currentViewDir,
-		   uniform float noiseMultiplier,
 		   uniform float4 centerPosition
 		   )
@@ -57,15 +56,13 @@
 	{
 		const float2 offset = samples[i];
-		//const float3 offset = float3(samples[i], 0);
 
+#if 1
 		////////////////////
-		// add random noise: r stores costheta, g stores sintheta
-
-		//const float2 mynoise = tex2D(noiseTexture, IN.texCoord.xy * noiseMultiplier).xy * 2.0f - 1.0f;
-		float2 mynoise = tex2D(noiseTexture, IN.texCoord.xy * noiseMultiplier).xy;
-		//float3 mynoise = float3(tex2D(noiseTexture, IN.texCoord.xy * noiseMultiplier).xy,0);
-
+		// add random noise: reflect around random normal vector (warning: slow!)
+		float2 mynoise = tex2D(noiseTexture, IN.texCoord.xy).xy;
 		const float2 offsetTransformed = myreflect(offset, mynoise);
-
+#else
+		const float2 offsetTransformed = offset;
+#endif
 		// weight with projected coordinate to reach similar kernel size for near and far
 		float2 texcoord = IN.texCoord.xy + offsetTransformed * AREA_SIZE * w;
@@ -110,5 +107,4 @@
 		   uniform sampler2D noiseTexture,
 		   uniform float2 samples[NUM_SAMPLES],
-		   uniform float noiseMultiplier,
 		   uniform sampler2D oldTex,
 		   const uniform float4x4 oldModelViewProj,
@@ -137,5 +133,5 @@
 	const float currentDepth = currentCol.w;
 
-	const float ao = ssao(IN, positions, noiseTexture, samples, normal, viewDir, noiseMultiplier, centerPosition);
+	const float ao = ssao(IN, positions, noiseTexture, samples, normal, viewDir, centerPosition);
 		
 
Index: /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/globillum.cg
===================================================================
--- /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/globillum.cg	(revision 2897)
+++ /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/globillum.cg	(revision 2903)
@@ -46,5 +46,4 @@
 				 uniform float3 currentNormal,
 				 uniform float3 currentViewDir,
-				 uniform float noiseMultiplier,
 				 uniform float4 centerPosition
 				 )
@@ -67,13 +66,13 @@
 	{
 		float2 offset = samples[i];
-		//float3 offset = float3(samples[i], 0);
-
-		//sample noisetex; r stores costheta, g stores sintheta
-		float2 mynoise = tex2D(noiseTexture, IN.texCoord.xy * noiseMultiplier).xy;
-		//float3 mynoise = float3(tex2D(noiseTexture, IN.texCoord.xy * noiseMultiplier).xy, 0);
-
-		// reflect sampling using the noise texture
+
+#if 1
+		////////////////////
+		// add random noise: reflect around random normal vector (warning: slow!)
+		float2 mynoise = tex2D(noiseTexture, IN.texCoord.xy).xy;
 		float2 offsetTransformed = myreflect(offset, mynoise);
-
+#else
+		float2 offsetTransformed = offset;
+#endif
 		// weight with projected coordinate to reach similar kernel size for near and far
 		float2 texcoord = IN.texCoord.xy + offsetTransformed * AREA_SIZE * w;
@@ -96,8 +95,9 @@
 
 		// if normal perpenticular to view dir, only half of the samples count
-		//const float view_correction = 1.0f + VIEW_CORRECTION_SCALE * (1.0f - dot(currentViewDir, currentNormal));
-		//total_color.w -= cos_angle * distance_intensity * view_correction;
-		//total_color.xyz += cos_angle * distance_intensity * view_correction * sample_color * ILLUM_INTENSITY;
-
+		/*
+		const float view_correction = 1.0f + VIEW_CORRECTION_SCALE * (1.0f - dot(currentViewDir, currentNormal));
+		total_color.w -= cos_angle * distance_intensity * view_correction;
+		total_color.xyz += cos_angle * distance_intensity * view_correction * sample_color * ILLUM_INTENSITY;
+		*/
 		total_color.w -= cos_angle * distance_intensity;
 		total_color.xyz += cos_angle * distance_intensity * sample_color * ILLUM_INTENSITY;
@@ -116,5 +116,4 @@
 		   uniform sampler2D noiseTexture,
 		   uniform float2 samples[NUM_SAMPLES],
-		   uniform float noiseMultiplier,
 		   uniform sampler2D oldSsaoTex,
 		   uniform sampler2D oldIllumTex,
@@ -146,5 +145,5 @@
 
 	float4 new_color = globIllum(IN, colors, positions, noiseTexture, 
-                                 samples, normal, viewDir, noiseMultiplier, centerPosition);
+                                 samples, normal, viewDir, centerPosition);
 	
 
Index: /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SampleGenerator.cpp
===================================================================
--- /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SampleGenerator.cpp	(revision 2902)
+++ /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SampleGenerator.cpp	(revision 2903)
@@ -1,11 +1,11 @@
+#include "SampleGenerator.h"
 #include "common.h"
-#include "SampleGenerator.h"
 
 
 using namespace std;
+using namespace CHCDemoEngine;
 
 HaltonSequence SphericalSampleGenerator::sHalton;
 HaltonSequence PoissonDiscSampleGenerator::sHalton;
-HaltonSequence GaussianSampleGenerator::sHalton;
 HaltonSequence PseudoRandomGenerator::sHalton;
 
@@ -32,9 +32,9 @@
 	const float f_reduction = 0.9f;
 
-	static HaltonSequence halton;
+	//static HaltonSequence halton;
 	float r[2];
 
 	// generates poisson distribution on disc
-	float minDist = 2.0f / sqrt((float)mNumSamples);
+	float minDist = 2.0f * mRadius / sqrt((float)mNumSamples);
 
 	//cout << "minDist before= " << minDist << endl;
@@ -51,5 +51,7 @@
 			++ totalTries;
 
-			halton.GetNext(2, r);
+			r[0] = RandomValue(0, mRadius);
+			r[1] = RandomValue(0, mRadius);
+			//halton.GetNext(2, r);
 
 			const float rx = r[0] * 2.0f - 1.0f;
@@ -57,5 +59,5 @@
 
 			// check if in disk, else exit early
-			if (rx * rx + ry * ry > 1)
+			if (rx * rx + ry * ry > mRadius * mRadius)
 				continue;
 
@@ -86,38 +88,4 @@
 			}
 		}
-		
-		//cout << "sample: " << samples[i].x << " " << i << " " << samples[i].y << " r: " << sqrt(samples[i].x * samples[i].x  + samples[i].y * samples[i].y) << " tries: " << totalTries << endl;
-	}
-
-	//cout << "minDist after= " << minDist << endl;
-}
-
-
-
-GaussianSampleGenerator::GaussianSampleGenerator(int numSamples, float radius):
-SampleGenerator(numSamples, radius)
-{}
-
-
-void GaussianSampleGenerator::Generate(float *samples) const
-{
-	float r[2];
-
-	const float sigma = mRadius;
-
-	Sample2 *s = (Sample2 *)samples;
-
-	const float p0 = 1.0f / (sigma * sqrt(2.0f * M_PI));
-	const float p1 = 1.0f / (sigma * sqrt(2.0f * M_PI));
-
-	for (int i = 0; i < mNumSamples; ++ i)
-	{
-		sHalton.GetNext(2, r);
-
-		float exp_x = -(r[0] * r[0]) / (2.0f * sigma * sigma);
-		float exp_y = -(r[1] * r[1]) / (2.0f * sigma * sigma);
-
-		s[i].x = p0 * pow(M_E, exp_x);
-		s[i].y = p1 * pow(M_E, exp_y);
 	}
 
@@ -133,5 +101,22 @@
 void PseudoRandomGenerator::Generate(float *samples) const
 {
-	sHalton.GetNext(2 * mNumSamples, samples);
+	Sample2 *s = (Sample2 *)samples;
+
+	int numSamples = 0;
+
+	while (numSamples < mNumSamples)
+	{
+		const float rx = RandomValue(-mRadius, +mRadius);
+		const float ry = RandomValue(-mRadius, +mRadius);
+
+		// check if in disk, else exit early
+		if (rx * rx + ry * ry > mRadius * mRadius)
+			continue;
+
+		s[numSamples].x = rx;
+		s[numSamples].y = ry;
+
+		++ numSamples;
+	}
 }
 
@@ -146,14 +131,10 @@
 	float r[2];
 	Sample3 *s = (Sample3 *)samples;
-/*	
-	// idea: use poisson distribution to generate samples
 
-	PoissonDiscSampleGenerator poisson(mNumSamples, 1.0f);
-	Sample2 *pSamples = new Sample2[mNumSamples];
-	poisson.Generate((float *)pSamples);
-*/
 	for (int i = 0; i < mNumSamples; ++ i)
 	{
-		sHalton.GetNext(2, r);
+		r[0] = RandomValue(0, 1);
+		r[1] = RandomValue(0, 1);
+		//sHalton.GetNext(2, r);
 		//r[0] = pSamples[i].x; r[1] = pSamples[i].y;
 
Index: /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SampleGenerator.h
===================================================================
--- /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SampleGenerator.h	(revision 2902)
+++ /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SampleGenerator.h	(revision 2903)
@@ -75,18 +75,4 @@
 
 
-class GaussianSampleGenerator: public SampleGenerator
-{
-public:
-	
-	GaussianSampleGenerator(int numSamples, float radius);
-
-	virtual void Generate(float *samples) const;
-
-protected:
-
-	static HaltonSequence sHalton;
-};
-
-
 class SphericalSampleGenerator: public SampleGenerator
 {
Index: /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
===================================================================
--- /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp	(revision 2901)
+++ /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp	(revision 2903)
@@ -153,5 +153,4 @@
 
 bool useGlobIllum = false;
-bool useSsao = false;
 bool useTemporalCoherence = true;
 
@@ -173,5 +172,6 @@
 
 DeferredRenderer::SAMPLING_METHOD samplingMethod = DeferredRenderer::POISSON;
-DeferredRenderer::SHADING_METHOD shadingMethod = DeferredRenderer::DEFAULT;
+
+bool useAdvancedShading = false;
 
 bool showShadowMap = false;
@@ -1027,4 +1027,17 @@
 		if (!ssaoShader) ssaoShader = new DeferredRenderer(texWidth, texHeight, camera, myfar / 10.0f);
 		
+		DeferredRenderer::SHADING_METHOD shadingMethod;
+
+		if (useAdvancedShading)
+		{
+			if (useGlobIllum)
+				shadingMethod = DeferredRenderer::GI;
+			else
+				shadingMethod = DeferredRenderer::SSAO;
+		}
+		else
+			shadingMethod = DeferredRenderer::DEFAULT;
+
+
 		ssaoShader->SetShadingMethod(shadingMethod);
 		ssaoShader->SetSamplingMethod(samplingMethod);
@@ -1158,5 +1171,4 @@
 		else
 			samplingMethod = DeferredRenderer::GAUSS;
-
 		break;
 	case 'Y':
@@ -1165,4 +1177,7 @@
 		break;
 	case 'g':
+	case 'G':
+		useGlobIllum = !useGlobIllum;
+		break;
 	case 't':
 	case 'T':
@@ -1300,7 +1315,8 @@
 		break;
 	case GLUT_KEY_F8:
-		//shadingMethod = (DeferredRenderer::SHADING_METHOD)((shadingMethod + 1) % 3);
-		shadingMethod = (DeferredRenderer::SHADING_METHOD)((shadingMethod + 1) % 2);
-		
+
+		useAdvancedShading = !useAdvancedShading;
+		//shadingMethod = (DeferredRenderer::SHADING_METHOD)((shadingMethod + 1) % 2);
+
 		break;
 	case GLUT_KEY_F9:
@@ -1735,5 +1751,5 @@
 							useMultiQueries, useTightBounds, useRenderQueue);
 
-			sprintf(msg[i ++], "render technique: %s, SSAO: %d", renderTypeStr[renderType], useSsao);
+			sprintf(msg[i ++], "render technique: %s, SSAO: %d", renderTypeStr[renderType], useAdvancedShading);
 
 			sprintf(msg[i ++], "triangles per virtual leaf: %5d", trianglesPerVirtualLeaf);
Index: /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.cpp
===================================================================
--- /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.cpp	(revision 2901)
+++ /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.cpp	(revision 2903)
@@ -47,5 +47,4 @@
 static CGparameter sOldTexParam;
 static CGparameter sNoiseTexParam;
-static CGparameter sNoiseMultiplierParam;
 static CGparameter sTemporalCoherenceParam;
 
@@ -65,5 +64,4 @@
 static CGparameter sOldIllumTexGiParam;
 static CGparameter sNoiseTexGiParam;
-static CGparameter sNoiseMultiplierGiParam;
 static CGparameter sTemporalCoherenceGiParam;
 
@@ -92,4 +90,5 @@
 static CGparameter sSampleWidthParam;
 
+//#define USE_3D_SSAO
 
 
@@ -97,6 +96,13 @@
 
 // ssao random spherical samples
+#ifdef USE_3D_SSAO
+
+static Sample2 samples3[NUM_SAMPLES];
+
+#else
+
 static Sample2 samples2[NUM_SAMPLES];
-static Sample2 samples3[NUM_SAMPLES];
+
+#endif
 
 static int colorBufferIdx = 0;
@@ -119,13 +125,15 @@
 static void GenerateSamples(int sampling)
 {
-	SphericalSampleGenerator gauss(NUM_SAMPLES, 1.0f);
-	gauss.Generate((float *)samples3);
-	
-	/*
+#ifdef USE_3D_SSAO
+
+	SphericalSampleGenerator sph(NUM_SAMPLES, 1.0f);
+	sph.Generate((float *)samples3);
+
+#else
 	switch (sampling)
 	{
 	case DeferredRenderer::POISSON:
 		{
-			static PoissonDiscSampleGenerator poisson(NUM_SAMPLES, 1.0f);
+			PoissonDiscSampleGenerator poisson(NUM_SAMPLES, 1.0f);
 			poisson.Generate((float *)samples2);
 		}
@@ -133,14 +141,16 @@
 	case DeferredRenderer::GAUSS:
 		{
-			//static GaussianSampleGenerator gauss(NUM_SAMPLES, 0.5f);
-			//gauss.Generate((float *)samples2);
-
-			static SphericalSampleGenerator gauss(NUM_SAMPLES, 0.5f);
-			gauss.Generate((float *)samples3);
+			//PoissonDiscSampleGenerator poisson(NUM_SAMPLES, 1.0f);
+			//poisson.Generate((float *)samples2);
+
+			PseudoRandomGenerator pseudo(NUM_SAMPLES, 1.0f);
+			pseudo.Generate((float *)samples2);
 		}
 		break;
 	default:
+		cout << "should not come here" << endl;
 		break;
-	}*/
+	}
+#endif
 }
 
@@ -151,7 +161,4 @@
 	float *randomNormals = new float[w * h * 3];
 
-	//SphericalSampleGenerator gauss(w * h, 1.0f);
-	//gauss.Generate(randomNormals);
-
 	static HaltonSequence halton;
 	float r[2];
@@ -159,12 +166,9 @@
 	for (int i = 0; i < w * h * 3; i += 3)
 	{
-		// create random samples on a circle
-		halton.GetNext(2, r);
-
 		
-		//const float theta = 2.0f * acos(sqrt(1.0f - rx));
-		//randomNormals[i + 0] = cos(theta);
-		//randomNormals[i + 1] = sin(theta);
-		//randomNormals[i + 2] = 0;
+#ifdef USE_3D_SSAO
+		//halton.GetNext(2, r);
+		r[0] = RandomValue(0, 1);
+		r[1] = RandomValue(0, 1);
 
 		const float theta = 2.0f * acos(sqrt(1.0f - r[0]));
@@ -174,4 +178,15 @@
 		randomNormals[i + 1] = sin(theta) * sin(phi);
 		randomNormals[i + 2] = cos(theta);
+#else
+		// create random samples on a circle
+		r[0] = RandomValue(0, 1);
+		//halton.GetNext(1, r);
+
+		const float theta = 2.0f * acos(sqrt(1.0f - r[0]));
+		
+		randomNormals[i + 0] = cos(theta);
+		randomNormals[i + 1] = sin(theta);
+		randomNormals[i + 2] = 0;
+#endif
 	}
 
@@ -274,6 +289,10 @@
 		cgCreateProgramFromFile(context, 
 								CG_SOURCE,
-								//"src/shaders/ssao.cg", 
+#ifdef USE_3D_SSAO
 								"src/shaders/ssao3d.cg", 
+
+#else
+								"src/shaders/ssao.cg", 
+#endif
 								RenderState::sCgFragmentProfile,
 								"main",
@@ -288,5 +307,4 @@
 		sNormalsTexParam = cgGetNamedParameter(sCgSsaoProgram, "normals");  
 		sNoiseTexParam = cgGetNamedParameter(sCgSsaoProgram, "noiseTexture");
-		sNoiseMultiplierParam = cgGetNamedParameter(sCgSsaoProgram, "noiseMultiplier");
 		
 		sOldModelViewProjMatrixParam = cgGetNamedParameter(sCgSsaoProgram, "oldModelViewProj");
@@ -297,5 +315,4 @@
 		sOldTexParam = cgGetNamedParameter(sCgSsaoProgram, "oldTex");  
 		
-		cgGLSetParameter1f(sNoiseMultiplierParam, RandomValue(1.0f, 3.0f));
 		sSamplesParam = cgGetNamedParameter(sCgSsaoProgram, "samples");
 	}
@@ -320,5 +337,4 @@
 		sNormalsTexGiParam = cgGetNamedParameter(sCgGiProgram, "normals");  
 		sNoiseTexGiParam = cgGetNamedParameter(sCgGiProgram, "noiseTexture");
-		sNoiseMultiplierGiParam = cgGetNamedParameter(sCgGiProgram, "noiseMultiplier");
 		
 		sOldModelViewProjMatrixGiParam = cgGetNamedParameter(sCgGiProgram, "oldModelViewProj");
@@ -330,6 +346,4 @@
 		sOldSsaoTexGiParam = cgGetNamedParameter(sCgGiProgram, "oldSsaoTex");  
 		sOldIllumTexGiParam = cgGetNamedParameter(sCgGiProgram, "oldIllumTex");  
-
-		cgGLSetParameter1f(sNoiseMultiplierGiParam, RandomValue(1.0f, 3.0f));
 	}
 	else
@@ -500,4 +514,5 @@
 								   )
 {
+#ifdef USE_3D_SSAO
 	static Matrix4x4 biasMatrix(0.5f, 0.0f, 0.0f, 0.5f,
 								0.0f, 0.5f, 0.0f, 0.5f,
@@ -507,6 +522,8 @@
 	Matrix4x4 m = projViewMatrix * biasMatrix; 
 
+	cgGLSetMatrixParameterfc(sModelViewProjMatrixParam, (const float *)m.x);
+#endif
+
 	cgGLSetMatrixParameterfc(sOldModelViewProjMatrixParam, (const float *)oldProjViewMatrix.x);
-	cgGLSetMatrixParameterfc(sModelViewProjMatrixParam, (const float *)m.x);
 
 	GLuint colorsTex = fbo->GetColorBuffer(3)->GetTexture();
@@ -558,5 +575,4 @@
 	{
 		mRegenerateSamples = false;
-		cgGLSetParameter1f(sNoiseMultiplierParam, RandomValue(3.0f, 17.0f));
 
 		// q: should we generate new samples or only rotate the old ones?
@@ -565,6 +581,9 @@
 		GenerateSamples(mSamplingMethod); 
 
-		//cgGLSetParameterArray2f(sSamplesParam, 0, NUM_SAMPLES, (const float *)samples2);
+#ifdef USE_3D_SSAO
 		cgGLSetParameterArray3f(sSamplesParam, 0, NUM_SAMPLES, (const float *)samples3);
+#else
+		cgGLSetParameterArray2f(sSamplesParam, 0, NUM_SAMPLES, (const float *)samples2);
+#endif
 	}
 
@@ -779,5 +798,4 @@
 	{
 		mRegenerateSamples = false;
-		cgGLSetParameter1f(sNoiseMultiplierGiParam, RandomValue(3.0f, 17.0f));
 
 		// q: should we generate new samples or only rotate the old ones?
@@ -785,5 +803,10 @@
 		// needs longer to converge
 		GenerateSamples(mSamplingMethod); 
+
+#ifdef USE_3D_SSAO
+		cgGLSetParameterArray3f(sSamplesGiParam, 0, NUM_SAMPLES, (const float *)samples3);
+#else
 		cgGLSetParameterArray2f(sSamplesGiParam, 0, NUM_SAMPLES, (const float *)samples2);
+#endif
 	}
 
Index: /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/common.h
===================================================================
--- /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/common.h	(revision 2898)
+++ /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/common.h	(revision 2903)
@@ -254,11 +254,4 @@
 
 
-/*inline int
-RandomValue(int a, int b)
-{
-	int range = abs(a - b);
-	return (rand() * range) / RAND_MAX + ((a < b) ? a : b);
-}*/
-
 inline Real sqr(Real a)
 {
