Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/include/QueryManager.h
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/include/QueryManager.h	(revision 1251)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/include/QueryManager.h	(revision 2255)
@@ -55,5 +55,6 @@
 			    MeshInfoContainer *visibleGeometry,
 				PatchInfoContainer *visiblePatches,
-			    bool relativeVisibility = false
+			    const bool relativeVisibility,
+				const bool approximateVisibility
 			    ) = 0;
     
@@ -67,5 +68,6 @@
 			       MeshInfoContainer *visibleGeometry,
 				   PatchInfoContainer *visiblePatches,
-			       bool relativeVisibility = false
+			       const bool relativeVisibility,
+				   const bool approximateVisibility
 			       ) = 0;
     
Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/include/DummyQueryManager.h
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/include/DummyQueryManager.h	(revision 2171)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/include/DummyQueryManager.h	(revision 2255)
@@ -10,9 +10,9 @@
 	hierarchy as visible node.
 */
-class DummyQueryManager : public QueryManager
+class DummyQueryManager: public QueryManager
 {
 public:
     /** Constructor taking a scene traverser for a specific type of hierarchyInterface
-	as argument. 
+		as argument. 
     */
     DummyQueryManager( HierarchyInterface *hierarchyInterface ):
@@ -22,18 +22,20 @@
        @sa QueryManager::ComputeCameraVisibility()
      */
-    virtual void  ComputeCameraVisibility(const Camera &camera,
-										  NodeInfoContainer *visibleNodes,
-										  MeshInfoContainer *visibleGeometry,
-										  PatchInfoContainer *visiblePatches,
-										  bool relativeVisibility = false);
+    virtual void ComputeCameraVisibility(const Camera &camera,
+										 NodeInfoContainer *visibleNodes,
+										 MeshInfoContainer *visibleGeometry,
+										 PatchInfoContainer *visiblePatches,
+										 const bool relativeVisibility,
+										 const bool approximateVisibility);
     
     /**
        @sa QueryManager::ComputeFromPointVisibility()
-     */
+    */
     virtual void ComputeFromPointVisibility(const Vector3 &point,
 										    NodeInfoContainer *visibleNodes,
 											MeshInfoContainer *visibleGeometry,
 											PatchInfoContainer *visiblePatches,
-											bool relativeVisibility = false);
+											const bool relativeVisibility,
+											const bool approximateVisibility);
 };
   
Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/scripts/terrainCulling.cfg
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/scripts/terrainCulling.cfg	(revision 2254)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/scripts/terrainCulling.cfg	(revision 2255)
@@ -12,11 +12,42 @@
 #
 
-DepthPass=0
+DepthPass=yes
 
 #
-# render queue is flushed after some frames
+# If vertex programs should be executed even in the depth pass. 
+# This options but is necessary if vertex shader alters geometry. But it can slow down the depth pass.
+
+ExecuteVertexProgramForDepth=no
+
+#
+# render queue is flushed after some frames (can improve performance)
 #
 
-FlushQueue=1
+FlushQueue=yes
+
+##########################################################
+
+#
+# Settings for visible objects queries (used by _findVisibleObjects method of the scene manager)
+#
+
+# if visibility based queries should be applied instead of standard Octree SceneManager findvisibleobjects based
+# on frustum culling only
+
+UseVisibilityQueries=yes
+
+
+# For visibility based queries: the modes go from exact (exact visibility but slow) 
+# to node (exact visibility on node level, faster) to approximate (fastest but only approximate visibility)
+
+#QueryObjectsMode=EXACT
+QueryObjectsMode=NODE
+#QueryObjectsMode=APPROXIMATE;
+	
+
+# If queries should use no material for rendering. 
+# Don't use this option if vertex program / fragment program changes geometry
+
+ResetMaterialForQueries=no
 
 
@@ -25,5 +56,5 @@
 
 #
-#  Settings for iv scene (vienna)
+#  Scene geometry loading
 #
 
@@ -40,5 +71,14 @@
 
 #
-# Visibility solution
+# use this option to render only terrain
+#
+
+Scene=terrain
+
+
+######################################################
+
+#
+# Visibility solution (works not yet with terrain)
 #
 
@@ -46,22 +86,11 @@
 
 
-######################################################################
 
+##################################################################
 #
-#  Settings for terrain scene
-#
-
-Scene=terrain
-
-#
-# should render queue be flushed after each frame?
+# Terrain scene manager settings
 #
 
 
-###########################################
-#
-# Terrain scene manager settings
-#
-#########################################
 
 # The main world texture (if you wish the terrain manager to create a material for you)
Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreOcclusionCullingSceneManager.h
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreOcclusionCullingSceneManager.h	(revision 2254)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreOcclusionCullingSceneManager.h	(revision 2255)
@@ -191,8 +191,8 @@
 	void _renderScene(Camera* camera, Viewport* vp, bool includeOverlays);
 
-	int FindExactVisibleObjects(Camera *camera,
-								Viewport* vp,
-								const bool fromPoint,
-								const bool nodeVisibility);	
+	int QueryVisibleObjectsExact(Camera *camera,
+								 Viewport* vp,
+								 const bool fromPoint,
+								 const bool nodeVisibility);	
 
 	void AddVisibleMeshGeometryToQueue(const GtpVisibility::MeshInfoContainer &visibleGeometry, 
@@ -299,4 +299,8 @@
 	int mCurrentFrame;
 
+	int mQueryMode;
+	
+	enum {EXACT_QUERIES, NODE_QUERIES, APPROXIMATE_QUERIES};
+
 	ObjReader *mObjReader;
 
@@ -305,7 +309,5 @@
 	bool mUseFromPointQueries;
 
-	bool mUseExactQueries;
-	
-	bool mUseDepthPassForQueries;
+	bool mResetMaterialForQueries;
 };
 
Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreOcclusionQueriesQueryManager.h
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreOcclusionQueriesQueryManager.h	(revision 2171)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreOcclusionQueriesQueryManager.h	(revision 2255)
@@ -15,6 +15,8 @@
 		on different hierarchy types, while reusing the implementation of the query methods.
     */
