Index: /GTP/trunk/Lib/Vis/OnlineCullingCHC/include/HierarchyInterface.h
===================================================================
--- /GTP/trunk/Lib/Vis/OnlineCullingCHC/include/HierarchyInterface.h	(revision 2292)
+++ /GTP/trunk/Lib/Vis/OnlineCullingCHC/include/HierarchyInterface.h	(revision 2306)
@@ -58,26 +58,4 @@
 	virtual OcclusionQuery *IssueNodeOcclusionQuery(HierarchyNode *node, 
 													const bool wasVisible = false) = 0;
-	/** Sets the root of the scene hierarchy.
-		@param root the hierarchy root
-	*/
-	void SetHierarchyRoot(HierarchyNode *root);
-    /** Get the root of the scene hierarchy.
-		@return the hierarchy root
-	*/
-	HierarchyNode *GetHierarchyRoot() const;
-	/** Sets the scene root and initialises this hierarchy interface for a traversal.		
-		@remark also resets the statistics evaluated in the last traversal
-	*/
-	void InitTraversal();
-	/** Returns current frame id.
-		@returns frame id
-	*/
-	unsigned int GetFrameId() const;
-	/** Returns a pointer to the distance queue.
-		@returns current distance queue.
-		@remark the distance queue stores hierarchy nodes in a front-to-back order
-	*/
-	DistanceQueue *GetQueue();
-	
 	/** Returns distance of the node to the view plane.
 		@param node the hierarchy node
@@ -90,12 +68,5 @@
 	virtual bool CheckFrustumVisible(HierarchyNode *node, 
 									 bool &intersects) = 0;
-	/** Checks if the node is visible from the current view frustum.
-		@param node the current node
-	*/
-	bool CheckFrustumVisible(HierarchyNode *node);
-	/** Returns next available occlusion query or creates new one.
-		@return the next occlusion query
-	*/
-	virtual OcclusionQuery *GetNextOcclusionQuery() = 0;
+	
 	/** Returns true if there is renderable geometry attached to this node
 		@param node the current node
@@ -118,16 +89,19 @@
 	virtual void SetLastVisited(HierarchyNode *node, 
 								const unsigned int frameId) const = 0;
+	
+
+	virtual void DetermineFullVisibility(GtpVisibility::HierarchyNode *node) const = 0;
+
+	virtual HierarchyNode *GetRandomLeaf(HierarchyNode *root) = 0;
+	virtual bool IsNodeFullyVisible(GtpVisibility::HierarchyNode *node) const = 0;
+
+	virtual void CollectLeaves(HierarchyNode *root, HierarchyNodeContainer &nodes) = 0;
+
+	virtual void RenderNodeRecursive(HierarchyNode *node) = 0;
+
 	/** Returns frame id when this node was last visited by the traverser. See set
 	*/
 	virtual unsigned int LastVisited(HierarchyNode *node) const = 0;
-	/** Returns number of traversed nodes.
-	*/
-	unsigned int GetNumTraversedNodes();
-	/** Returns number of rendered nodes.
-	*/
-	unsigned int GetNumRenderedNodes();
 		
-	//bool mIsShadowPass;
-
 	/** Visualization of a culled node, dependent on the culling type. 
 		@param node the hierarchy node to be visualized
@@ -137,10 +111,12 @@
 									 CullingType type) const = 0;
 
-	/** Returns vector of visible hierarchy nodes from previous render.
+	/** Sets the root of the scene hierarchy.
+		@param root the hierarchy root
 	*/
-	std::vector<HierarchyNode *> *GetVisibleNodes();
-	/** Returns vector of previoulsy rendered geometry.
+	void SetHierarchyRoot(HierarchyNode *root);
+    /** Get the root of the scene hierarchy.
+		@return the hierarchy root
 	*/
-	
+	HierarchyNode *GetHierarchyRoot() const;
 	
 	/** This is an optimization when issuing the occlusion test. 
@@ -153,13 +129,37 @@
 	void TestGeometryForVisibleLeaves(bool testGeometry);
 
+	/** Sets the scene root and initialises this hierarchy interface for a traversal.		
+		@remark also resets the statistics evaluated in the last traversal
+	*/
+	void InitTraversal();
+	/** Returns current frame id.
+		@returns frame id
+	*/
+	unsigned int GetFrameId() const;
+	/** Returns a pointer to the distance queue.
+		@returns current distance queue.
+		@remark the distance queue stores hierarchy nodes in a front-to-back order
+	*/
+	DistanceQueue *GetQueue();
 
