Index: /GTP/trunk/Lib/Vis/OnlineCullingCHC/src/CoherentHierarchicalCullingManager.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/OnlineCullingCHC/src/CoherentHierarchicalCullingManager.cpp	(revision 2171)
+++ /GTP/trunk/Lib/Vis/OnlineCullingCHC/src/CoherentHierarchicalCullingManager.cpp	(revision 2184)
@@ -115,5 +115,5 @@
 				// update node's visited flag
 				mHierarchyInterface->SetLastVisited(node, mHierarchyInterface->GetFrameId());
-
+				//Ogre::LogManager::getSingleton().logMessage("here999");
 				// skip testing previously visible nodes without geometry
 				if (issueQuery)
Index: /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreOcclusionCullingSceneManager.h
===================================================================
--- /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreOcclusionCullingSceneManager.h	(revision 2183)
+++ /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreOcclusionCullingSceneManager.h	(revision 2184)
@@ -298,4 +298,6 @@
 
 	ObjReader *mObjReader;
+
+	Camera *mDummyCamera;
 };
 
Index: /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgrePlatformQueryManager.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgrePlatformQueryManager.cpp	(revision 2171)
+++ /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgrePlatformQueryManager.cpp	(revision 2184)
@@ -12,5 +12,6 @@
 //----------------------------------------------------------------------- 
 PlatformQueryManager::PlatformQueryManager(GtpVisibility::HierarchyInterface *hierarchyInterface, 
-										   Viewport *vp, int queryModes):
+										   Viewport *vp, 
+										   int queryModes):
 QueryManager(hierarchyInterface, queryModes), 
 mViewport(vp), 
Index: /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreSolidBoundingBox.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreSolidBoundingBox.cpp	(revision 925)
+++ /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreSolidBoundingBox.cpp	(revision 2184)
@@ -76,4 +76,10 @@
 	 SetOcclusionQueryMaterial();
 	 //setMaterial("BaseWhiteNoLighting");
+
+	/* std::stringstream d;
+	d << "vtx: " << mRenderOp.vertexData;
+	LogManager::getSingleton().logMessage(d.str());
+	*/
+
 }
 //-----------------------------------------------------------------------
Index: /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/Plugin_VisibilitySceneManager.vcproj
===================================================================
--- /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/Plugin_VisibilitySceneManager.vcproj	(revision 2183)
+++ /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/Plugin_VisibilitySceneManager.vcproj	(revision 2184)
@@ -52,5 +52,6 @@
 			<Tool
 				Name="VCPostBuildEventTool"
-				CommandLine="copy $(OutDir)\$(TargetFileName) $(OGRE_PATH)\Samples\Common\bin\$(ConfigurationName)"/>
+				CommandLine="copy $(OutDir)\$(TargetFileName) $(OGRE_PATH)\Samples\Common\bin\$(ConfigurationName)
+copy $(OutDir)\$(TargetFileName) D:\svn\gametools\GTP\trunk\App\Demos\Illum\Ogre\bin\$(ConfigurationName)"/>
 			<Tool
 				Name="VCPreBuildEventTool"/>
Index: /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionCullingSceneManager.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionCullingSceneManager.cpp	(revision 2183)
+++ /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionCullingSceneManager.cpp	(revision 2184)
@@ -59,5 +59,5 @@
 mElementaryViewCell(NULL),
 mDeleteQueueAfterRendering(true),
-mNormalExecution(false),
+mNormalExecution(true),
 mShowViewCells(false),
 mViewCellsGeometryLoaded(false),
