Index: /GTP/trunk/App/Demos/Vis/KdTreeDemo/OGRE/scripts/TestKdTree.vcproj
===================================================================
--- /GTP/trunk/App/Demos/Vis/KdTreeDemo/OGRE/scripts/TestKdTree.vcproj	(revision 1953)
+++ /GTP/trunk/App/Demos/Vis/KdTreeDemo/OGRE/scripts/TestKdTree.vcproj	(revision 2101)
@@ -294,5 +294,5 @@
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="OgreMain.lib IVReader.lib"
+				AdditionalDependencies="OgreMain.lib IVReader.lib RTScene.lib RTWorld.lib"
 				OutputFile="$(OutDir)/$(ProjectName).exe"
 				LinkIncremental="1"
Index: /GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TestCullingTerrain.vcproj
===================================================================
--- /GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TestCullingTerrain.vcproj	(revision 1953)
+++ /GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TestCullingTerrain.vcproj	(revision 2101)
@@ -82,5 +82,5 @@
 				OptimizeForWindowsApplication="TRUE"
 				AdditionalIncludeDirectories="&quot;$(OGRE_PATH)\Dependencies\include&quot;;&quot;$(OGRE_PATH)\OgreMain\include&quot;;&quot;$(OGRE_PATH)\Samples\Common\include&quot;;&quot;$(OGRE_PATH)\Dependencies\include\CEGUI&quot;;&quot;$(OGRE_PATH)\PlugIns\OctreeSceneManager\include&quot;;&quot;$(OGRE_PATH)\Samples\Common\CEGUIRenderer\include&quot;;..\..\Ogre\include;..\..\..\..\..\Lib\Vis\OnlineCullingCHC\include;..\include;..\..\..\..\..\Lib\Vis\OnlineCullingCHC\OGRE\include;..\..\..\..\..\Lib\Vis\OnlineCullingCHC\IVReader\include"
-				PreprocessorDefinitions="_WINDOWS;_STLP_USE_DYNAMIC_LIB;OGRE_LIBRARY_IMPORTS;_RELEASE;WIN32;_STLP_RELEASE;GTP_VISIBILITY_MODIFIED_OGRE"
+				PreprocessorDefinitions="_WINDOWS;_STLP_USE_DYNAMIC_LIB;OGRE_LIBRARY_IMPORTS;_RELEASE;WIN32;_STLP_RELEASE;GTP_VISIBILITY_MODIFIED_OGRE;GAMETOOLS_ILLUMINATION_MODULE"
 				RuntimeLibrary="2"
 				RuntimeTypeInfo="TRUE"
@@ -231,7 +231,18 @@
 			<Tool
 				Name="VCCLCompilerTool"
+				Optimization="3"
+				GlobalOptimizations="TRUE"
+				InlineFunctionExpansion="2"
+				EnableIntrinsicFunctions="TRUE"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="TRUE"
+				EnableFiberSafeOptimizations="TRUE"
+				OptimizeForProcessor="3"
+				OptimizeForWindowsApplication="TRUE"
 				AdditionalIncludeDirectories="&quot;$(OGRE_PATH)\Dependencies\include&quot;;&quot;$(OGRE_PATH)\OgreMain\include&quot;;&quot;$(OGRE_PATH)\Samples\Common\include&quot;;&quot;$(OGRE_PATH)\Dependencies\include\CEGUI&quot;;&quot;$(OGRE_PATH)\PlugIns\OctreeSceneManager\include&quot;;&quot;$(OGRE_PATH)\Samples\Common\CEGUIRenderer\include&quot;;..\..\Ogre\include;..\..\..\..\..\Lib\Vis\OnlineCullingCHC\include;..\include;..\..\..\..\..\Lib\Vis\OnlineCullingCHC\OGRE\include;..\..\..\..\..\Lib\Vis\OnlineCullingCHC\IVReader\include;&quot;$(LIBXML_HOME)\include&quot;;d:\work\Collada\include"
 				PreprocessorDefinitions="_WINDOWS;_STLP_USE_DYNAMIC_LIB;OGRE_LIBRARY_IMPORTS;_RELEASE;WIN32;_STLP_RELEASE;GTP_VISIBILITY_MODIFIED_OGRE"
-				RuntimeLibrary="2"
+				StringPooling="TRUE"
+				RuntimeLibrary="2"
+				EnableEnhancedInstructionSet="2"
 				RuntimeTypeInfo="TRUE"
 				UsePrecompiledHeader="0"
@@ -246,9 +257,10 @@
 				OutputFile="$(OGRE_PATH)/Samples/Common/bin/Release/TestCullingTerrain.exe"
 				LinkIncremental="1"
