Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Geometry.cpp
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Geometry.cpp	(revision 3274)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Geometry.cpp	(revision 3276)
@@ -40,5 +40,5 @@
 	if (delData)
 	{
-		//DEL_ARRAY_PTR(mVertices);
+		DEL_ARRAY_PTR(mVertices);
 		DEL_ARRAY_PTR(mNormals);
 		DEL_ARRAY_PTR(mTexCoords);
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SkyPreetham.cpp
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SkyPreetham.cpp	(revision 3272)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SkyPreetham.cpp	(revision 3276)
@@ -109,6 +109,6 @@
 
 	// scale the sky dome so no intersection with the scene is visible
-	const float scaleFactor = 80.0f;
-	//const float scaleFactor = 1000.0f;
+	//const float scaleFactor = 80.0f;
+	const float scaleFactor = 1000.0f;
 
 	position.z -= 3.0f * scaleFactor;
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp	(revision 3274)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp	(revision 3276)
@@ -377,4 +377,6 @@
 void RenderViewCell();
 
+void LoadPompeiiScene();
+
 
 // new view projection matrix of the camera
@@ -597,63 +599,5 @@
 	//LoadModel("sibenik.dem", dynamicObjects);
 
-
-	AxisAlignedBox3 pompeiiBox = SceneEntity::ComputeBoundingBox(staticObjects);
-
-#if 1
-	// todo: dispose texture
-	Texture *floorTex = new Texture(model_path + "stairs.c.01.tif");
-
-	floorTex->SetBoundaryModeS(Texture::REPEAT);
-	floorTex->SetBoundaryModeT(Texture::REPEAT);
-
-	floorTex->Create();
-	Material *mymat = resourceManager->CreateMaterial();
-
-	Technique *tech = mymat->GetDefaultTechnique();
-	tech->SetDiffuse(RgbaColor(1, 1, 1, 1));
-	tech->SetTexture(floorTex);
-
-	Technique *depthPass = new Technique(*tech);
-	Technique *deferred = new Technique(*tech);
-
-	depthPass->SetColorWriteEnabled(false);
-	depthPass->SetLightingEnabled(false);
-
-	ShaderProgram *defaultFragmentTexProgramMrt = ShaderManager::GetSingleton()->GetShaderProgram("defaultFragmentTexMrt");
-	ShaderProgram *defaultVertexProgramMrt = ShaderManager::GetSingleton()->GetShaderProgram("defaultVertexMrt");
-
-	deferred->SetFragmentProgram(defaultFragmentTexProgramMrt);
-	deferred->SetVertexProgram(defaultVertexProgramMrt);
-
-	deferred->GetFragmentProgramParameters()->SetViewMatrixParam(0);
-	deferred->GetVertexProgramParameters()->SetModelMatrixParam(1);
-	deferred->GetVertexProgramParameters()->SetOldModelMatrixParam(2);
-
-	deferred->SetTexture(floorTex);
-	
-	mymat->AddTechnique(deferred);
-	mymat->AddTechnique(depthPass);
-
-
-	//const Vector3 offs(1300.0f, -2500.0f, .0f);
-	const Vector3 offs(pompeiiBox.Center(0), pompeiiBox.Center(1), 0);
-	Matrix4x4 moffs = TranslationMatrix(offs);
-
-	Plane3 plane;
-	Transform3 *mytrafo = resourceManager->CreateTransform(moffs);
-
-	SceneEntity *myplane = 
-		SceneEntityConverter().ConvertPlane(plane, 
-		                                    pompeiiBox.Size(0),
-											pompeiiBox.Size(1),
-											5, 
-											5,
-											mymat, 
-											mytrafo);
-
-	resourceManager->AddSceneEntity(myplane);
-	staticObjects.push_back(myplane);
-
-#endif
+	if (1) LoadPompeiiScene();
 
 #if 0
@@ -724,6 +668,6 @@
 
 
-	ObjExporter().Export(model_path + "mypompeii.obj", bvh);
-	BvhExporter().Export(model_path + "mypompeii.bv", bvh);
+	//ObjExporter().Export(model_path + "mypompeii.obj", bvh);
+	//BvhExporter().Export(model_path + "mypompeii.bv", bvh);
 
 
@@ -1461,5 +1405,6 @@
 			deferredShader->SetSaveFrame("", -1);		
 		}