-	OcclusionQueriesQueryManager(GtpVisibility::HierarchyInterface *hierarchyInterface, Viewport *vp,
-								 int queryModes, int itemBufferMode);
+	OcclusionQueriesQueryManager(GtpVisibility::HierarchyInterface *hierarchyInterface, 
+								 Viewport *vp,
+								 int queryModes, 
+								 int itemBufferMode);
     
     void ComputeCameraVisibility(const Camera &camera,
@@ -22,5 +24,6 @@
 								 GtpVisibility::MeshInfoContainer *visibleGeometry,
 								 GtpVisibility::PatchInfoContainer *visiblePatches,
-								 bool relativeVisibility = false);
+								 const bool relativeVisibility,
+								 const bool approximateVisibility);
     
     /** 
@@ -32,5 +35,6 @@
 									GtpVisibility::MeshInfoContainer *visibleGeometry,
 									GtpVisibility::PatchInfoContainer *visiblePatches,
-									bool relativeVisibility = false);
+									const bool relativeVisibility,
+									const bool approximateVisibility);
     
 
Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgrePlatformQueryManager.h
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgrePlatformQueryManager.h	(revision 925)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgrePlatformQueryManager.h	(revision 2255)
@@ -18,5 +18,6 @@
     */
 	PlatformQueryManager(GtpVisibility::HierarchyInterface *hierarchyInterface, 
-		                 Viewport *vp, int queryModes);
+		                 Viewport *vp, 
+						 int queryModes);
     
     /** 
@@ -25,14 +26,16 @@
     */
     void ComputeFromPointVisibility(const Vector3 &point,
-			       GtpVisibility::NodeInfoContainer *visibleNodes,
-			       GtpVisibility::MeshInfoContainer *visibleGeometry,
-				   GtpVisibility::PatchInfoContainer *visiblePatches,
-			       bool relativeVisibility = false);
+									GtpVisibility::NodeInfoContainer *visibleNodes,
+									GtpVisibility::MeshInfoContainer *visibleGeometry,
+									GtpVisibility::PatchInfoContainer *visiblePatches,
+									const bool relativeVisibility,
+									const bool approximateVisibility);
   
 	void ComputeCameraVisibility(const Camera &camera,
-			       GtpVisibility::NodeInfoContainer *visibleNodes,
-			       GtpVisibility::MeshInfoContainer *visibleGeometry,
-				   GtpVisibility::PatchInfoContainer *visiblePatches,
-			       bool relativeVisibility = false);
+								 GtpVisibility::NodeInfoContainer *visibleNodes,
+								 GtpVisibility::MeshInfoContainer *visibleGeometry,
+								 GtpVisibility::PatchInfoContainer *visiblePatches,
+								 const bool relativeVisibility,
+								 const bool approximateVisibility);
   
 	bool ShootRay(const Ray &ray, std::vector<Mesh *> *visibleMeshes, bool isGlobalLine = false);  
Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgrePlatformQueryManager.cpp
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgrePlatformQueryManager.cpp	(revision 2184)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgrePlatformQueryManager.cpp	(revision 2255)
@@ -33,5 +33,6 @@
 					GtpVisibility::MeshInfoContainer *visibleGeometry,
 					GtpVisibility::PatchInfoContainer *visiblePatches,
-					bool relativeVisibility)
+					const bool relativeVisibility,
+					const bool approximateVisibility)
 {
 	SceneManager *sm =
@@ -87,5 +88,6 @@
 								visibleGeometry, 
 								visiblePatches, 
-			                    relativeVisibility);
+			                    relativeVisibility,
+								approximateVisibility);
 		//mViewport->getTarget()->update(); for(int j=0; j<10000000; j++)	printf("wait");
 
@@ -102,9 +104,10 @@
 //-----------------------------------------------------------------------
 void PlatformQueryManager::ComputeCameraVisibility(
-								const Camera &camera,
-								GtpVisibility::NodeInfoContainer *visibleNodes,
-								GtpVisibility::MeshInfoContainer *visibleGeometry,
-								GtpVisibility::PatchInfoContainer *visiblePatches,
-								bool relativeVisibility)
+									const Camera &camera,
+									GtpVisibility::NodeInfoContainer *visibleNodes,
+									GtpVisibility::MeshInfoContainer *visibleGeometry,
+									GtpVisibility::PatchInfoContainer *visiblePatches,
+									const bool relativeVisibility,
+									const bool approximateVisibility)
 {
 	// we need access to the scene manager and the rendersystem
Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/Plugin_VisibilitySceneManager.vcproj
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/Plugin_VisibilitySceneManager.vcproj	(revision 2254)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/Plugin_VisibilitySceneManager.vcproj	(revision 2255)
@@ -53,5 +53,4 @@
 				Name="VCPostBuildEventTool"
 				CommandLine="copy $(OutDir)\$(TargetFileName) $(OGRE_PATH)\Samples\Common\bin\$(ConfigurationName)
-copy $(OutDir)\$(TargetFileName) E:\svn\gametools\GTP\trunk\App\Demos\Illum\Ogre\bin\$(ConfigurationName)
 "/>
 			<Tool
@@ -125,5 +124,4 @@
 				Name="VCPostBuildEventTool"
 				CommandLine="copy $(OutDir)\$(TargetFileName) $(OGRE_PATH)\Samples\Common\bin\$(ConfigurationName)
-copy $(OutDir)\$(TargetFileName) E:\svn\gametools\GTP\trunk\App\Demos\Illum\Ogre\bin\$(ConfigurationName)
 "/>
 			<Tool
Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionCullingSceneManager.cpp
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionCullingSceneManager.cpp	(revision 2254)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionCullingSceneManager.cpp	(revision 2255)
@@ -67,8 +67,8 @@
 mFlushRate(10),
 mCurrentFrame(0),
-mUseVisibilityQueries(false),
+mUseVisibilityQueries(true),
 mUseFromPointQueries(false),
-mUseExactQueries(false),
-mUseDepthPassForQueries(false)
+mQueryMode(NODE_QUERIES),
+mResetMaterialForQueries(false)
 {
 	Ogre::LogManager::getSingleton().
@@ -245,22 +245,24 @@
 	}
 
-	val = config.getSetting("UseExactQueries");
+	val = config.getSetting("QueryObjectsMode");
 
 	if (!val.empty())
 	{
+		if (val == "EXACT")
+			mQueryMode = EXACT_QUERIES;
+		else if (val == "NODE")
+			mQueryMode = NODE_QUERIES;
+		else 
+			mQueryMode = APPROXIMATE_QUERIES;
+	}
+
+	val = config.getSetting("ResetMaterialForQueries");
+
+	if (!val.empty())
+	{
 		if (val == "yes")
-			mUseExactQueries = true;
+			mResetMaterialForQueries = true;
 		else
-			mUseExactQueries = false;
-	}
-
-	val = config.getSetting("UseDepthPassForQueries");
-
-	if (!val.empty())
-	{
-		if (val == "yes")
-			mUseDepthPassForQueries = true;
-		else
-			mUseDepthPassForQueries = false;
+			mResetMaterialForQueries = false;
 	}
 
@@ -314,4 +316,5 @@
 			algorithm = 
 				GtpVisibility::VisibilityEnvironment::COHERENT_HIERARCHICAL_CULLING;
+			LogManager::getSingleton().logMessage("Using chc algorithm");
 		}
 		else if (val == "SWC")