-				AdditionalLibraryDirectories="&quot;$(OGRE_PATH)\Dependencies\Lib\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\OgreMain\Lib\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\PlugIns\OctreeSceneManager\bin\$(ConfigurationName)&quot;;&quot;$(OGRE_PATH)\Samples\Common\CEGUIRenderer\lib&quot;;&quot;..\..\Ogre\lib\$(ConfigurationName)&quot;;..\..\..\..\..\Lib\Vis\OnlineCullingCHC\lib;&quot;..\..\..\..\..\Lib\Vis\OnlineCullingCHC\OGRE\lib\$(ConfigurationName)&quot;;&quot;..\..\..\..\..\Lib\Vis\OnlineCullingCHC\IVReader\lib\$(ConfigurationName)&quot;;..\..\..\..\..\..\..\NonGTP\Xerces\xercesc\lib"
+				AdditionalLibraryDirectories="&quot;$(OGRE_PATH)\Dependencies\Lib\Release&quot;;&quot;$(OGRE_PATH)\OgreMain\Lib\Release&quot;;&quot;$(OGRE_PATH)\PlugIns\OctreeSceneManager\bin\Release&quot;;&quot;$(OGRE_PATH)\Samples\Common\CEGUIRenderer\lib&quot;;..\..\Ogre\lib\Release;..\..\..\..\..\Lib\Vis\OnlineCullingCHC\lib;..\..\..\..\..\Lib\Vis\OnlineCullingCHC\OGRE\lib\Release;..\..\..\..\..\Lib\Vis\OnlineCullingCHC\IVReader\lib\Release;..\..\..\..\..\..\..\NonGTP\Xerces\xercesc\lib"
 				GenerateDebugInformation="TRUE"
 				SubSystem="2"
 				OptimizeReferences="2"
 				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
 				TargetMachine="1"/>
 			<Tool
Index: /GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TerrainFrameListener.cpp
===================================================================
--- /GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TerrainFrameListener.cpp	(revision 1816)
+++ /GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TerrainFrameListener.cpp	(revision 2101)
@@ -260,5 +260,5 @@
 
 	// init view cell parameters
-	mSceneMgr->setOption("UseViewCells", &mUseViewCells);
+	//mSceneMgr->setOption("UseViewCells", &mUseViewCells);
 	mSceneMgr->setOption("UseVisibilityFilter", &mUseVisibilityFilter);
 
@@ -1221,6 +1221,7 @@
 
 	// load on demand
-	if (mUseViewCells && !mViewCellsLoaded)
-	{
+	if (mUseViewCells)// && !mViewCellsLoaded)
+	{
+		LogManager::getSingleton().logMessage("using view cells");
 		mLoadingOverlay->show();
 
@@ -1230,10 +1231,8 @@
 		
 		if (!mViewCellsLoaded)
-		{
-			std::stringstream d;
-			d << "loading view cells failed";
-			LogManager::getSingleton().logMessage(d.str());
-		}
-
+			LogManager::getSingleton().logMessage("loading view cells failed");
+		else
+			LogManager::getSingleton().logMessage("view cells successfully loaded");
+	
 		mLoadingOverlay->hide();
 	}
Index: /GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TestCullingTerrainApplication.cpp
===================================================================
--- /GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TestCullingTerrainApplication.cpp	(revision 1816)
+++ /GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TestCullingTerrainApplication.cpp	(revision 2101)
@@ -192,5 +192,5 @@
 	}
 
-	val = config.getSetting("ViewCells");
+/*	val = config.getSetting("ViewCells");
 
 	if (!val.empty())
@@ -218,6 +218,6 @@
 		mInitialPosition.z = atof( val.c_str());
 
-
-	val = config.getSetting("OnlineCullingAlgorithm");
+*/
+/*	val = config.getSetting("OnlineCullingAlgorithm");
 
 	if (!val.empty())
@@ -248,11 +248,7 @@
 	// setup scene
 
-	if (!LoadScene(mFilename))
-	{
-    	LogManager::getSingleton().logMessage("error loading scene");
-	}
-	
 	// set camera position accordingly
 	mCamNode->setPosition(mInitialPosition);
+	*/
 }
 //-----------------------------------------------------------------------
@@ -286,6 +282,10 @@
 	*	because then the camera is displayed correctly in the visualization
 	*/
+	//Vector3 viewPoint(707, 5000, 528);
+	Vector3 viewPoint(830, 300, -540);
+	std::stringstream d; d << "here3: " << viewPoint;
+	Ogre::LogManager::getSingleton().logMessage(d.str());
 	mCamNode = mSceneMgr->getRootSceneNode()->
