Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Geometry.cpp
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Geometry.cpp	(revision 3293)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Geometry.cpp	(revision 3294)
@@ -37,17 +37,19 @@
 	mHasTexture = (mTexCoords != NULL);
 	mHasTangents = (mTangents != NULL);
-
+/*
+	mIndices = new unsigned int[mNumVertices];
+
+	for (int i = 0; i < mNumVertices; ++ i)
+	{
+		mIndices[i] = i;
+	}*/
+
+	// prepare vbos
 	Prepare();
 
-	mIndices = new unsigned int[mNumVertices];
-
-	for (int i = 0; i < mNumVertices; ++ i)
-	{
-		mIndices[i] = i;
-	}
-
 	if (delData)
 	{
 		DEL_ARRAY_PTR(mVertices);
+		DEL_ARRAY_PTR(mIndices);
 		DEL_ARRAY_PTR(mNormals);
 		DEL_ARRAY_PTR(mTexCoords);
@@ -65,6 +67,7 @@
 	DEL_ARRAY_PTR(mIndices);
 
-	// delete vbo
+	// delete vbos
 	glDeleteBuffersARB(1, &mVboId);
+	glDeleteBuffersARB(1, &mVboId2);
 }
 
@@ -144,19 +147,26 @@
 
 	glBufferDataARB(GL_ARRAY_BUFFER_ARB, dataSize * sizeof(float), 
-		            (float *)data, GL_STATIC_DRAW_ARB);
+		            data, GL_STATIC_DRAW_ARB);
 
 	glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
 
-	glGenBuffersARB(1, &mVboId2);
-	
-	glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, mVboId2);
-	glBufferDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB, mNumVertices * sizeof(unsigned int), 
-		            mIndices, GL_STATIC_DRAW_ARB);
-
-	int bufferSize;
-	glGetBufferParameterivARB(GL_ELEMENT_ARRAY_BUFFER_ARB, GL_BUFFER_SIZE_ARB, &bufferSize);
-	// cout << "Index Array in VBO: " << bufferSize << " bytes\n";
-
-	glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0);
+
+	///////////
+	//-- the index array
+
+	if (mIndices)
+	{
+		glGenBuffersARB(1, &mVboId2);
+
+		glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, mVboId2);
+		glBufferDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB, mNumVertices * sizeof(unsigned int), 
+			mIndices, GL_STATIC_DRAW_ARB);
+
+		int bufferSize;
+		glGetBufferParameterivARB(GL_ELEMENT_ARRAY_BUFFER_ARB, GL_BUFFER_SIZE_ARB, &bufferSize);
+		//cout << "Index Array in VBO: " << bufferSize << " bytes\n" << "id: " << mVboId2 << endl;
+
+		glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0);
+	}
 
 	// data handled by graphics driver from now on