@@ -319,4 +322,6 @@
 			 algorithm = 
 				 GtpVisibility::VisibilityEnvironment::STOP_AND_WAIT_CULLING;
+
+			 LogManager::getSingleton().logMessage("Using stop and wait algorithm");
 		 }
 		 else if (val == "VFC")
@@ -324,4 +329,6 @@
 			 algorithm = 
 				 GtpVisibility::VisibilityEnvironment::FRUSTUM_CULLING;
+
+			 LogManager::getSingleton().logMessage("Using frustum culling algorithm");
 		 }
 		 else // default rendering
@@ -331,15 +338,49 @@
 
 			 mNormalExecution = true;
+			 LogManager::getSingleton().logMessage("Using default octree scene manager rendering");
 		 }
 
 		 mVisibilityManager->SetCullingManager(algorithm);
-
-		 stringstream d;
-		 d << "setting algorithm to: " << algorithm;
-		 LogManager::getSingleton().logMessage(d.str());
 	}
 
 	/////////////
 	// terrain options
+
+	if (mUseDepthPass)
+		LogManager::getSingleton().logMessage("using depth pass");
+	else
+		LogManager::getSingleton().logMessage("not using depth pass");
+	
+	if (mExecuteVertexProgramForAllPasses)
+		LogManager::getSingleton().logMessage("executing vertex program for passes");
+	else
+		LogManager::getSingleton().logMessage("not executing vertex program for passes");
+
+	if (mUseVisibilityQueries)
+		LogManager::getSingleton().logMessage("using visibility queries");
+	else
+		LogManager::getSingleton().logMessage("not using visibility queries");
+
+	if (mUseFromPointQueries)
+		LogManager::getSingleton().logMessage("using from point queries");
+	else
+		LogManager::getSingleton().logMessage("not using from point queries");
+
+	if (mQueryMode == EXACT_QUERIES)
+		LogManager::getSingleton().logMessage("using exact queries");
+	else if (mQueryMode == NODE_QUERIES)
+		LogManager::getSingleton().logMessage("using node queries");
+	else if (mQueryMode == APPROXIMATE_QUERIES)
+		LogManager::getSingleton().logMessage("using approximate queries");
+
+	if (mResetMaterialForQueries)
+		LogManager::getSingleton().logMessage("resetting material for queries");
+	else
+		LogManager::getSingleton().logMessage("resetting material for queries");
+
+	if (mDeleteQueueAfterRendering)
+		LogManager::getSingleton().logMessage("flushing queue after some frames");
+	else
+		LogManager::getSingleton().logMessage("not flushing queue after some frames");
 
 	if (!mShowTerrain)
@@ -449,39 +490,5 @@
 	selectPageSource(pageSourceName, optlist);
 
-	if (mUseDepthPass)
-		LogManager::getSingleton().logMessage("using depth");
-	else
-		LogManager::getSingleton().logMessage("not using depth");
-	
-	if (mExecuteVertexProgramForAllPasses)
-		LogManager::getSingleton().logMessage("executing vertex program for passes");
-	else
-		LogManager::getSingleton().logMessage("not executing vertex program for passes");
-
-	if (mUseVisibilityQueries)
-		LogManager::getSingleton().logMessage("using visibility queries");
-	else
-		LogManager::getSingleton().logMessage("not using visibility queries");
-
-	if (mUseFromPointQueries)
-		LogManager::getSingleton().logMessage("using from point queries");
-	else
-		LogManager::getSingleton().logMessage("not using from point queries");
-
-	if (mUseExactQueries)
-		LogManager::getSingleton().logMessage("using exact queries");
-	else
-		LogManager::getSingleton().logMessage("not using exact queries");
-
-	if (mUseDepthPassForQueries)
-		LogManager::getSingleton().logMessage("using depth pass for queries");
-	else
-		LogManager::getSingleton().logMessage("not using depth pass for queries");
-
-	if (mDeleteQueueAfterRendering)
-		LogManager::getSingleton().logMessage("flushing queue after rendering");
-	else
-		LogManager::getSingleton().logMessage("not flushing queue after rendering");
-
+	
 	LogManager::getSingleton().logMessage("****** OcclusionCullingSceneManager Options Finished ********");
 }
@@ -1126,13 +1133,13 @@
 		return true;
 	}
-	if (key == "UseExactQueries")
-	{
-		mUseExactQueries = *static_cast<const bool *>(val);
-
-		return true;
-	}
-	if (key == "UseDepthPassForQueries")
-	{
-		mUseDepthPassForQueries = *static_cast<const bool *>(val);
+	if (key == "QueryMode")
+	{
+		mQueryMode = *static_cast<const int *>(val);
+
+		return true;
+	}
+	if (key == "ResetMaterialForQueries")
+	{
+		mResetMaterialForQueries = *static_cast<const bool *>(val);
 	}
 	if (key == "UseFromPointQueries")
@@ -1192,4 +1199,5 @@
 		return true;
 	}
+
 	if (key == "VisibleObjects")
 	{ 
@@ -1201,8 +1209,8 @@
 		
 		* static_cast<unsigned int *>(val) = 
-			(unsigned int)FindExactVisibleObjects(mCameraInProgress, 
-												  mCurrentViewport, 
-												  fromPoint, 
-												  nodeVisibility);
+			(unsigned int)QueryVisibleObjectsExact(mCameraInProgress, 
+												   mCurrentViewport, 
+												   fromPoint, 
+												   nodeVisibility);
 		return true;
 	}
@@ -1865,7 +1873,7 @@
 	int i = 0;
 
-	if (filename == "terrain")
-	{
-		LogManager::getSingleton().logMessage("loading terrain");
+	if (filename == "terrain" || filename == "")
+	{
+		LogManager::getSingleton().logMessage("not loading scene");
 
 		// terrain hack
@@ -2203,11 +2211,12 @@
 }
 //-----------------------------------------------------------------------
-int OcclusionCullingSceneManager::FindExactVisibleObjects(Camera *camera,
-														  Viewport* vp,
-														  const bool fromPoint,
-														  const bool nodeVisibility)
+int OcclusionCullingSceneManager::QueryVisibleObjectsExact(Camera *camera,
+														   Viewport* vp,
+														   const bool fromPoint,
+														   const bool nodeVisibility)
 {
 	const int itemBufferMode = 0;
 	const bool relativeVisibility = false;
+	const bool approximateVisibility = false;
 
 	int queryModes = 0;
@@ -2236,5 +2245,6 @@
 												 &visibleGeometry, 
 												 &visiblePatches, 
-												 relativeVisibility);
+												 relativeVisibility,
+												 approximateVisibility);
 	}
 	else