-		//if (makeSnapShot) makeSnapShot = false;
+		
+		if (makeSnapShot) makeSnapShot = false;
 
 		ShadowMap *sm = showShadowMap ? shadowMap : NULL;
@@ -2397,5 +2342,5 @@
 			int i = 4;
 
-			if (0)
+			if (0) // q: show rendered objects or nodes (no space for both)
 			{
 				sprintf(msg[i ++], "rendered: %s of %s objects, %s of %s triangles", 
@@ -2408,5 +2353,5 @@
 			}
 
-			sprintf(msg[i ++], "traversed: %5d, frustum culled: %5d, query culled: %5d",
+			sprintf(msg[i ++], "traversed: %5d, frustum culled: %5d, query culled: %5d nodes",
 				traversedNodes, frustumCulledNodes, queryCulledNodes);
 			sprintf(msg[i ++], "issued queries: %5d, state changes: %5d, render batches: %5d", 
@@ -2429,10 +2374,15 @@
 		{
 			if (showFPS)
-				sprintf(msg[7], "%s:  %6.1f fps", alg_str[renderMode], fps);
+			{			
+				sprintf(msg[7], "%s:  %6.1f fps", alg_str[renderMode], fps);		
+				myfont.DrawString(msg[7], 1.3f, 690.0f, 760.0f);//, top_color, bottom_color);
+			}
 		}
 		else
+		{
 			sprintf(msg[7], "%s:  %6.1f ms", alg_str[renderMode], rTime);
-		
-		myfont.DrawString(msg[7], 1.3f, 690.0f, 760.0f);//, top_color, bottom_color);
+			myfont.DrawString(msg[7], 1.3f, 690.0f, 760.0f);//, top_color, bottom_color);
+		}
+
 		
 		//sprintf(msg[8], "algorithm time: %6.1f ms", rTime);
@@ -2516,5 +2466,5 @@
 	renderState.Reset();
 
-	PrintGLerror("visibleobjects");
+	PrintGLerror("visible objects");
 }
 
@@ -2537,5 +2487,5 @@
 
 	if (validIntersect) 
-		// && ((playerPos.z - oldPos.z) < bvh->GetBox().Size(2) * 1e-1f))
+		//&& ((playerPos.z - oldPos.z) < bvh->GetBox().Size(2) * 1e-1f))
 	{
 		camera->SetPosition(playerPos);
@@ -2743,2 +2693,62 @@
 	Visualization::RenderBoxForViz(viewCell->GetBox());
 }
+
+
+void LoadPompeiiScene()
+{
+	AxisAlignedBox3 pompeiiBox = SceneEntity::ComputeBoundingBox(staticObjects);
+
+	// todo: dispose texture
+	Texture *floorTex = new Texture(model_path + "stairs.c.01.tif");
+
+	floorTex->SetBoundaryModeS(Texture::REPEAT);
+	floorTex->SetBoundaryModeT(Texture::REPEAT);
+
+	floorTex->Create();
+	Material *mymat = resourceManager->CreateMaterial();
+
+	Technique *tech = mymat->GetDefaultTechnique();
+	tech->SetDiffuse(RgbaColor(1, 1, 1, 1));
+	tech->SetTexture(floorTex);
+
+	Technique *depthPass = new Technique(*tech);
+	Technique *deferred = new Technique(*tech);
+
+	depthPass->SetColorWriteEnabled(false);
+	depthPass->SetLightingEnabled(false);
+
+	ShaderProgram *defaultFragmentTexProgramMrt = ShaderManager::GetSingleton()->GetShaderProgram("defaultFragmentTexMrt");
+	ShaderProgram *defaultVertexProgramMrt = ShaderManager::GetSingleton()->GetShaderProgram("defaultVertexMrt");
+
+	deferred->SetFragmentProgram(defaultFragmentTexProgramMrt);
+	deferred->SetVertexProgram(defaultVertexProgramMrt);
+
+	deferred->GetFragmentProgramParameters()->SetViewMatrixParam(0);
+	deferred->GetVertexProgramParameters()->SetModelMatrixParam(1);
+	deferred->GetVertexProgramParameters()->SetOldModelMatrixParam(2);
+
+	deferred->SetTexture(floorTex);
+	
+	mymat->AddTechnique(deferred);
+	mymat->AddTechnique(depthPass);
+
+
+	//const Vector3 offs(1300.0f, -2500.0f, .0f);
+	const Vector3 offs(pompeiiBox.Center(0), pompeiiBox.Center(1), 0);
+	Matrix4x4 moffs = TranslationMatrix(offs);
+
+	Plane3 plane;
+	Transform3 *mytrafo = resourceManager->CreateTransform(moffs);
+
+	SceneEntity *myplane = 
+		SceneEntityConverter().ConvertPlane(plane, 
+		                                    pompeiiBox.Size(0),
+											pompeiiBox.Size(1),
+											5, 
+											5,
+											mymat, 
+											mytrafo);
+
+	resourceManager->AddSceneEntity(myplane);
+	staticObjects.push_back(myplane);
+}
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/ps_memory_plot2
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/ps_memory_plot2	(revision 3271)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/ps_memory_plot2	(revision 3276)
@@ -24,5 +24,5 @@
 #echo set xrange \[4200:4600\] >> $FILE
 #echo set xrange \[100:400\] >> $FILE
-echo set xrange \[1:1000\] >> $FILE
+echo set xrange \[1:500\] >> $FILE
 #echo set xrange \[1600:2000\] >> $FILE
 # echo set boxwidth 0.4 >> $FILE
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/toto.txt
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/toto.txt	(revision 3228)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/toto.txt	(revision 3276)
@@ -162,3 +162,34 @@
 
 
-implement dof
+make better DOF
+
+clouds
+
+god rays 
+
+animation
+
+
+################################
+## pompeii todo:
+
+1) improve performance:
+make better objects (jiri?)
+
+2) use better bvh code (also use size to handle floor plane)
+
+3) shading problems: 
+
+create own normals:
+
+flat normals
+use crease angles
+
+find out about degenerate vertices
+
+find out about missing texcoords
+
+
+#####################################
+
+fix shadows
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/plot_friendly
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/plot_friendly	(revision 3271)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/plot_friendly	(revision 3276)
@@ -7,5 +7,5 @@
 COMMAND3=./ps_memory_plot3
 
