Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreOctreeHierarchyInterface.h
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreOctreeHierarchyInterface.h	(revision 2455)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreOctreeHierarchyInterface.h	(revision 2555)
@@ -33,4 +33,5 @@
 	*/
 	void TraverseNode(GtpVisibility::HierarchyNode *node);
+	void TraverseNode2(GtpVisibility::HierarchyNode *node);
 	/** @copydoc HierarchyInterface::RenderNode */
 	void RenderNode(GtpVisibility::HierarchyNode *node);
@@ -83,4 +84,7 @@
 	void RenderGeometryBounds(GtpVisibility::HierarchyNode *node);
 
+	void AddToQueue(GtpVisibility::HierarchyNode *node);
+
+	void RenderQueue();
 
 protected:
Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgrePlatformHierarchyInterface.h
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgrePlatformHierarchyInterface.h	(revision 2455)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgrePlatformHierarchyInterface.h	(revision 2555)
@@ -140,5 +140,10 @@
 	int GetTestGeometryBounds();
 
-
+	virtual void AddToQueue(GtpVisibility::HierarchyNode *node) {};
+
+	virtual void RenderQueue() {};
+
+	virtual void TraverseNode2(GtpVisibility::HierarchyNode *node) {};
+	
 protected:
 
@@ -187,4 +192,6 @@
 
 	bool mTestGeometryBounds;
+
+	bool mTestMode;
 };
 
Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionCullingSceneManager.cpp
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionCullingSceneManager.cpp	(revision 2547)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionCullingSceneManager.cpp	(revision 2555)
@@ -323,10 +323,10 @@
 			 LogManager::getSingleton().logMessage("Using stop and wait algorithm");
 		 }
-		else if (val == "RUC")
+		else if (val == "CHC++")
 		{
 			 algorithm = 
-				 GtpVisibility::VisibilityEnvironment::RANDOM_UPDATE_CULLING;
-
-			 LogManager::getSingleton().logMessage("Using random update culling");
+				 GtpVisibility::VisibilityEnvironment::COHERENT_HIERARCHICAL_CULLING_PLUSPLUS;
+
+			 LogManager::getSingleton().logMessage("Using chc ++");
 		 }
 		 else if (val == "VFC")
Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgrePlatformOcclusionQuery.cpp
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgrePlatformOcclusionQuery.cpp	(revision 944)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgrePlatformOcclusionQuery.cpp	(revision 2555)
@@ -29,19 +29,11 @@
 											const bool waitForResult) const
 {
-	// return mHardwareOcclusionQuery->pullOcclusionQuery(&visiblePixels, waitForResult);
-
-	bool isAvailable = true;
-
-	if (!waitForResult)
+	if (waitForResult || !mHardwareOcclusionQuery->isStillOutstanding())
 	{
-		isAvailable = !mHardwareOcclusionQuery->isStillOutstanding();
+		//return mHardwareOcclusionQuery->pullOcclusionQuery(&visiblePixels);
+		mHardwareOcclusionQuery->pullOcclusionQuery(&visiblePixels);
+		return true;
 	}
 
-//std::stringstream d; d << mHardwareOcclusionQuery << ", available: " << isAvailable << ", waitforresult: " << waitForResult;
-//		Ogre::LogManager::getSingleton().logMessage(d.str());
-
-	if (isAvailable)
-		return mHardwareOcclusionQuery->pullOcclusionQuery(&visiblePixels);
-	
 	return false;
 }
Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOctreeHierarchyInterface.cpp
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOctreeHierarchyInterface.cpp	(revision 2455)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOctreeHierarchyInterface.cpp	(revision 2555)
@@ -32,17 +32,40 @@
 		Octree *nextChild;
 
-		for (int z = 0; z < 2; ++ z)
-		{	
-			for (int y = 0; y < 2; ++ y)
-			{
-				for (int x = 0; x < 2; ++ x)
-				{
-					nextChild = octree->mChildren[x][y][z];
-	
-					if (nextChild)
-                        GetQueue()->push(nextChild);
-				}
-            }
-        }
+		nextChild = octree->mChildren[0][0][0]; if (nextChild) GetQueue()->push(nextChild);
+		nextChild = octree->mChildren[1][0][0]; if (nextChild) GetQueue()->push(nextChild);
+		nextChild = octree->mChildren[0][1][0]; if (nextChild) GetQueue()->push(nextChild);
+		nextChild = octree->mChildren[1][1][0]; if (nextChild) GetQueue()->push(nextChild);
+		nextChild = octree->mChildren[0][0][1]; if (nextChild) GetQueue()->push(nextChild);
+		nextChild = octree->mChildren[1][0][1]; if (nextChild) GetQueue()->push(nextChild);
+		nextChild = octree->mChildren[0][1][1]; if (nextChild) GetQueue()->push(nextChild);
+		nextChild = octree->mChildren[1][1][1]; if (nextChild) GetQueue()->push(nextChild);
+	}
+}
+//-----------------------------------------------------------------------
+void OctreeHierarchyInterface::TraverseNode2(GtpVisibility::HierarchyNode *node)
+{
+	++ mNumTraversedNodes;
+
+	Octree *octree = static_cast<Octree *>(node);
+
+	// if we come across some renderable geometry => render it
+	if (!octree->mNodes.empty())
+	{
+		AddToQueue(node);
+	}
+	
+	// if not all subtrees are empty
+	if (!IsLeaf(node))
+	{
+		Octree *nextChild;
+
+		nextChild = octree->mChildren[0][0][0]; if (nextChild) GetQueue()->push(nextChild);
+		nextChild = octree->mChildren[1][0][0]; if (nextChild) GetQueue()->push(nextChild);
+		nextChild = octree->mChildren[0][1][0]; if (nextChild) GetQueue()->push(nextChild);
+		nextChild = octree->mChildren[1][1][0]; if (nextChild) GetQueue()->push(nextChild);
+		nextChild = octree->mChildren[0][0][1]; if (nextChild) GetQueue()->push(nextChild);
+		nextChild = octree->mChildren[1][0][1]; if (nextChild) GetQueue()->push(nextChild);
+		nextChild = octree->mChildren[0][1][1]; if (nextChild) GetQueue()->push(nextChild);
+		nextChild = octree->mChildren[1][1][1]; if (nextChild) GetQueue()->push(nextChild);
 	}
 }