@@ -2244,5 +2254,6 @@
 											  &visibleGeometry, 
 											  &visiblePatches, 
-											  relativeVisibility);
+											  relativeVisibility,
+											  approximateVisibility);
 	}
 		
@@ -2489,5 +2500,5 @@
 	// note:have to disable deph write for nodes!
     bool savedUseDepthPass = mUseDepthPass;
-	if (mUseDepthPassForQueries) mUseDepthPass = true;
+	if (mResetMaterialForQueries) mUseDepthPass = true;
 
 	// lists only used for visualization
@@ -2498,11 +2509,21 @@
 	const int itemBufferMode = 0;
 	const bool relativeVisibility = false;
+	bool approximateVisibility = false;
 
 	int queryModes = 0;
 
-	if (mUseExactQueries)
+	if (mQueryMode != 0)
+	{
+		queryModes |= GtpVisibility::QueryManager::NODE_VISIBILITY;
+
+		if (mQueryMode == 2)
+		{
+			approximateVisibility = true;
+		}
+	}
+	else
+	{
 		queryModes |= GtpVisibility::QueryManager::GEOMETRY_VISIBILITY;
-	else
-		queryModes |= GtpVisibility::QueryManager::NODE_VISIBILITY;
+	}	
 			
 
@@ -2526,5 +2547,6 @@
 												 &visibleGeometry, 
 												 &visiblePatches, 
-												 relativeVisibility);
+												 relativeVisibility,
+												 approximateVisibility);
 	}
 	else
@@ -2534,5 +2556,6 @@
 											  &visibleGeometry, 
 											  &visiblePatches, 
-											  relativeVisibility);
+											  relativeVisibility,
+											  approximateVisibility);
 	}
 		
@@ -2550,14 +2573,14 @@
 	//-- put items in render queue
 	
-	if (mUseExactQueries)
+	if (mQueryMode != EXACT_QUERIES)
 	{
 		////////////
 		//-- apply queries on geometry level
 
+		AddVisibleNodeGeometryToQueue(visibleNodes, cam);
+	}
+	else
+	{
 		AddVisibleMeshGeometryToQueue(visibleGeometry, cam);
-	}
-	else
-	{
-		AddVisibleNodeGeometryToQueue(visibleNodes, cam);
 	}
 
Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionQueriesQueryManager.cpp
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionQueriesQueryManager.cpp	(revision 2254)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionQueriesQueryManager.cpp	(revision 2255)
@@ -28,5 +28,6 @@
 											GtpVisibility::MeshInfoContainer *visibleGeometry,
 											GtpVisibility::PatchInfoContainer *visiblePatches,
-											bool relativeVisibility)
+											const bool relativeVisibility,
+											const bool approximateVisibility)
 {
 	// we need access to the scene manager and the rendersystem
@@ -37,11 +38,10 @@
 	bool overlayEnabled = mViewport->getOverlaysEnabled();
 
-	///////////
-	//-- render scene with item buffer (i.e., objects with their id as color codes)
-
 	//mItemBufferMode = 0;
-	if (0 && 
-		(mItemBufferMode && mQueryModes) != 0)
-	{
+	if (0 && (mItemBufferMode && mQueryModes) != 0)
+	{
+		///////////
+		//-- render scene with item buffer (ids are used as color codes)
+
 		int savedQueryModes = mQueryModes;
 		mQueryModes = mItemBufferMode;
@@ -51,5 +51,6 @@
 													  visibleGeometry, 
 													  visiblePatches, 
-													  relativeVisibility);
+													  relativeVisibility,
+													  approximateVisibility);
 		
 		// overlays cause false visibility
@@ -175,6 +176,6 @@
 			pfHierarchyInterface->CheckFrustumVisible(*nodeIt, intersects);
 
-			// always push back if intersects
-			if (1 && intersects)
+			// always push back if only checking approximate visibility or intersects
+			if (approximateVisibility || intersects)
 			{
 				// no more information available
@@ -185,5 +186,5 @@
 				queryList[i].push_back(NULL);
 			}
-			else
+			else // issue occlusion query
 			{
 				queryList[i].push_back(mHierarchyInterface->IssueNodeOcclusionQuery(*nodeIt, false));
@@ -200,5 +201,16 @@
 			for (geometryIt = geometryList.begin(); geometryIt != geometryIt_end; ++ geometryIt)
 			{
-				queryList[i].push_back(pfHierarchyInterface->IssueMeshOcclusionQuery(*geometryIt));
+				if (approximateVisibility)
+				{
+					// no more information available
+					const int visPixels = 1;
+					const int projPixels = 1;
+
+					visibleGeometry->push_back(GtpVisibility::MeshInfo(*geometryIt, visPixels, projPixels));
+				}
+				else
+				{
+					queryList[i].push_back(pfHierarchyInterface->IssueMeshOcclusionQuery(*geometryIt));
+				}
 			}
 		}
@@ -211,5 +223,16 @@
 			for (patchIt = patchList.begin(); patchIt != patchIt_end; ++patchIt)
 			{
-				queryList[i].push_back(pfHierarchyInterface->IssuePatchOcclusionQuery(*patchIt));
+				if (approximateVisibility)
+				{
+					// no more information available
+					const int visPixels = 1;
+					const int projPixels = 1;
+
+					visiblePatches->push_back(GtpVisibility::PatchInfo(*patchIt, visPixels, projPixels));
+				}
+				else
+				{
+					queryList[i].push_back(pfHierarchyInterface->IssuePatchOcclusionQuery(*patchIt));
+				}
 			}
 		}
@@ -284,5 +307,6 @@
 								GtpVisibility::MeshInfoContainer *visibleGeometry,
 								GtpVisibility::PatchInfoContainer *visiblePatches,
-								bool relativeVisibility)
+								const bool relativeVisibility,
+								const bool approximateVisibility)
 {
 	PlatformQueryManager::ComputeFromPointVisibility(point, 
@@ -290,5 +314,6 @@
 													 visibleGeometry, 
 													 visiblePatches, 
-													 relativeVisibility);
+													 relativeVisibility,
+													 approximateVisibility);
 
 	// adds up their visibility and removes duplicates 
Index: GTP/trunk/Lib/Vis/Preprocessing/scripts/gi_final.sh
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/scripts/gi_final.sh	(revision 2232)
+++ GTP/trunk/Lib/Vis/Preprocessing/scripts/gi_final.sh	(revision 2255)
@@ -13,11 +13,10 @@
 SCENE_PATH=../data/vienna
 
-#SCENE=arena-high-lods.obj
+#SCENE=arena-high-lods
 #SCENE_PATH=../data/Arena
 
 ENVIRONMENT=gi_final.env
 