-	virtual void DetermineFullVisibility(GtpVisibility::HierarchyNode *node) const = 0;
+	/** Checks if the node is visible from the current view frustum.
+		@param node the current node
+	*/
+	bool CheckFrustumVisible(HierarchyNode *node);
 
-	virtual HierarchyNode *GetRandomLeaf(HierarchyNode *root) = 0;
-	virtual bool IsNodeFullyVisible(GtpVisibility::HierarchyNode *node) const = 0;
+	/** Returns number of traversed nodes.
+	*/
+	unsigned int GetNumTraversedNodes();
+	/** Returns number of rendered nodes.
+	*/
+	unsigned int GetNumRenderedNodes();
 
-	virtual void CollectLeaves(HierarchyNode *root, HierarchyNodeContainer &nodes) = 0;
+	/** Returns vector of visible hierarchy nodes from previous render.
+	*/
+	std::vector<HierarchyNode *> *GetVisibleNodes();
 
-	virtual void RenderNodeRecursive(HierarchyNode *node) = 0;
+	virtual void PullUpLastVisited(GtpVisibility::HierarchyNode *node, const int frameId) const = 0;
+	virtual void DetermineVisibilityRatio(GtpVisibility::HierarchyNode *node) const = 0;
+	virtual float GetNodeVisibilityRatio(GtpVisibility::HierarchyNode *node) const = 0;
 
 protected:
@@ -185,4 +185,5 @@
 	/// buffer for a node pointer
 	HierarchyNode *mSavedNode;
+
 	/// list of rendered hierarchy nodes (e.g., useful for exact visibility queries)
 	std::vector<HierarchyNode *> mVisibleNodes;