@@ -195,15 +218,52 @@
 	if (octant->lastRendered() != mFrameId)
 	{
+		mTestMode = false;
+
 		octant->setLastRendered(mFrameId);
 		OctreeSceneManager *ocm = 
 			static_cast<OctreeSceneManager *>(mSceneManager);
 
-		ocm->_renderOctant(mCamera, 
+		ocm->_addOctantToQueue(mCamera, 
 						   octant, 
 						   mOnlyShadowCasters, 
 						   mLeavePassesInQueue);
 
+		ocm->_renderOctant(mLeavePassesInQueue);
+
 		mVisibleNodes.push_back(node);
 	}
+#endif	
+}
+//-----------------------------------------------------------------------
+void OctreeHierarchyInterface::AddToQueue(GtpVisibility::HierarchyNode *node)
+{
+#ifdef GTP_VISIBILITY_MODIFIED_OGRE
+	Octree *octant = static_cast<Octree *>(node);
+
+	if (octant->lastRendered() != mFrameId)
+	{
+		OctreeSceneManager *ocm = 
+			static_cast<OctreeSceneManager *>(mSceneManager);
+
+		octant->setLastRendered(mFrameId);
+
+		ocm->_addOctantToQueue(mCamera, 
+						   octant, 
+						   mOnlyShadowCasters, 
+						   mLeavePassesInQueue);
+
+		mVisibleNodes.push_back(node);
+	}
+#endif	
+}
+//-----------------------------------------------------------------------
+void OctreeHierarchyInterface::RenderQueue()
+{
+#ifdef GTP_VISIBILITY_MODIFIED_OGRE
+	mTestMode = false;
+
+	OctreeSceneManager *ocm = 
+			static_cast<OctreeSceneManager *>(mSceneManager);
+	ocm->_renderOctant(mLeavePassesInQueue);
 #endif	
 }
Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreBiHierarchySceneManager.cpp
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreBiHierarchySceneManager.cpp	(revision 2542)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreBiHierarchySceneManager.cpp	(revision 2555)
@@ -218,5 +218,5 @@
 		{
 			mRenderMethod = rm;
-			int cmt = GtpVisibility::VisibilityEnvironment::RANDOM_UPDATE_CULLING;
+			int cmt = GtpVisibility::VisibilityEnvironment::COHERENT_HIERARCHICAL_CULLING_PLUSPLUS;
 			return VisibilityOptionsManager(mVisibilityManager, mHierarchyInterface)
 				.setOption("Algorithm", &cmt);
@@ -242,5 +242,5 @@
 			else if (val == GtpVisibility::VisibilityEnvironment::COHERENT_HIERARCHICAL_CULLING)
 				mRenderMethod = BiHierarchy::BIHRM_GTP_CHC;
-			else if (val == GtpVisibility::VisibilityEnvironment::RANDOM_UPDATE_CULLING)
+			else if (val == GtpVisibility::VisibilityEnvironment::COHERENT_HIERARCHICAL_CULLING_PLUSPLUS)
 				mRenderMethod = BiHierarchy::BIHRM_GTP_RU;
 			// default, should never happen
Index: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgrePlatformHierarchyInterface.cpp
===================================================================
--- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgrePlatformHierarchyInterface.cpp	(revision 2497)
+++ GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgrePlatformHierarchyInterface.cpp	(revision 2555)
@@ -98,8 +98,13 @@
 	
 	mRenderSystem->_setWorldMatrix(Ogre::Matrix4::IDENTITY);
-	mSceneManager->useRenderableViewProjModeWrapper(solidBox);
+	//mSceneManager->useRenderableViewProjModeWrapper(solidBox);
 	
 	// set no depth write, no color, no lighting material
-	mSceneManager->setPassWrapper(solidBox->getTechnique()->getPass(0));
+	if (!mTestMode)
+	{
+		mTestMode = true;
+		mSceneManager->setPassWrapper(solidBox->getTechnique()->getPass(0));
+	}
+
 	solidBox->SetupBoundingBoxVertices(*box);
 
@@ -147,4 +152,6 @@
 	// create materials for node visualization
 	CreateNodeVizMaterials();
+
+	mTestMode = false;
 }
 //-----------------------------------------------------------------------