@@ -730,16 +730,16 @@
 void OcclusionCullingSceneManager::_renderVisibleObjects()
 {
+	if (mNormalExecution)
+	{
+		// the standard octree rendering mode
+		TerrainSceneManager::_renderVisibleObjects();
+		//getRenderQueue()->clear(flushQueue);
+		return;
+	}
+
 	const bool flushQueue = 
 		mDeleteQueueAfterRendering && ((mCurrentFrame % mFlushRate) == 0);
 	++ mCurrentFrame;
 
-	if (mNormalExecution)
-	{
-		// the standard octree rendering mode
-		TerrainSceneManager::_renderVisibleObjects();
-		getRenderQueue()->clear(flushQueue);
-		return;
-	}
-
 	// create material for item buffer pass
 	InitItemBufferPass();
@@ -752,5 +752,6 @@
 	//-- (e.g., the visualization mode, the shadow pass)
 
-	if (mUseDepthPass || mShowVisualization ||
+	if (//!mFindVisibleObjects || 
+		mUseDepthPass || mShowVisualization ||
 	    (mShadowTechnique == SHADOWTYPE_TEXTURE_MODULATIVE && 
 	     mIlluminationStage == IRS_RENDER_TO_TEXTURE))
@@ -767,8 +768,9 @@
 		TerrainSceneManager::_renderVisibleObjects();
 
+		//LogManager::getSingleton().logMessage("x");
 		mIlluminationStage = savedStage;
 	}
 	else //-- the hierarchical culling algorithm
-	{
+	{//LogManager::getSingleton().logMessage("y");
 		// note matt: this is also called in TerrainSceneManager: really necessary?
 		mDestRenderSystem->setLightingEnabled(false);
@@ -812,5 +814,5 @@
 		// set all necessary parameters for 
 		// hierarchical visibility culling and rendering
-		InitVisibilityCulling(mCameraInProgress);
+		InitVisibilityCulling(mDummyCamera);
 
 
@@ -857,5 +859,5 @@
 	// almost same effect as below
 	getRenderQueue()->clear(flushQueue);
-
+	
 	if (0) WriteLog(); // write out stats
 }
@@ -864,12 +866,9 @@
 void OcclusionCullingSceneManager::_updateSceneGraph(Camera* cam)
 {
-	if (mNormalExecution)
-	{
-		TerrainSceneManager::_updateSceneGraph(cam);
-		return;
-	}
-
-	mVisibilityManager->GetCullingManager()->SetHierarchyInterface(mHierarchyInterface);
-	mHierarchyInterface->SetRenderSystem(mDestRenderSystem);
+	if (!mNormalExecution)
+	{
+		mVisibilityManager->GetCullingManager()->SetHierarchyInterface(mHierarchyInterface);
+		mHierarchyInterface->SetRenderSystem(mDestRenderSystem);
+	}
 
 	TerrainSceneManager::_updateSceneGraph(cam);
@@ -1076,6 +1075,4 @@
 
 		* static_cast<unsigned int *>(val) = (unsigned int)algorithm;
-
-		//getRenderQueue()->clear();
 
 		return true;
@@ -1913,4 +1910,10 @@
 												bool includeOverlays)
 {
+	if (0 && mNormalExecution)
+	{
+		TerrainSceneManager::_renderScene(camera, vp, includeOverlays);
+		return;
+	}
+
     Root::getSingleton()._setCurrentSceneManager(this);
 	mActiveQueuedRenderableVisitor->targetSceneMgr = this;
@@ -2057,5 +2060,5 @@
     {
         // Parse the scene and tag visibles
-        myFindVisibleObjects(camera, 
+        _findVisibleObjects(camera, 
             mIlluminationStage == IRS_RENDER_TO_TEXTURE? true : false);
     }
@@ -2071,5 +2074,5 @@
     }
 
- 
+ mDummyCamera = camera;
     // Render scene content 
     _renderVisibleObjects();
@@ -2273,5 +2276,5 @@
 	// // Render scene content in order fill depth buffer
 	bool savedUseDepthPass = mUseDepthPass;
-	mUseDepthPass = true;
+	if (1) mUseDepthPass = true;
 
 	// don't need shading, render only depth pass
@@ -2359,4 +2362,10 @@
 													   bool onlyShadowCasters)										 
 {
+	if (1 || mNormalExecution)
+	{
+		TerrainSceneManager::_findVisibleObjects(cam, onlyShadowCasters);
+		return;
+	}
+
 	// lists only used for visualization
 	mVisible.clear();
@@ -2378,5 +2387,5 @@
 	OcclusionQueriesQueryManager *queryManager = 
 		new OcclusionQueriesQueryManager(mHierarchyInterface,
-										 mCurrentViewport,
+		cam->getViewport(),//mCurrentViewport,
 										 queryModes, 
 										 itemBufferMode);
Index: /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgrePlatformHierarchyInterface.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgrePlatformHierarchyInterface.cpp	(revision 1621)
+++ /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgrePlatformHierarchyInterface.cpp	(revision 2184)
@@ -95,4 +95,5 @@
 	static RenderOperation ro;
 
+	//LogManager::getSingleton().logMessage("here66");
 	SolidBoundingBox *solidBox = GetSolidBoundingBox();
 	
@@ -106,7 +107,11 @@
 
 	solidBox->SetupBoundingBoxVertices(*box);
-				
+
 	solidBox->getRenderOperation(ro);
 	ro.srcRenderable = solidBox;
+	//std::stringstream d;
+	//d << "vt2: " << ro.vertexData;
+	//LogManager::getSingleton().logMessage(d.str());
+
 	mRenderSystem->_render(ro);
 }
@@ -175,6 +180,7 @@
 //-----------------------------------------------------------------------
 GtpVisibility::OcclusionQuery *PlatformHierarchyInterface::IssueNodeOcclusionQuery(
-	GtpVisibility::HierarchyNode *node, const bool wasVisible) 
-{
+	GtpVisibility::HierarchyNode *node, 
+	const bool wasVisible) 
+{//LogManager::getSingleton().logMessage("here6960");
 	// get next available test id
 	GtpVisibility::OcclusionQuery *query = GetNextOcclusionQuery();
@@ -261,5 +267,8 @@
 {
 	if (!mSolidBoundingBox)
+	{
 		mSolidBoundingBox = new SolidBoundingBox;
+		//LogManager::getSingleton().logMessage("solid box created");
+	}
 
 	return mSolidBoundingBox;