-LOG_PREFIX=../scripts/tests/gi/$SCENE
-#LOG_PREFIX=../scripts/tests/gi/vienna_cropped3
+LOG_PREFIX=../scripts/tests/gi/$SCENE-speed
 
 echo "starting $TARGET mode for $SCENE scene ($PROGRAM)"
@@ -32,5 +31,5 @@
 
 
-$PROGRAM $ENVIRONMENT \
+#$PROGRAM $ENVIRONMENT \
   -scene_filename=$SCENE_FILENAME \
   -view_cells_sampling_type=object_directional \
@@ -42,16 +41,15 @@
   -hierarchy_subdivision_stats=$LOG_PREFIX-$METHOD-hierarchy-subdivisionStats.log \
   -hierarchy_construction_type=2 \
-  -hierarchy_construction_min_avg_rays_per_object=1 \
-  -hierarchy_construction_max_avg_rays_per_object=20 \
+  -hierarchy_construction_min_avg_rays_per_object=0 \
+  -hierarchy_construction_max_avg_rays_per_object=0 \
   -bvh_use_sah=false \
   -vsp_use_cost_heuristics=$USE_HEUR
 
-sh movefiles.sh $LOG_PREFIX-$METHOD
-
-
+#sh movefiles.sh $LOG_PREFIX-$METHOD
 
 #######################################################
 
-NODES=50000
+NODES=60000
+#NODES=5000
 USE_HEUR=true
 #USE_HEUR=false
@@ -61,5 +59,5 @@
 
 $PROGRAM $ENVIRONMENT \
--scene_filename=$SCENE_FILENAME \
+  -scene_filename=$SCENE_FILENAME \
   -view_cells_evaluation_stats_prefix=$LOG_PREFIX-$METHOD \
   -view_cells_merge_stats=$LOG_PREFIX-$METHOD-mergeStats.log \
@@ -69,4 +67,5 @@
   -hierarchy_subdivision_stats=$LOG_PREFIX-$METHOD-hierarchy-subdivisionStats.log \
   -hierarchy_construction_type=0 \
+  -hierarchy_construction_consider_memory=false \
   -vsp_use_cost_heuristics=$USE_HEUR \
   -bvh_term_max_leaves=$NODES
@@ -85,5 +84,5 @@
 
 $PROGRAM $ENVIRONMENT \
--scene_filename=$SCENE_FILENAME \
+  -scene_filename=$SCENE_FILENAME \
   -view_cells_evaluation_stats_prefix=$LOG_PREFIX-$METHOD \
   -view_cells_merge_stats=$LOG_PREFIX-$METHOD-mergeStats.log \
@@ -93,8 +92,7 @@
   -hierarchy_subdivision_stats=$LOG_PREFIX-$METHOD-hierarchy-subdivisionStats.log \
   -hierarchy_construction_type=0 \
+  -hierarchy_construction_consider_memory=false \
   -vsp_use_cost_heuristics=$USE_HEUR \
   -bvh_term_max_leaves=$NODES
 
 sh movefiles.sh $LOG_PREFIX-$METHOD
-
-
Index: GTP/trunk/Lib/Vis/Preprocessing/scripts/gi_final.env
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/scripts/gi_final.env	(revision 2232)
+++ GTP/trunk/Lib/Vis/Preprocessing/scripts/gi_final.env	(revision 2255)
@@ -16,5 +16,5 @@
 
 Preprocessor {
-	samplesPerPass 3000000
+	samplesPerPass 500000
 	type vss
 	detectEmptyViewSpace true
@@ -163,5 +163,5 @@
 	Visualization {
 		# how much samples we use for visualization
-		samples 200
+		samples 0
 		exportRays true
 		exportGeometry true
@@ -173,18 +173,17 @@
 	}
 
-	showVisualization true
-	#showVisualization false
+	#showVisualization true
+	showVisualization false
+	#evaluateViewCells false
 	evaluateViewCells true
 	
 	Evaluation {
-		#samples         200000000
-		#samplesForStats 100000000
-		samples          60000000
-		samplesForStats  30000000
-
-		samplesPerPass  250000
-
-		#stepSize	500
-		stepSize	100
+		samples         100000000
+		samplesForStats 100000000
+		#samples          10000000
+		#samplesForStats  10000000
+
+		samplesPerPass  500000
+		stepSize	200
 
 		samplingType box
@@ -221,5 +220,5 @@
 
 	# maximum number of tests per node
-	maxTests 1000000
+	maxTests 500000
 }
 
@@ -251,5 +250,5 @@
 	splitUseOnlyDrivingAxis false
 
-	maxTests 50000000
+	maxTests 500000
 }
 
@@ -266,5 +265,5 @@
 	Construction {
 
-		samples 5000000
+		samples 6000000
 
 		# type 0 = sequential computation, 1 = interleaved, 2 = gradient
@@ -282,7 +281,7 @@
 		minStepsOfSameType 100
 		#maxStepsOfSameType 3000
-		maxStepsOfSameType 1000
-
-		maxRepairs 1000
+		maxStepsOfSameType 900
+
+		maxRepairs 2000
 	}
 
@@ -293,5 +292,5 @@
 		# maximal memory in MB
 #		maxMemory 4
-		maxMemory 30
+		maxMemory 35
 		# minimum ratio of global cost decrease
 		minGlobalCostRatio -1
Index: GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.vcproj
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.vcproj	(revision 2238)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.vcproj	(revision 2255)
@@ -197,4 +197,5 @@
 				OmitFramePointers="TRUE"
 				EnableFiberSafeOptimizations="TRUE"
+				WholeProgramOptimization="FALSE"
 				OptimizeForProcessor="3"
 				OptimizeForWindowsApplication="TRUE"
@@ -202,7 +203,8 @@
 				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;GTP_INTERNAL;USE_QT;USE_CG;USE_HASH_PV"
 				StringPooling="TRUE"
+				MinimalRebuild="TRUE"
 				ExceptionHandling="TRUE"
 				RuntimeLibrary="2"
-				EnableEnhancedInstructionSet="2"
+				EnableEnhancedInstructionSet="0"
 				RuntimeTypeInfo="FALSE"
 				UsePrecompiledHeader="0"
@@ -215,5 +217,5 @@
 				Name="VCLinkerTool"
 				AdditionalDependencies="xerces-c_2.lib glew32.lib zdll.lib zziplib.lib devil.lib glut32.lib OpenGL32.Lib glu32.lib Preprocessor.lib RTScene.lib RTWorld.lib QtCore4.lib qtmain.lib cg.lib cgGL.lib QtOpenGL4.lib Qt3Support4.lib QtTest4.lib QtGui4.lib QtInterface.lib"
