Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Texture.cpp
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Texture.cpp	(revision 2845)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Texture.cpp	(revision 2846)
@@ -29,5 +29,12 @@
 
 Texture::Texture(const std::string &filename):
-mWidth(0), mHeight(0), mFormat(0), mImage(NULL), mTexId(-1), mName(filename)
+mWidth(0), 
+mHeight(0), 
+mFormat(0), 
+mImage(NULL), 
+mTexId(-1), 
+mName(filename),
+mBoundaryModeS(REPEAT),
+mBoundaryModeT(REPEAT)
 {
 	startil();
@@ -53,6 +60,4 @@
 	
 	stopil();
-
-	Create();
 }
 
@@ -73,9 +78,11 @@
 	//glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
 
-	//glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
-	//glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+	glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 4);
 
-	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
-	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
+	int glWrapModeS = (mBoundaryModeS == REPEAT) ?  GL_REPEAT : GL_CLAMP_TO_EDGE;
+	int glWrapModeT = (mBoundaryModeT == REPEAT) ?  GL_REPEAT : GL_CLAMP_TO_EDGE;
+
+	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, glWrapModeS);
+	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, glWrapModeT);
 
 	glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, mWidth, mHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, mImage);
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Texture.h
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Texture.h	(revision 2782)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Texture.h	(revision 2846)
@@ -27,4 +27,6 @@
 	enum { FORMAT_INVALID, FORMAT_RGB, FORMAT_RGBA };
 	
+	enum { CLAMP, REPEAT };
+
 	/** Returns width of texture.
 	*/
@@ -49,9 +51,16 @@
 	void Bind() const;
 
+	void SetBoundaryModeS(int mode) { mBoundaryModeS = mode; }
+	void SetBoundaryModeT(int mode) { mBoundaryModeT = mode; }
+
+	int GetBoundaryModeS() const { return mBoundaryModeS; }
+	int GetBoundaryModeT() const { return mBoundaryModeT; }
+
+	/** Creates the texture from the image
+	*/
+	void Create();
 
 
 protected:
-
-	void Create();
 
 	int mFormat;
@@ -60,4 +69,7 @@
 
 	unsigned int mTexId;
+
+	int mBoundaryModeS;
+	int mBoundaryModeT;
 
 	std::string mName;
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/ResourceManager.cpp
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/ResourceManager.cpp	(revision 2845)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/ResourceManager.cpp	(revision 2846)
@@ -121,4 +121,17 @@
 		Texture *tex = new Texture(model_path + texname);
 
+		int boundS, boundT;
+
+		str.read(reinterpret_cast<char *>(&boundS), sizeof(int));
+		str.read(reinterpret_cast<char *>(&boundT), sizeof(int));
+
+		tex->SetBoundaryModeS(boundS);
+		tex->SetBoundaryModeT(boundT);
+
+		//tex->SetBoundaryModeS(Texture::CLAMP);
+		//tex->SetBoundaryModeT(Texture::CLAMP);
+
+		tex->Create();
+
 		mTextureTable[i] = tex;
 		mTextures.push_back(tex);
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp	(revision 2845)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp	(revision 2846)
@@ -342,4 +342,5 @@
 		env.GetVectorParam(string("camDirection"), camDir);
 
+		//env.GetStringParam(string("modelPath"), model_path);
 		//env.GetIntParam(string("numSssaoSamples"), numSsaoSamples);
 
@@ -355,4 +356,5 @@
 		cout << "camPosition: " << camPos << endl;
 		cout << "expFactor: " << expFactor << endl;
+		//cout << "model path: " << model_path << endl;
 	}
 
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/default.env
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/default.env	(revision 2845)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/default.env	(revision 2846)
@@ -10,10 +10,12 @@
 winHeight=768
 camPosition=483.398f 242.364f 186.078f
-camDirection=1 1 0
+camDirection=1 0 0
 useFullScreen=0
+#modelPath=data/city/model/
+
 
 ############
 # shader stuff
+
 expFactor=0.1f
 #numSsaoSamples=8
-#0699/11384251