-PREFIX=pp
+PREFIX=pp_2
 
 #FILES="$PREFIX-vfc.log $PREFIX_chc.log $PREFIX-vfc_pvs.log $PREFIX-chc++_b20.log $PREFIX-chc++_pvs_b20.log"
@@ -13,5 +13,6 @@
 #FILES="$PREFIX-vfc.log $PREFIX-vfc_pvs.log $PREFIX-chc++.log $PREFIX-chc++_pvs.log"
 #FILES="$PREFIX-chc++.log $PREFIX-chc++_b20.log"
-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-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-chc.log $PREFIX-vfc_pvs.log $PREFIX-chc++.log $PREFIX-chc++_pvs.log"
 
 echo $FILES
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/default.env
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/default.env	(revision 3274)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/default.env	(revision 3276)
@@ -11,8 +11,8 @@
 #filename=newvienna
 #bvhname=newvienna
-filename=procedural_pompeii_area6_hires/pompeii_full
-#filename=procedural_pompeii_area6_hires/pompeii_part
-#filename=city
-#bvhname=city
+filename=pompeii/pompeii_full
+#filename=pompeii/pompeii_part
+filename=city
+bvhname=city
 useLODs=1
 # shadow map size
@@ -22,5 +22,6 @@
 # the filename for the statistics
 statsFilename=mystats.log
-walkThroughSuffix=path_pp
+walkThroughSuffix=walkthrough_pp_1
+#walkThroughSuffix=path_pp
 
 # use potentially visible sets?
@@ -55,7 +56,10 @@
 
 # initial camera position
-#camPosition=483.398f 242.364f 186.078f
+camPosition=483.398f 242.364f 186.078f
 # pompeii view point
-camPosition=1300.0f -2500.0f 10.0f
+#camPosition=1300.0f -2500.0f 10.0f
+# pompeii problematic
+#camPosition=627.003 -1725.33 25.2
+#camDirection=-0.761538 0.64812 -0
 
 # initial camera orientation
@@ -92,14 +96,10 @@
 # tone mapping
 useHDR=0
-
 # use antialiasing
 useAA=0
-
 # show lense flare
 useLenseFlare=1
-
 # use ssao / color bleeding
 useAdvancedShading=1
-
 # skylight turbitity
 turbitity=3.0f
@@ -130,5 +130,4 @@
 #bvhname=PowerPlantM
 #keyForwardMotion=500.0f
-#mouseMotion=3.0f
 #visibilitySolution=power-plant-2c-xx-1000b-pgv2
 #visibilitySolution=power-plant-2c-xx-1000d-pgv