-				OutputFile="../bin/release/Preprocessor2.exe"
+				OutputFile="../bin/release/Preprocessor.exe"
 				LinkIncremental="1"
 				AdditionalLibraryDirectories="..\src\GL;..\lib\release;..\..\Preprocessing\lib\release;..\..\..\..\..\..\NonGTP\Boost\lib;..\..\..\..\..\..\NonGTP\Xerces\xercesc\lib;..\..\..\..\..\..\NonGTP\Zlib\lib;..\..\..\..\..\..\NonGTP\Devil\lib;..\MultiLevelRayTracing\RTScene\Release;..\MultiLevelRayTracing\RTWorld\Release;&quot;$(QTDIR)\lib&quot;;.\QtInterface\Release;&quot;$(CG_LIB_PATH)&quot;"
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.icproj
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.icproj	(revision 2239)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.icproj	(revision 2255)
@@ -2,5 +2,5 @@
 <VisualStudioProject 
 	ProjectType="Intel C++ Project"
-	Version="9.0"
+	Version="9.1"
 	Name="Preprocessor"
 	ProjectGUID="{E240C450-69B9-4B01-A6FD-88F9466A3A88}"
@@ -221,5 +221,6 @@
 				IntermediateDirectory="..\obj\Release"
 				ConfigurationType="4"
-				CharacterSet="2"/>
+				CharacterSet="2"
+				WholeProgramOptimization="0"/>
 			<Tool 
 				Name="DebugTool"/>
@@ -237,7 +238,8 @@
 				AdditionalIncludeDirectories="..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;..\..\..\..\..\..\NonGTP\Boost;..\MultiLevelRayTracing;&quot;$(QTDIR)\include\QtCore&quot;;&quot;$(QTDIR)\include\QtGui&quot;;&quot;$(QTDIR)\include&quot;;&quot;$(QTDIR)\include\QtOpenGl&quot;;&quot;$(CG_INC_PATH)&quot;;Timer;..\src\sparsehash\src\google\sparsehash;..\src\sparsehash\src\windows;..\src\sparsehash\src\google;..\src\sparsehash\src;..\src\ootl\;..\src\ootl\src\;..\src\ootl\src\cpp;..\src\ootl\src\cpp\include\;..\src\ootl\src\include\ootl;..\src\ootl\src\include\ootl\sandbox;..\src\ootl\src\cpp\include\ootl\mswin"
 				PreprocessorDefinitions="WIN32;NDEBUG;_LIB;GTP_INTERNAL;USE_QT;USE_HASH_PV"
+				MinimalRebuild="1"
 				ExceptionHandling="1"
 				RuntimeLibrary="2"
-				EnableEnhancedInstructionSet="2"
+				EnableEnhancedInstructionSet="0"
 				DisableLanguageExtensions="0"
 				ForceConformanceInForLoopScope="0"
@@ -247,5 +249,7 @@
 				WarningLevel="2"
 				Detect64BitPortabilityProblems="1"
-				DebugInformationFormat="3"/>
+				DebugInformationFormat="3"
+				UseProcExt="2"
+				RequireProcExt="2"/>
 			<Tool 
 				Name="LinkerTool"
@@ -288,5 +292,5 @@
 				InlineFunctionExpansion="2"
 				EnableIntrinsicFunctions="1"
-				ImproveFloatingPointConsistency="1"
+				ImproveFloatingPointConsistency="0"
 				FavorSizeOrSpeed="1"
 				OmitFramePointers="1"
Index: GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.vcproj
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.vcproj	(revision 2239)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.vcproj	(revision 2255)
@@ -209,5 +209,6 @@
 			IntermediateDirectory="..\obj\Release"
 			ConfigurationType="4"
-			CharacterSet="2">
+			CharacterSet="2"
+			WholeProgramOptimization="TRUE">
 			<Tool
 				Name="VCCLCompilerTool"
@@ -219,11 +220,14 @@
 				OmitFramePointers="TRUE"
 				EnableFiberSafeOptimizations="TRUE"
+				WholeProgramOptimization="FALSE"
 				OptimizeForProcessor="3"
 				OptimizeForWindowsApplication="TRUE"
 				AdditionalIncludeDirectories="..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;..\..\..\..\..\..\NonGTP\Boost;..\MultiLevelRayTracing;&quot;$(QTDIR)\include\QtCore&quot;;&quot;$(QTDIR)\include\QtGui&quot;;&quot;$(QTDIR)\include&quot;;&quot;$(QTDIR)\include\QtOpenGl&quot;;&quot;$(CG_INC_PATH)&quot;;Timer;..\src\sparsehash\src\google\sparsehash;..\src\sparsehash\src\windows;..\src\sparsehash\src\google;..\src\sparsehash\src;..\src\ootl\;..\src\ootl\src\;..\src\ootl\src\cpp;..\src\ootl\src\cpp\include\;..\src\ootl\src\include\ootl;..\src\ootl\src\include\ootl\sandbox;..\src\ootl\src\cpp\include\ootl\mswin"
 				PreprocessorDefinitions="WIN32;NDEBUG;_LIB;GTP_INTERNAL;USE_QT;USE_HASH_PV"
+				StringPooling="TRUE"
+				MinimalRebuild="TRUE"
 				ExceptionHandling="TRUE"
 				RuntimeLibrary="2"
-				EnableEnhancedInstructionSet="2"
+				EnableEnhancedInstructionSet="0"
 				DisableLanguageExtensions="FALSE"
 				ForceConformanceInForLoopScope="FALSE"
Index: GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp	(revision 2239)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp	(revision 2255)
@@ -53,4 +53,5 @@
 /*              class BvhNode implementation                   */
 /***************************************************************/
+
 
 BvhNode::BvhNode(): 
@@ -705,5 +706,5 @@
 
 	const float oldVolume = EvalViewCellsVolume(*tData.mSampledObjects) / viewSpaceVol;
-	const float oldRatio = (tData.mVolume) > 0 ? oldVolume / tData.mVolume : 1;
+	const float oldRatio = (tData.mVolume > 0) ? oldVolume / tData.mVolume : 1;
 	const float parentVol = tData.mCorrectedVolume * oldRatio;
 
@@ -1826,6 +1827,7 @@
 				}
 			}
-		}
 #endif
+		}
+
 	}
 