@@ -175,5 +185,4 @@
 	{
 		glBindBufferARB(GL_ARRAY_BUFFER_ARB, mVboId);
-		//glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, mVboId2);
 
 		int currentPointer;
@@ -182,11 +191,6 @@
 		if (mHasTangents)
 		{
-			//glClientActiveTextureARB(GL_TEXTURE1_ARB);
-			//glTexCoordPointer(2, GL_FLOAT, (char *)NULL + mNumVertices * sizeof(Vector3));
-
 			glColorPointer(3, GL_FLOAT, 0, (char *)NULL + mNumVertices * 2 * sizeof(Vector3));
 			currentPointer = mNumVertices * 3 * sizeof(Vector3);
-			//glClientActiveTextureARB(GL_TEXTURE0_ARB);
-
 		}
 		else
@@ -201,4 +205,6 @@
 
 		glVertexPointer(3, GL_FLOAT, 0, (char *)NULL);	
+		//glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, mVboId2);
+
 		/// update state
 		state->SetCurrentVboId(mVboId);
@@ -206,9 +212,5 @@
 
 	glDrawArrays(GL_TRIANGLES, 0, mNumVertices);
-	//glDrawElements(GL_TRIANGLES, mNumVertices, GL_UNSIGNED_INT, mIndices);
 	//glDrawElements(GL_TRIANGLES, mNumVertices, GL_UNSIGNED_INT, 0); 
-
-	//glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
-	//glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0);
 
 	if (mHasTangents) glDisableClientState(GL_COLOR_ARRAY);
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Bvh.cpp
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Bvh.cpp	(revision 3293)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Bvh.cpp	(revision 3294)
@@ -658,5 +658,5 @@
 	{
 		glBindBufferARB(GL_ARRAY_BUFFER_ARB, mVboId);
-		//glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, mVboId2);
+		//glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0);
 
 		// set the vertex pointer to the vertex buffer
@@ -862,5 +862,5 @@
 		state->SetCurrentVboId(mVboId);
 	}
-
+	// update bounds of dynamic hierarchy
 	glBufferSubDataARB(GL_ARRAY_BUFFER_ARB, 0,
 					   bufferSize * sizeof(Vector3), 
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp	(revision 3292)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp	(revision 3294)
@@ -488,4 +488,5 @@
 		env.GetFloatParam(string("skyDomeScaleFactor"), skyDomeScaleFactor);
 		env.GetIntParam(string("visibilitySolutionInitialState"), visibilitySolutionInitialState);
+		env.GetIntParam(string("renderMode"), renderMode);
 		
 		//env.GetStringParam(string("modelPath"), model_path);
@@ -527,7 +528,8 @@
 		cout << "use skylight for illumination: " << useSkylightForIllum << endl;
 		cout << "sky dome scale factor: " << skyDomeScaleFactor << endl;
+		cout << "rendermode: " << renderMode << endl;
 
 		//cout << "model path: " << model_path << endl;
-		cout << "**** end parameters ****" << endl << endl;
+		cout << "==== end parameters ====" << endl << endl;
 	}
 
@@ -617,5 +619,5 @@
 	//LoadModel("sibenik.dem", dynamicObjects);
 
-	if (1) LoadPompeiiFloor();
+	if (0) LoadPompeiiFloor();
 
 #if 0
@@ -958,5 +960,5 @@
 	tr->SetMaxBatchSize(maxBatchSize);
 	tr->SetUseMultiQueries(useMultiQueries);
-	tr->SetUseTightBounds(useTightBounds);
+	tr->SetUseTightBounds((renderMode == RenderTraverser::CHCPLUSPLUS) && useTightBounds);
 	tr->SetUseDepthPass((renderMethod == RENDER_DEPTH_PASS) || (renderMethod == RENDER_DEPTH_PASS_DEFERRED));
 	tr->SetRenderQueue(renderQueue);
@@ -1331,6 +1333,4 @@
 		//	((PvsCollectionRenderer *)traverser)->SetViewCell(usePvs ? viewCell : NULL);
 
-		//renderState.LockCullFaceEnabled(true);
-
 		// actually render the scene geometry using the specified algorithm
 		traverser->RenderScene();
@@ -1641,5 +1641,5 @@
 	case 'B':
 		useTightBounds = !useTightBounds;
-		traverser->SetUseTightBounds(useTightBounds);
+		traverser->SetUseTightBounds((renderMode == RenderTraverser::CHCPLUSPLUS) && useTightBounds);
 		break;
 	case 'v':
@@ -2332,5 +2332,5 @@
 				{"forward", "depth pass + forward", "deferred shading", "depth pass + deferred"};
 			sprintf(msg[i ++], "multiqueries: %d, tight bounds: %d, render queue: %d", 
-					useMultiQueries, useTightBounds, useRenderQueue);
+					useMultiQueries, (renderMode == RenderTraverser::CHCPLUSPLUS) && useTightBounds, useRenderQueue);
 			sprintf(msg[i ++], "render technique: %s, use pvss: %d", renderMethodStr[renderMethod], usePvs);
 			sprintf(msg[i ++], "triangles per virtual leaf: %5d", trianglesPerVirtualLeaf);
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/MainApp.vcproj
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/MainApp.vcproj	(revision 3293)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/MainApp.vcproj	(revision 3294)
@@ -156,5 +156,5 @@
 				IgnoreAllDefaultLibraries="false"
 				IgnoreDefaultLibraryNames="LIBCMT"
-				GenerateDebugInformation="true"
+				GenerateDebugInformation="false"
 				SubSystem="1"
 				LargeAddressAware="2"
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/ps_memory_plot2
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/ps_memory_plot2	(revision 3287)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/ps_memory_plot2	(revision 3294)
@@ -23,6 +23,7 @@
 #echo set xrange \[100:20000\] >> $FILE
 #echo set xrange \[4200:4600\] >> $FILE
-#echo set xrange \[100:400\] >> $FILE
-echo set xrange \[1600:2100\] >> $FILE
+echo set xrange \[100:400\] >> $FILE
+echo set xrange \[1000:1600\] >> $FILE
+#echo set xrange \[1600:2100\] >> $FILE
 #echo set xrange \[3000:3500\] >> $FILE
 #echo set xrange \[1600:2000\] >> $FILE
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/plot_friendly
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/plot_friendly	(revision 3287)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/plot_friendly	(revision 3294)
@@ -9,4 +9,6 @@
 #PREFIX=pp_2
 PREFIX=myvienna
+PREFIX=vienna
+PREFIX=pp
 
 #FILES="$PREFIX-vfc.log $PREFIX_chc.log $PREFIX-vfc_pvs.log $PREFIX-chc++_b20.log $PREFIX-chc++_pvs_b20.log"
@@ -16,4 +18,5 @@
 #FILES="$PREFIX-chc.log $PREFIX-vfc_pvs.log $PREFIX-vfc_pvs_smaller.log $PREFIX-chc++.log $PREFIX-chc++_pvs.log $PREFIX-chc++_pvs_smaller.log"
 FILES="$PREFIX-vfc.log $PREFIX-vfc_pvs.log $PREFIX-chc++.log"
+FILES="$PREFIX-notindexed.log $PREFIX-indexed.log"
 #FILES="$PREFIX-vfc.log $PREFIX-chc++.log $PREFIX-vfc_pvs.log"
 