-		createChildSceneNode("CamNode1", Vector3(707, 5000, 528));
+		createChildSceneNode("CamNode1", viewPoint);
 	
 	mCamNode->setOrientation(Quaternion(-0.3486, 0.0122, 0.9365, 0.0329));
@@ -457,4 +457,8 @@
 	loadConfig("terrainCulling.cfg");
 	
+	if (!LoadScene(mFilename))
+	   	LogManager::getSingleton().logMessage("error loading scene");
+	
+	
 	/////////////////////////////////////
 
@@ -481,5 +485,6 @@
 	mSunLight->setSpecularColour(1, 1, 1);
 
-	// -- Fog
+	//-- Fog
+
 	// NB it's VERY important to set this before calling setWorldGeometry 
 	// because the vertex program picked will be different
@@ -492,11 +497,10 @@
 	
 	// terrain creation
-	if (msShowHillyTerrain)
-	{
-		std::string terrain_cfg("terrain.cfg");
-#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
-		terrain_cfg = mResourcePath + terrain_cfg;
-#endif
+	if (1)//||msShowHillyTerrain)
+	{
+        mSceneMgr->getOption("ShowTerrain", &msShowHillyTerrain); 
+		std::string terrain_cfg("terrainCulling.cfg");
 		mSceneMgr->setWorldGeometry(terrain_cfg);
+
 	}
 	
@@ -555,5 +559,5 @@
 void  TestCullingTerrainApplication::generateScene(int num, int objectType)
 {
-	float val = TerrainFrameListener::msObjectScales[objectType];
+	const float val = TerrainFrameListener::msObjectScales[objectType];
 	Vector3 scale(val, val, val); 
 	const float maxHeight = 75;
@@ -564,7 +568,4 @@
 	mTerrainContentGenerator->SetMaxPos(Vector3(mTerrainMaxPos.x, maxHeight, mTerrainMaxPos.z));
 	
-	//std::stringstream d; d << "objscale: " << scale[0];
-	//Ogre::LogManager::getSingleton().logMessage(d.str());
-	
 	mTerrainContentGenerator->SetScale(scale);
 	mTerrainContentGenerator->SetOffset(TerrainFrameListener::msObjectTerrainOffsets[objectType]);
@@ -576,5 +577,7 @@
 	EntityList *entList = mTerrainContentGenerator->GetGeneratedEntities();
 
+	/////////////
 	//-- add animation state for new robots (located at the end of the list)
+	
 	for (int i = (int)entList->size() - num; i < (int)entList->size(); ++i)
 	{
@@ -800,8 +803,7 @@
 bool TestCullingTerrainApplication::LoadViewCells(const String &filename)
 {
-	LogManager::getSingleton().logMessage("loading view cells");
-
-	//-- the actual loading happens here
-	return mSceneMgr->setOption("LoadViewCells", filename.c_str());
+	// if not already loaded, 
+	// the scene manager will load the view cells
+	return mSceneMgr->setOption("UseViewCells", filename.c_str());
 }
 
Index: /GTP/trunk/App/Demos/Illum/Ogre/src/GameToolsRaytraceDemo/scripts/GameToolsRaytraceDemo.7.10.vcproj
===================================================================
--- /GTP/trunk/App/Demos/Illum/Ogre/src/GameToolsRaytraceDemo/scripts/GameToolsRaytraceDemo.7.10.vcproj	(revision 2025)
+++ /GTP/trunk/App/Demos/Illum/Ogre/src/GameToolsRaytraceDemo/scripts/GameToolsRaytraceDemo.7.10.vcproj	(revision 2101)
@@ -87,5 +87,5 @@
 				OptimizeForWindowsApplication="TRUE"
 				AdditionalIncludeDirectories="..\include;&quot;$(OGRE_PATH)\Samples\Common\include&quot;;&quot;$(OGRE_PATH)\OgreMain\include&quot;;..\..\..\..\..\..\..\Lib\Illum\IllumModule\OgreIllumModule\include;..\..\..\..\..\..\..\Lib\Illum\IllumModule\OgreIllumModule\include\RenderTechniques;..\..\..\..\..\..\..\Lib\Illum\IllumModule\OgreIllumModule\include\RenderingRuns;..\..\..\..\..\..\..\Lib\Illum\IllumModule\IllumModule\include\RenderTechniques;..\..\..\..\..\..\..\Lib\Illum\IllumModule\IllumModule\include;..\..\..\..\..\..\..\Lib\Illum\IllumModule\IllumModule\include\RenderingRuns"
-				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;GAMETOOLS_ILLUMINATION_MODULE"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;GAMETOOLS_ILLUMINATION_MODULE;GTP_VISIBILITY_MODIFIED_OGRE"
 				StringPooling="TRUE"
 				MinimalRebuild="TRUE"
