Index: /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/ObjExporter.cpp
===================================================================
--- /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/ObjExporter.cpp	(revision 3272)
+++ /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/ObjExporter.cpp	(revision 3273)
@@ -53,10 +53,10 @@
 	 int numVertices = 0;
 
-	 BvhLeafContainer nodes;
-	 bvh->CollectLeaves(bvh->GetStaticRoot(), nodes);
+	 BvhNodeContainer nodes;
+	 bvh->CollectVirtualLeaves(bvh->GetStaticRoot(), nodes);
 
 	 cout << "writing " << nodes.size() << " objects ..." << endl; 
 
-	 BvhLeafContainer::const_iterator it, it_end = nodes.end();
+	 BvhNodeContainer::const_iterator it, it_end = nodes.end();
 
 	 int j = 0;
@@ -99,5 +99,5 @@
 	 for (int i = 0; i < numVertices; i += 3)
 	 {
-		 ostream << "f " << i + 2 << " " << i + 2 << " " << i + 3 << endl;
+		 ostream << "f " << i + 1 << " " << i + 2 << " " << i + 3 << endl;
 	 }
 
Index: /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
===================================================================
--- /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp	(revision 3272)
+++ /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp	(revision 3273)
@@ -148,4 +148,6 @@
 bool useSkylightForIllum = true;
 
+bool showFPS = true;
+
 static int globalVisibleId = 0;
 
@@ -724,6 +726,6 @@
 
 
-	//ObjExporter().Export(model_path + "myvienna.obj", bvh);
-	//BvhExporter().Export(model_path + "myvienna.bv", bvh);
+	ObjExporter().Export(model_path + "myvienna.obj", bvh);
+	BvhExporter().Export(model_path + "myvienna.bv", bvh);
 
 
@@ -1709,4 +1711,9 @@
 		if (!usePvs) SceneEntity::SetCurrentVisibleId(-1);
 		break;
+	case ',':
+		// show / hide FPS
+		showFPS = !showFPS;
+		break;
+	
 	default:
 		return;
@@ -2422,5 +2429,8 @@
 		
 		if (!showAlgorithmTime)
-			sprintf(msg[7], "%s:  %6.1f fps", alg_str[renderMode], fps);
+		{
+			if (showFPS)
+				sprintf(msg[7], "%s:  %6.1f fps", alg_str[renderMode], fps);
+		}
 		else
 			sprintf(msg[7], "%s:  %6.1f ms", alg_str[renderMode], rTime);
Index: /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/BvhExporter.cpp
===================================================================
--- /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/BvhExporter.cpp	(revision 3272)
+++ /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/BvhExporter.cpp	(revision 3273)
@@ -99,10 +99,10 @@
 	 ConstructTriangleRangeMap(bvh, bvh->GetStaticRoot(), first, last);
 
-	 BvhLeafContainer nodes;
-	 bvh->CollectLeaves(bvh->GetStaticRoot(), nodes);
+	 BvhNodeContainer nodes;
+	 bvh->CollectVirtualLeaves(bvh->GetStaticRoot(), nodes);
 
 	 vector<int> triangles;
 
-	 BvhLeafContainer::const_iterator it, it_end = nodes.end();
+	 BvhNodeContainer::const_iterator it, it_end = nodes.end();
 
 	 for (it = nodes.begin(); it != it_end; ++ it)
Index: /GTP/trunk/App/Demos/Vis/FriendlyCulling/default.env
===================================================================
--- /GTP/trunk/App/Demos/Vis/FriendlyCulling/default.env	(revision 3272)
+++ /GTP/trunk/App/Demos/Vis/FriendlyCulling/default.env	(revision 3273)
@@ -7,8 +7,8 @@
 # misc stuff
 
-#filename=vienna_full_hp
-#bvhname=vienna_full_hp
-filename=newvienna
-bvhname=newvienna
+filename=vienna_full_hp
+bvhname=vienna_full_hp
+#filename=newvienna
+#bvhname=newvienna
 #filename=procedural_pompeii_area6_hires/pompeii_full
 #filename=procedural_pompeii_area6_hires/pompeii_part
Index: /GTP/trunk/App/Demos/Vis/FriendlyCulling/VisibilitySolutionConverter/VisibilitySolutionConverter.cpp
===================================================================
--- /GTP/trunk/App/Demos/Vis/FriendlyCulling/VisibilitySolutionConverter/VisibilitySolutionConverter.cpp	(revision 3272)
+++ /GTP/trunk/App/Demos/Vis/FriendlyCulling/VisibilitySolutionConverter/VisibilitySolutionConverter.cpp	(revision 3273)
@@ -52,4 +52,5 @@
 {
 	vector<string> triples;
+
 	char *next_token;
 
@@ -60,5 +61,4 @@
 	{
 		string s(pch);
-		//s += "\n",
 		triples.push_back(s);
 		
@@ -66,27 +66,30 @@
 	}
 
+	// throw away last symbol (\n)
+	triples.back().resize(triples.back().size() - 1);
+
 	vector<int> indices;
 	vector<int> nIndices;
 	vector<int> tIndices;
 
-	char seps[] = " /\t\n";
+	char seps[] = " ";
+	char seps2[] = "/";
 
 	for (size_t i = 0; i < triples.size(); ++ i)
 	{
-		static int dummy = 0;
-
 		size_t found;
-		found = triples[i].find_first_of(seps);
+		found = triples[i].find_first_of(seps2);
 		size_t prevfound = 0;
-		// vertex, normal, texture indices
+
+		// extract vertex, normal, texture indices
 		string str = triples[i].substr(prevfound, found);
 
 		int index = (int)strtol(str.c_str(), NULL, 10) - 1;
-
 		int tIndex = index;
 		int nIndex = index;	
 		
-		prevfound = found;
-		found = triples[i].find_first_of(seps, found + 1);  
+		// try to extract texture and normal indices
+		prevfound = found + 1;
+		found = triples[i].find_first_of(seps2, prevfound);  
 
 		if (found != string::npos)
@@ -97,6 +100,6 @@
 			if (idx > 0) tIndex = idx;
 		}
-
-		if ((found + 1) < triples[i].size())
+		
+		if (found != string::npos)
 		{
 			str = triples[i].substr(found + 1);