Index: /GTP/trunk/Lib/Vis/OnlineCullingCHC/src/HierarchyInterface.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/OnlineCullingCHC/src/HierarchyInterface.cpp	(revision 938)
+++ /GTP/trunk/Lib/Vis/OnlineCullingCHC/src/HierarchyInterface.cpp	(revision 2306)
@@ -29,5 +29,6 @@
 void HierarchyInterface::InitTraversal()
 {
-	//-- initialise for front-to-back rendering
+	//////////////
+	//-- initialise for hierarchical traversal
 
 	++ mFrameId;
Index: /GTP/trunk/Lib/Vis/OnlineCullingCHC/src/BatchedQueriesCullingManager.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/OnlineCullingCHC/src/BatchedQueriesCullingManager.cpp	(revision 2280)
+++ /GTP/trunk/Lib/Vis/OnlineCullingCHC/src/BatchedQueriesCullingManager.cpp	(revision 2306)
@@ -100,5 +100,5 @@
 							
 				// reset node's visibility classification
-				// set visibe if geometry in node so we only traverse once
+				// set visible if geometry in node so we only traverse once
 				mHierarchyInterface->SetNodeVisible(node, wasVisible && issueQuery);
 
Index: /GTP/trunk/Lib/Vis/OnlineCullingCHC/src/CoherentHierarchicalCullingManager.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/OnlineCullingCHC/src/CoherentHierarchicalCullingManager.cpp	(revision 2292)
+++ /GTP/trunk/Lib/Vis/OnlineCullingCHC/src/CoherentHierarchicalCullingManager.cpp	(revision 2306)
@@ -110,5 +110,5 @@
 							
 				// reset node's visibility classification
-				// set visibe if geometry in node so we only traverse once
+				// set visible if geometry in node so we only traverse once
 				mHierarchyInterface->SetNodeVisible(node, wasVisible && issueQuery);
 
Index: /GTP/trunk/Lib/Vis/OnlineCullingCHC/src/RandomUpdateCullingManager.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/OnlineCullingCHC/src/RandomUpdateCullingManager.cpp	(revision 2292)
+++ /GTP/trunk/Lib/Vis/OnlineCullingCHC/src/RandomUpdateCullingManager.cpp	(revision 2306)
@@ -133,6 +133,5 @@
 
 						// update node's visited flag
-						mHierarchyInterface->SetLastVisited(randomLeaf, 
-															mHierarchyInterface->GetFrameId());
+						mHierarchyInterface->PullUpLastVisited(randomLeaf, mHierarchyInterface->GetFrameId());
 
 						queryQueue.push(QueryPair(randomLeaf, 
@@ -152,5 +151,5 @@
 
 						// update node's visited flag
-						mHierarchyInterface->SetLastVisited(leaf, mHierarchyInterface->GetFrameId());
+						mHierarchyInterface->PullUpLastVisited(leaf, mHierarchyInterface->GetFrameId());
 
 						queryQueue.push(QueryPair(leaf, 
@@ -168,5 +167,5 @@
 							
 				// reset node's visibility classification
-				// set visibe if geometry in node => we only traverse the node once
+				// set visible if geometry in node => we only traverse the node once
 				mHierarchyInterface->SetNodeVisible(node, wasVisible && issueQuery);
 
@@ -193,10 +192,7 @@
 	}
 
-	//while (!mHierarchyInterface->GetQueue()->empty())
-	//	mHierarchyInterface->GetQueue()->pop();
-
 	// update the fully visible classifications
-	// TODO: this should be done during traversal!
 	mHierarchyInterface->DetermineFullVisibility(mHierarchyInterface->GetHierarchyRoot());
+	//mHierarchyInterface->DetermineVisibilityRatio(mHierarchyInterface->GetHierarchyRoot());
 }
 //-----------------------------------------------------------------------
@@ -210,5 +206,5 @@
 	{
 		mThreshold = RAND_MAX - RAND_MAX / mAssumedVisibility;
-		if (mAssumedVisibility > 100) // fix visibility
+		if (mAssumedVisibility > 100) // no random decicion
 			mThreshold = RAND_MAX;
 	}
Index: /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreOctreeHierarchyInterface.h
===================================================================
--- /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreOctreeHierarchyInterface.h	(revision 2292)
+++ /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreOctreeHierarchyInterface.h	(revision 2306)
@@ -63,4 +63,8 @@
 					   GtpVisibility::HierarchyNodeContainer &nodes);
 
+	void PullUpLastVisited(GtpVisibility::HierarchyNode *node, const int frameId) const;
+	void DetermineVisibilityRatio(GtpVisibility::HierarchyNode *node) const;
+	float GetNodeVisibilityRatio(GtpVisibility::HierarchyNode *node) const;
+
 protected:
 
Index: /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgrePlatformHierarchyInterface.h
===================================================================
--- /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgrePlatformHierarchyInterface.h	(revision 2280)
+++ /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgrePlatformHierarchyInterface.h	(revision 2306)
@@ -26,5 +26,6 @@
 {
 public:
-	/** Construction taking the current scene manager and the current rendersystem as argument
+	/** Construction taking the current scene manager and the 
+		current rendersystem as argument
 		@param sm current scene manager
 		@param rsys current render system 
@@ -36,5 +37,5 @@
 		@return the next occlusion query
 	*/
-	GtpVisibility::OcclusionQuery *GetNextOcclusionQuery();
+	virtual GtpVisibility::OcclusionQuery *GetNextOcclusionQuery();
 		
 	/** Sets the current camera used for the rendering.
@@ -124,4 +125,9 @@
 									 bool includeChildren) = 0;
 
+	void PullUpLastVisited(GtpVisibility::HierarchyNode *node, const int frameId) const {}
+	void DetermineVisibilityRatio(GtpVisibility::HierarchyNode *node) const {}
+
+	float GetNodeVisibilityRatio(GtpVisibility::HierarchyNode *node) const { return 1.0f;}
+
 protected:
 	/** Renders the given geometry 
Index: /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOctreeHierarchyInterface.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOctreeHierarchyInterface.cpp	(revision 2292)
+++ /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOctreeHierarchyInterface.cpp	(revision 2306)
@@ -31,20 +31,17 @@
 		Octree *nextChild;
 
-		if ((nextChild = octree->mChildren[0][0][0]) != NULL)
-			mDistanceQueue->push(nextChild);
-		if ((nextChild = octree->mChildren[0][0][1]) != NULL)
-			mDistanceQueue->push(nextChild);
-		if ((nextChild = octree->mChildren[0][1][0]) != NULL)
-			mDistanceQueue->push(nextChild);
-		if ((nextChild = octree->mChildren[0][1][1]) != NULL)
-           	mDistanceQueue->push(nextChild);
-		if ((nextChild = octree->mChildren[1][0][0]) != NULL)
-			mDistanceQueue->push(nextChild);
-		if ((nextChild = octree->mChildren[1][0][1]) != NULL)
-			mDistanceQueue->push(nextChild);
-		if ((nextChild = octree->mChildren[1][1][0]) != NULL)
-			mDistanceQueue->push(nextChild);
-		if ((nextChild = octree->mChildren[1][1][1]) != NULL)
-			mDistanceQueue->push(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);
+				}
+            }
+        }
 	}
 }
@@ -63,4 +60,109 @@
 	nodes.reserve(8);
 
+	for (int z = 0; z < 2; ++ z)
+	{	
+		for (int y = 0; y < 2; ++ y)
+		{
+			for (int x = 0; x < 2; ++ x)
+			{
+				if ((child = octree->mChildren[x][y][z]) != NULL)
+				{
+					nodes.push_back(child);
+				}
+			}
+		}
+	}
+
+	if (nodes.empty())
+		return NULL;
+
+	int r = (int)(((float)rand() / RAND_MAX) * ((float)nodes.size() - 0.5f));
+
+	return GetRandomLeaf(nodes[r]);
+}
+//-----------------------------------------------------------------------
+bool OctreeHierarchyInterface::IsLeaf(GtpVisibility::HierarchyNode *node) const
+{
+	Octree *octree = static_cast<Octree *>(node);
+
+	// HACK: if there are subtrees, they are empty => we are not interested in them
+	return octree->numNodes() == (int)octree->mNodes.size();
+}
+//-----------------------------------------------------------------------
+bool OctreeHierarchyInterface::HasGeometry(GtpVisibility::HierarchyNode *node) const
+{
+	return !(static_cast<Octree *>(node))->mNodes.empty();
+}
+//-----------------------------------------------------------------------
+float OctreeHierarchyInterface::GetSquaredDistance(GtpVisibility::HierarchyNode *node) const
+{
+	const Vector3 bmin = static_cast<Octree *>(node)->mBox.getMinimum();
+	const Vector3 bmax = static_cast<Octree *>(node)->mBox.getMaximum();
+
+	const Vector3 pos = (bmax - bmin) * 0.5f + bmin;
+	
+	return (mCameraPosition - pos).squaredLength();
+}
+//-----------------------------------------------------------------------
+void OctreeHierarchyInterface::SetNodeVisible(GtpVisibility::HierarchyNode *node, 
+											  const bool visible) const
+{
+#ifdef GTP_VISIBILITY_MODIFIED_OGRE
+	static_cast<Octree *>(node)->setOctreeVisible(visible);
+#endif
+}
+//-----------------------------------------------------------------------
+void OctreeHierarchyInterface::SetLastVisited(GtpVisibility::HierarchyNode *node, 
+											  const unsigned int frameId) const
+{
+#ifdef GTP_VISIBILITY_MODIFIED_OGRE
+	static_cast<Octree *>(node)->setLastVisited(frameId);
+#endif
+}
+//-----------------------------------------------------------------------
+void OctreeHierarchyInterface::PullUpVisibility(GtpVisibility::HierarchyNode *node) const
+{		
+#ifdef GTP_VISIBILITY_MODIFIED_OGRE
+	Octree *octant = static_cast<Octree *>(node);
+
+	while (octant && !octant->isOctreeVisible())
+	{
+		octant->setOctreeVisible(true);
+		octant = octant->getParent();
+	}
+#endif
+}
+//-----------------------------------------------------------------------
+void OctreeHierarchyInterface::PullUpLastVisited(GtpVisibility::HierarchyNode *node, const int frameId) const
+{		
+#ifdef GTP_VISIBILITY_MODIFIED_OGRE
+	Octree *octant = static_cast<Octree *>(node);
+
+	while (octant && (octant->lastVisited() != frameId))
+	{
+		octant->setLastVisited(frameId);
+		octant = octant->getParent();
+	}
+#endif
+}
+//-----------------------------------------------------------------------
+void OctreeHierarchyInterface::DetermineFullVisibility(GtpVisibility::HierarchyNode *node) const
+{		
+	Octree *octant = static_cast<Octree *>(node);
+
+	// node not visited in this frame => no change
+	if (octant->lastVisited() != mFrameId) 
+		return;
+
+	// leaf node: terminate recursion
+	if (IsLeaf(node))
+	{
+		octant->setOctreeFullyVisible(octant->isOctreeVisible());	
+		return;
+	}
+
+	octant->setOctreeFullyVisible(true);
+	Octree *nextChild;
+	
 	for (int i = 0; i < 8; ++ i)
 	{
@@ -68,76 +170,42 @@
 		int y = (i & 2) / 2;
 		int z = i & 1;
-	
-		if ((child = octree->mChildren[x][y][z]) != NULL)
+
+		nextChild = octant->mChildren[x][y][z];
+
+		if (!nextChild)
+			continue;
+		
+		// recursive traversal
+		DetermineFullVisibility(nextChild);
+		
+		// this leaf is not fully visible
+		if (!nextChild->isOctreeFullyVisible())
 		{
-			nodes.push_back(child);
+			octant->setOctreeFullyVisible(false);
 		}
 	}
-
-	if (nodes.empty())
-		return NULL;
-
-	int r = (int)(((float)rand() / RAND_MAX) * ((float)nodes.size() - 0.5f));
-
-	return GetRandomLeaf(nodes[r]);
-}
-//-----------------------------------------------------------------------
-bool OctreeHierarchyInterface::IsLeaf(GtpVisibility::HierarchyNode *node) const
-{
-	Octree *octree = static_cast<Octree *>(node);
-
-	// HACK: if there are subtrees, they are empty => we are not interested in them
-	return octree->numNodes() == (int)octree->mNodes.size();
-}
-//-----------------------------------------------------------------------
-bool OctreeHierarchyInterface::HasGeometry(GtpVisibility::HierarchyNode *node) const
-{
-	return !(static_cast<Octree *>(node))->mNodes.empty();
-}
-//-----------------------------------------------------------------------
-float OctreeHierarchyInterface::GetSquaredDistance(GtpVisibility::HierarchyNode *node) const
-{
-	const Vector3 bmin = static_cast<Octree *>(node)->mBox.getMinimum();
-	const Vector3 bmax = static_cast<Octree *>(node)->mBox.getMaximum();
-
-	const Vector3 pos = (bmax - bmin) * 0.5f + bmin;
-	
-	return (mCameraPosition - pos).squaredLength();
-}
-//-----------------------------------------------------------------------
-void OctreeHierarchyInterface::SetNodeVisible(GtpVisibility::HierarchyNode *node, 
-											  const bool visible) const
-{
-#ifdef GTP_VISIBILITY_MODIFIED_OGRE
-	static_cast<Octree *>(node)->setOctreeVisible(visible);
-#endif
-}
-//-----------------------------------------------------------------------
-void OctreeHierarchyInterface::SetLastVisited(GtpVisibility::HierarchyNode *node, 
-											  const unsigned int frameId) const
-{
-#ifdef GTP_VISIBILITY_MODIFIED_OGRE
-	static_cast<Octree *>(node)->setLastVisited(frameId);
-#endif
-}
-//-----------------------------------------------------------------------
-void OctreeHierarchyInterface::PullUpVisibility(GtpVisibility::HierarchyNode *node) const
+}
+//-----------------------------------------------------------------------
+void OctreeHierarchyInterface::DetermineVisibilityRatio(GtpVisibility::HierarchyNode *node) const
 {		
-#ifdef GTP_VISIBILITY_MODIFIED_OGRE
-	Octree *octant = static_cast<Octree *>(node);
-
-	while (octant && !octant->isOctreeVisible())
-	{
-		octant->setOctreeVisible(true);
-		octant = octant->getParent();
-	}
-#endif
-}
-//-----------------------------------------------------------------------
-/*void OctreeHierarchyInterface::PullUpFullVisibility(GtpVisibility::HierarchyNode *node) const
-{		
-#ifdef GTP_VISIBILITY_MODIFIED_OGRE
-	Octree *octant = static_cast<Octree *>(node);
-
+	Octree *octant = static_cast<Octree *>(node);
+
+	// node not visited in this frame => no change
+	if (octant->lastVisited() != mFrameId)
+		return;
+	
+	// leaf node: terminate recursion
+	if (IsLeaf(node))
+	{
+		octant->setNumLeaves(1);	
+		octant->setNumVisibleLeaves(octant->isOctreeVisible() ? 1 : 0);	
+		return;
+	}
+
+	int numVisibleLeaves = 0;
+	int numLeaves = 0;
+
+	Octree *nextChild;
+	
 	for (int i = 0; i < 8; ++ i)
 	{
@@ -145,51 +213,20 @@
 		int y = (i & 2) / 2;
 		int z = i & 1;
+
+		nextChild = octant->mChildren[x][y][z];
+
+		if (!nextChild)
+			continue;
 		
-		if ((nextChild = octant->mChildren[x][y][z]) != NULL)
-		{
-			DetermineFullVisibility(nextChild);
-			// this leaf is not fully visible => break
-			if (!nextChild->isOctreeFullyVisible())
-				octant->setOctreeFullyVisible(false);
-		}
-	}
-
-	while (octant && !octant->isOctreeVisible())
-	{
-		octant->setOctreeVisible(true);
-		octant = octant->getParent();
-	}
-#endif
-}*/
-//-----------------------------------------------------------------------
-void OctreeHierarchyInterface::DetermineFullVisibility(GtpVisibility::HierarchyNode *node) const
-{		
-	Octree *octant = static_cast<Octree *>(node);
-
-	// leaf node: terminate recursion
-	if (IsLeaf(node))
-	{
-		octant->setOctreeFullyVisible(octant->isOctreeVisible());	
-		return;
-	}
-
-	octant->setOctreeFullyVisible(true);
-	
-	Octree *nextChild;
-	
-	for (int i = 0; i < 8; ++ i)
-	{
-		int x = (i & 4) / 4;
-		int y = (i & 2) / 2;
-		int z = i & 1;
+		// recursive traversal
+		DetermineVisibilityRatio(nextChild);
 		
-		if ((nextChild = octant->mChildren[x][y][z]) != NULL)
-		{
-			DetermineFullVisibility(nextChild);
-			// this leaf is not fully visible => break
-			if (!nextChild->isOctreeFullyVisible())
-				octant->setOctreeFullyVisible(false);
-		}
-	}
+		// this leaf is not fully visible
+		numLeaves += nextChild->getNumLeaves();
+		numVisibleLeaves += nextChild->getNumVisibleLeaves();
+	}
+
+	octant->setNumLeaves(numLeaves);
+	octant->setNumVisibleLeaves(numVisibleLeaves);
 }
 //-----------------------------------------------------------------------
@@ -249,5 +286,16 @@
 {
 #ifdef GTP_VISIBILITY_MODIFIED_OGRE
+	//return static_cast<Octree *>(node)->getVisibilityRatio() > 0.9f;
 	return static_cast<Octree *>(node)->isOctreeFullyVisible();
+#else
+	return true;
+#endif
+}
+//-----------------------------------------------------------------------
+float OctreeHierarchyInterface::GetNodeVisibilityRatio(GtpVisibility::HierarchyNode *node) const
+{
+#ifdef GTP_VISIBILITY_MODIFIED_OGRE
+	return static_cast<Octree *>(node)->getVisibilityRatio();
+	//return static_cast<Octree *>(node)->isOctreeFullyVisible();
 #else
 	return true;
@@ -329,13 +377,15 @@
 			Octree *octree = static_cast<Octree *>(node);
 			
-			for (int i = 0; i < 8; ++ i)
-			{
-				int x = (i & 4) / 4;
-				int y = (i & 2) / 2;
-				int z = i & 1;
-	
-				if ((child = octree->mChildren[x][y][z]) != NULL)
+			for (int z = 0; z < 2; ++ z)
+			{	
+				for (int y = 0; y < 2; ++ y)
 				{
-					tStack.push(child);
+					for (int x = 0; x < 2; ++ x)
+					{
+						if ((child = octree->mChildren[x][y][z]) != NULL)
+						{
+							tStack.push(child);
+						}
+					}
 				}
 			}
Index: /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgrePlatformHierarchyInterface.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgrePlatformHierarchyInterface.cpp	(revision 2278)
+++ /GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgrePlatformHierarchyInterface.cpp	(revision 2306)
@@ -141,5 +141,6 @@
 }
 //-----------------------------------------------------------------------
-void PlatformHierarchyInterface::InitTraversal(Camera *cam, Camera *cullCam, 
+void PlatformHierarchyInterface::InitTraversal(Camera *cam, 
+											   Camera *cullCam, 
 											   int leavePassesInQueue)
 {