@@ -3171,11 +3173,11 @@
 float BvHierarchy::GetRenderCostIncrementially(BvhNode *node) const
 {
-	if (node->mRenderCost < 0)
-	{
-		//cout <<"p";
+	if (node->mRenderCost < 0) // render cost must be evaluated ...
+	{
 		if (node->IsLeaf())
 		{
 			BvhLeaf *leaf = static_cast<BvhLeaf *>(node);
-			node->mRenderCost = EvalAbsCost(leaf->mObjects);
+			node->mRenderCost = EvalAbsCost(leaf->mObjects);		
+			//if (leaf->mObjects.size() < 100) cout <<"p";
 		}
 		else
Index: GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp	(revision 2239)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp	(revision 2255)
@@ -167,8 +167,8 @@
 
 	// mix of sampling strategies
-	if (0)
-	{
-		//mStrategies.push_back(SamplingStrategy::SPATIAL_BOX_BASED_DISTRIBUTION);
-		mStrategies.push_back(SamplingStrategy::OBJECT_DIRECTION_BASED_DISTRIBUTION);
+	if (1)
+	{
+		mStrategies.push_back(SamplingStrategy::SPATIAL_BOX_BASED_DISTRIBUTION);
+		//mStrategies.push_back(SamplingStrategy::OBJECT_DIRECTION_BASED_DISTRIBUTION);
 	}
 	else
@@ -2815,7 +2815,9 @@
 	
 	// check if last ray was not same ray with reverse direction
-	if (!lastVssRay ||
-		!(ray.mOrigin == lastVssRay->mTermination) ||
-		!(ray.mTermination == lastVssRay->mOrigin)) 
+	if (1) 
+		// tmp matt: don't use that before origin objects are accounted for, currently the second ray is lost!!
+		//!lastVssRay ||
+		//!(ray.mOrigin == lastVssRay->mTermination) ||
+		//!(ray.mTermination == lastVssRay->mOrigin)) 
 	{
 		viewCells.clear();
@@ -2823,5 +2825,6 @@
 		// traverse the view space subdivision
 		CastLineSegment(origin, termination, viewCells);
-		lastVssRay = &ray;
+
+        lastVssRay = &ray;
 	}
 	
Index: GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.h	(revision 2233)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.h	(revision 2255)
@@ -1107,11 +1107,17 @@
 #if USE_BETTER_RENDERCOST_EST
 	
+	const float switchcost = 1.0f;
+
+	float o = 0;
+
 	ObjectContainer::const_iterator oit, oit_end = objects.end();
 
 	for (oit = objects.begin(); oit != oit_end; ++ oit)
 	{
-		result += ViewCellsManager::GetRendercost(*oit);
-	}
-
+		o += ViewCellsManager::GetRendercost(*oit);
+	}
+
+	float n = (float)objects.size() * switchcost;
+	
 #else
 	
@@ -1121,5 +1127,12 @@
 
 #if BOUND_RENDERCOST
-	result = max(result, MIN_RENDERCOST);
+	
+	if (result > MIN_RENDERCOST)
+		return result;
+	else
+	{
+		//std::cout << "b";
+		return MIN_RENDERCOST;
+	}
 #endif
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.icproj
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.icproj	(revision 2232)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.icproj	(revision 2255)
@@ -2,5 +2,5 @@
 <VisualStudioProject 
 	ProjectType="Intel C++ Project"
-	Version="9.0"
+	Version="9.1"
 	Name="TestPreprocessor"
 	ProjectGUID="{2BF1B1A6-D665-472B-B1B1-E172512D66C1}"
@@ -186,8 +186,9 @@
 			<Tool 
 				Name="GeneralTool"
-				OutputDirectory="bin\Release"
-				IntermediateDirectory="bin\Release"
-				ConfigurationType="1"
-				CharacterSet="2"/>
+				OutputDirectory="..\bin\Release"
+				IntermediateDirectory="..\obj\Release"
+				ConfigurationType="1"
+				CharacterSet="2"
+				WholeProgramOptimization="0"/>
 			<Tool 
 				Name="DebugTool"/>
@@ -206,17 +207,20 @@
 				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;GTP_INTERNAL;USE_QT;USE_CG;USE_HASH_PV"
 				StringPooling="1"
+				MinimalRebuild="1"
 				ExceptionHandling="1"
 				RuntimeLibrary="2"
-				EnableEnhancedInstructionSet="2"
+				EnableEnhancedInstructionSet="0"
 				RuntimeTypeInfo="0"
 				UsePrecompiledHeader="0"
 				WarningLevel="3"
 				Detect64BitPortabilityProblems="1"
-				DebugInformationFormat="3"/>
+				DebugInformationFormat="3"
+				UseProcExt="2"
+				RequireProcExt="2"/>
 			<Tool 
 				Name="LinkerTool"
 				DelayImpLib=""
 				AdditionalDependencies="xerces-c_2.lib glew32.lib zdll.lib zziplib.lib devil.lib glut32.lib OpenGL32.Lib glu32.lib Preprocessor.lib RTScene.lib RTWorld.lib QtCore4.lib qtmain.lib cg.lib cgGL.lib QtOpenGL4.lib Qt3Support4.lib QtTest4.lib QtGui4.lib QtInterface.lib"
-				OutputFile="../bin/release/Preprocessor.exe"
+				OutputFile="../bin/release/Preprocessor2.exe"
 				LinkIncremental="1"
 				AdditionalLibraryDirectories="..\src\GL;..\lib\release;..\..\Preprocessing\lib\release;..\..\..\..\..\..\NonGTP\Boost\lib;..\..\..\..\..\..\NonGTP\Xerces\xercesc\lib;..\..\..\..\..\..\NonGTP\Zlib\lib;..\..\..\..\..\..\NonGTP\Devil\lib;..\MultiLevelRayTracing\RTScene\Release;..\MultiLevelRayTracing\RTWorld\Release;&quot;$(QTDIR)\lib&quot;;.\QtInterface\Release;&quot;$(CG_LIB_PATH)&quot;"
@@ -252,9 +256,9 @@
 			<Tool 
 				Name="GeneralTool"
-				OutputDirectory="Release"
-				IntermediateDirectory="Release"
+				OutputDirectory="..\bin\Release"
+				IntermediateDirectory="..\obj\Release"
 				ConfigurationType="1"
 				CharacterSet="2"
-				WholeProgramOptimization="0"/>
+				WholeProgramOptimization="1"/>
 			<Tool 
 				Name="DebugTool"/>
@@ -318,6 +322,6 @@
 			<Tool 
 				Name="GeneralTool"
-				OutputDirectory="$(ConfigurationName)"
-				IntermediateDirectory="$(ConfigurationName)"
+				OutputDirectory="..\bin\Release"
+				IntermediateDirectory="..\obj\Release"
 				ConfigurationType="1"
 				CharacterSet="2"/>
Index: GTP/trunk/Lib/Vis/GtpVisibility.sln
===================================================================
--- GTP/trunk/Lib/Vis/GtpVisibility.sln	(revision 2230)
+++ GTP/trunk/Lib/Vis/GtpVisibility.sln	(revision 2255)
@@ -17,22 +17,22 @@
 		{5776B40B-5FCE-46D5-8F7C-3912E24E0638} = {5776B40B-5FCE-46D5-8F7C-3912E24E0638}
 		{5776B40B-5FCE-46D5-8F7C-3912E24E0638} = {5776B40B-5FCE-46D5-8F7C-3912E24E0638}
+		{101A7691-74F3-48B4-96A3-CF35578F5900} = {101A7691-74F3-48B4-96A3-CF35578F5900}
 		{EABCE292-D598-4600-A1C9-2591E7D62FDA} = {EABCE292-D598-4600-A1C9-2591E7D62FDA}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Preprocessor", "Preprocessing\src\Preprocessor.vcproj", "{EABCE292-D598-4600-A1C9-2591E7D62FDA}"
+	ProjectSection(ProjectDependencies) = postProject
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestPreprocessor", "Preprocessing\src\TestPreprocessor.vcproj", "{69BC58F0-C7EB-4B43-B782-B6F047EF0528}"
+	ProjectSection(ProjectDependencies) = postProject
+		{EABCE292-D598-4600-A1C9-2591E7D62FDA} = {EABCE292-D598-4600-A1C9-2591E7D62FDA}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestCullingTerrain", "..\..\App\Demos\Vis\HillyTerrain\OGRE\TestCullingTerrain.vcproj", "{248F19A6-2FE0-4F5D-8928-E0EA10609887}"
+	ProjectSection(ProjectDependencies) = postProject
+		{5776B40B-5FCE-46D5-8F7C-3912E24E0638} = {5776B40B-5FCE-46D5-8F7C-3912E24E0638}
 		{101A7691-74F3-48B4-96A3-CF35578F5900} = {101A7691-74F3-48B4-96A3-CF35578F5900}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Preprocessor", "Preprocessing\src\Preprocessor.vcproj", "{EABCE292-D598-4600-A1C9-2591E7D62FDA}"
-	ProjectSection(ProjectDependencies) = postProject
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestPreprocessor", "Preprocessing\src\TestPreprocessor.vcproj", "{69BC58F0-C7EB-4B43-B782-B6F047EF0528}"
-	ProjectSection(ProjectDependencies) = postProject
-		{EABCE292-D598-4600-A1C9-2591E7D62FDA} = {EABCE292-D598-4600-A1C9-2591E7D62FDA}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestCullingTerrain", "..\..\App\Demos\Vis\HillyTerrain\OGRE\TestCullingTerrain.vcproj", "{248F19A6-2FE0-4F5D-8928-E0EA10609887}"
-	ProjectSection(ProjectDependencies) = postProject
-		{5776B40B-5FCE-46D5-8F7C-3912E24E0638} = {5776B40B-5FCE-46D5-8F7C-3912E24E0638}
 		{80DECC17-BDDD-4412-8CF8-F7C1C17A7436} = {80DECC17-BDDD-4412-8CF8-F7C1C17A7436}
-		{101A7691-74F3-48B4-96A3-CF35578F5900} = {101A7691-74F3-48B4-96A3-CF35578F5900}
 	EndProjectSection
 EndProject
@@ -442,4 +442,50 @@
 		{17F2C6F9-6101-430E-ABF4-71383868EF24}.Universal Unicode Release.ActiveCfg = Release|Win32
 		{17F2C6F9-6101-430E-ABF4-71383868EF24}.Universal Unicode Release.Build.0 = Release|Win32
+		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Debug.ActiveCfg = Debug|Win32
+		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Debug.Build.0 = Debug|Win32
+		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Debug Static.ActiveCfg = Debug|Win32
+		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Debug Static.Build.0 = Debug|Win32
+		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.DLL Debug.ActiveCfg = Debug|Win32
+		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.DLL Debug.Build.0 = Debug|Win32
+		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.DLL Release.ActiveCfg = Release|Win32
+		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.DLL Release.Build.0 = Release|Win32
+		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.DLL Unicode Debug.ActiveCfg = Debug|Win32
+		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.DLL Unicode Debug.Build.0 = Debug|Win32
+		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.DLL Unicode Release.ActiveCfg = Release|Win32
+		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.DLL Unicode Release.Build.0 = Release|Win32
+		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.DLL Universal Debug.ActiveCfg = Debug|Win32
+		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.DLL Universal Debug.Build.0 = Debug|Win32
+		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.DLL Universal Release.ActiveCfg = Release|Win32
+		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.DLL Universal Release.Build.0 = Release|Win32
+		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.DLL Universal Unicode Debug.ActiveCfg = Debug|Win32
+		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.DLL Universal Unicode Debug.Build.0 = Debug|Win32
+		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.DLL Universal Unicode Release.ActiveCfg = Release|Win32
+		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.DLL Universal Unicode Release.Build.0 = Release|Win32
+		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.mlrt.ActiveCfg = mlrt|Win32
+		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.mlrt.Build.0 = mlrt|Win32
+		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Release.ActiveCfg = Release|Win32
+		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Release.Build.0 = Release|Win32
+		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Release Internal.ActiveCfg = Release Internal|Win32
+		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Release Internal.Build.0 = Release Internal|Win32
+		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Release Static.ActiveCfg = Release|Win32
+		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Release Static.Build.0 = Release|Win32
+		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Release_Internal.ActiveCfg = Release_Internal|Win32
+		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Release_Internal.Build.0 = Release_Internal|Win32
+		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.release_noqt.ActiveCfg = Release_qt|Win32
+		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.release_noqt.Build.0 = Release_qt|Win32
+		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Release_qt.ActiveCfg = Release_qt|Win32
+		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Release_qt.Build.0 = Release_qt|Win32
+		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Unicode Debug.ActiveCfg = Debug|Win32
+		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Unicode Debug.Build.0 = Debug|Win32
+		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Unicode Release.ActiveCfg = Release|Win32
+		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Unicode Release.Build.0 = Release|Win32
+		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Universal Debug.ActiveCfg = Debug|Win32
+		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Universal Debug.Build.0 = Debug|Win32
+		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Universal Release.ActiveCfg = Release|Win32
+		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Universal Release.Build.0 = Release|Win32
+		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Universal Unicode Debug.ActiveCfg = Debug|Win32
+		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Universal Unicode Debug.Build.0 = Debug|Win32
+		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Universal Unicode Release.ActiveCfg = Release|Win32
+		{5776B40B-5FCE-46D5-8F7C-3912E24E0638}.Universal Unicode Release.Build.0 = Release|Win32
 	EndGlobalSection
 	GlobalSection(ExtensibilityGlobals) = postSolution
