Index: trunk/VUT/Ogre/include/OgreSceneNodeHierarchyInterface.h
===================================================================
--- trunk/VUT/Ogre/include/OgreSceneNodeHierarchyInterface.h	(revision 154)
+++ trunk/VUT/Ogre/include/OgreSceneNodeHierarchyInterface.h	(revision 155)
@@ -24,5 +24,5 @@
 	bool IsLeaf(GtpVisibility::HierarchyNode *node) const;
 	
-	void TraverseNode(GtpVisibility::HierarchyNode *node);
+	void TraverseAndRenderNode(GtpVisibility::HierarchyNode *node);
 	void RenderNode(GtpVisibility::HierarchyNode *node);
 	void PullUpVisibility(GtpVisibility::HierarchyNode *node);
@@ -46,5 +46,5 @@
 							bool includeChildren = false);*/
 	
-	void GetGeometry(GtpVisibility::HierarchyNode *node,	
+	void GetNodeGeometryList(GtpVisibility::HierarchyNode *node,	
 					 GtpVisibility::GeometryList *geometryList, 
 					 bool includeChildren);
@@ -53,4 +53,6 @@
 	
 	int GetNodeId(GtpVisibility::HierarchyNode *node);
+
+	GtpVisibility::HierarchyNode *GetNextNode();
 };
 
Index: trunk/VUT/Ogre/include/OgreVisibilityTerrainSceneManager.h
===================================================================
--- trunk/VUT/Ogre/include/OgreVisibilityTerrainSceneManager.h	(revision 153)
+++ trunk/VUT/Ogre/include/OgreVisibilityTerrainSceneManager.h	(revision 155)
@@ -122,4 +122,6 @@
 	int mLeavePassesInQueue;
 	ShadowTechnique mSavedShadowTechnique;
+
+	bool mRenderOnlyBoundingBoxes;
 };
 
Index: trunk/VUT/Ogre/include/OgreOctreeHierarchyInterface.h
===================================================================
--- trunk/VUT/Ogre/include/OgreOctreeHierarchyInterface.h	(revision 154)
+++ trunk/VUT/Ogre/include/OgreOctreeHierarchyInterface.h	(revision 155)
@@ -29,7 +29,7 @@
 	/** Traverses given node.
 		@param node current node
-		@remark pushes children on distance queue
+		@remark pushes children on a distance queue.
 	*/
-	void TraverseNode(GtpVisibility::HierarchyNode *node);
+	void TraverseAndRenderNode(GtpVisibility::HierarchyNode *node);
 	void RenderNode(GtpVisibility::HierarchyNode *node);
 	bool IsLeaf(GtpVisibility::HierarchyNode *node) const;
@@ -46,9 +46,5 @@
 							 GtpVisibility::CullingType type);
 
-	/*bool FindVisibleObjects(GtpVisibility::HierarchyNode *node,	
-							InfoContainer<GtpVisibility::MeshInfo> *visibleGeometry, 
-							bool includeChildren = false);*/
-
-	void GetGeometry(GtpVisibility::HierarchyNode *node,
+	void GetNodeGeometryList(GtpVisibility::HierarchyNode *node,
 					 GtpVisibility::GeometryList *geometryList, 
 					 bool includeChildren);
@@ -57,4 +53,6 @@
 	
 	int GetNodeId(GtpVisibility::HierarchyNode *node);
+
+	GtpVisibility::HierarchyNode *GetNextNode();
 
 protected:
@@ -69,4 +67,6 @@
 	*/
 	Real GetSquaredViewDepth(const Camera* cam, const AxisAlignedBox* box) const;
+
+	int mCurrentOctreePosition;
 };
 } // namespace Ogre
Index: trunk/VUT/Ogre/include/OgreBspHierarchyInterface.h
===================================================================
--- trunk/VUT/Ogre/include/OgreBspHierarchyInterface.h	(revision 154)
+++ trunk/VUT/Ogre/include/OgreBspHierarchyInterface.h	(revision 155)
@@ -22,7 +22,7 @@
 	/** Traverses given node.
 		@param node current node
-		@remark pushes children on distance queue
+		@remark pushes children on the distance queue
 	*/
-	void TraverseNode(GtpVisibility::HierarchyNode *node);
+	void TraverseAndRenderNode(GtpVisibility::HierarchyNode *node);
 	void RenderNode(GtpVisibility::HierarchyNode *node);
 	bool IsLeaf(GtpVisibility::HierarchyNode *node) const;
Index: trunk/VUT/Ogre/include/OgrePlatformHierarchyInterface.h
===================================================================
--- trunk/VUT/Ogre/include/OgrePlatformHierarchyInterface.h	(revision 139)
+++ trunk/VUT/Ogre/include/OgrePlatformHierarchyInterface.h	(revision 155)
@@ -47,11 +47,9 @@
 		@remark This is a convenience method which resets the stats, 
 				sets the current camera, and initialises the distance queue.
-		@param root root of the hierarchy
 		@param cam the actual camera definding the view frustum
 		@param cullCam the camera used for culling. 
-		@remark If null, the actual camera is used for both viewing and culling		
+		@remark If cullCam is null, the actual camera is used for both viewing and culling		
 	*/
-	void InitFrame(GtpVisibility::HierarchyNode *root, Camera *cam, Camera *cullCam = NULL, 
-		int leavePassesInQueue = 0);
+	void InitTraversal(Camera *cam, Camera *cullCam = NULL, int leavePassesInQueue = 0);
 	/** Checks if the node is visible from the current view frustum.
 		@param node the current node
@@ -95,5 +93,5 @@
 	/** see set 
 	*/
-	bool GetUseOptimization();
+	bool GetTestGeometryForVisibleLeaves();
 	/** see set
 	*/
Index: trunk/VUT/Ogre/src/OgreSceneNodeHierarchyInterface.cpp
===================================================================
--- trunk/VUT/Ogre/src/OgreSceneNodeHierarchyInterface.cpp	(revision 154)
+++ trunk/VUT/Ogre/src/OgreSceneNodeHierarchyInterface.cpp	(revision 155)
@@ -17,5 +17,5 @@
 }
 //-----------------------------------------------------------------------
-void SceneNodeHierarchyInterface::TraverseNode(GtpVisibility::HierarchyNode *node)
+void SceneNodeHierarchyInterface::TraverseAndRenderNode(GtpVisibility::HierarchyNode *node)
 {
 	++ mNumTraversedNodes;
@@ -121,7 +121,7 @@
 {
 	// only create renderable bounding box for new node
-	if (node != mPreviousNode)
+	if (node != mSavedNode)
 	{
-		mPreviousNode = node;
+		mSavedNode = node;
 		mBox = static_cast<SceneNode *>(node)->_getWorldAABB();
 	}
@@ -136,5 +136,5 @@
 }
 //-----------------------------------------------------------------------
-void SceneNodeHierarchyInterface::GetGeometry(GtpVisibility::HierarchyNode *node,	
+void SceneNodeHierarchyInterface::GetNodeGeometryList(GtpVisibility::HierarchyNode *node,	
 											  GtpVisibility::GeometryList *geometryList, 
 											  bool includeChildren)
@@ -151,5 +151,6 @@
 		{
 			Entity *ent = static_cast<Entity *>(movable);
-			//std::stringstream d; d << "ent " << ent->getName(); LogManager::getSingleton().logMessage(d.str());
+			//std::stringstream d; d << "ent " << ent->getName(); 
+			//LogManager::getSingleton().logMessage(d.str());
 			geometryList->push_back(ent);
 		}
@@ -166,3 +167,22 @@
 	return static_cast<SceneNode *>(node)->getId();
 }
+//-----------------------------------------------------------------------
+GtpVisibility::HierarchyNode *SceneNodeHierarchyInterface::GetNextNode()
+{
+	if (mTraversalStack->empty())
+		return NULL;
+	
+	SceneNode *node = static_cast<SceneNode *>(mTraversalStack->top());
+	mTraversalStack->pop();
+
+	// internal node: add children to priority queue for further processing
+	Node::ChildNodeIterator it = node->getChildIterator();
+				
+	while (it.hasMoreElements())			
+	{ 
+		mTraversalStack->push(it.getNext());
+	}
+
+	return node;
+} 
 } // namespace Ogre	
Index: trunk/VUT/Ogre/src/OgreVisibilityTerrainSceneManager.cpp
===================================================================
--- trunk/VUT/Ogre/src/OgreVisibilityTerrainSceneManager.cpp	(revision 154)
+++ trunk/VUT/Ogre/src/OgreVisibilityTerrainSceneManager.cpp	(revision 155)
@@ -30,5 +30,6 @@
 mEnableDepthWrite(true),
 mSkipTransparents(false),
-mSavedShadowTechnique(SHADOWTYPE_NONE)
+mSavedShadowTechnique(SHADOWTYPE_NONE),
+mRenderOnlyBoundingBoxes(false)
 {
 	mHierarchyInterface = new OctreeHierarchyInterface(this, mDestRenderSystem);
@@ -126,8 +127,7 @@
 			if (mRenderNodesForViz)
 			{
-				OctreeNode *node = *it;	
-				if ((node->numAttachedObjects() > 0) && (node->numChildren() == 0)
-					&& node->getAttachedObject(0)->getMovableType() == "Entity")
-				getRenderQueue()->addRenderable(node);
+				if (((*it)->numAttachedObjects() > 0) && ((*it)->numChildren() == 0)
+					&& (*it)->getAttachedObject(0)->getMovableType() == "Entity")
+				getRenderQueue()->addRenderable((*it));
 
 				// addbounding boxes instead of node itself
@@ -213,10 +213,14 @@
 		PrepareVisualization(cam);
 	}
-	else
+	else if (mRenderOnlyBoundingBoxes)
+	{
+	}
+	else 
 	{	
 		// for hierarchical culling, we interleave identification 
 		// and rendering of objects in _renderVisibibleObjects
 
-		// only for the shadow pass we use standard rendering
+		// for the shadow pass we use only standard rendering
+		// because of low occlusion
 		if (mShadowTechnique == SHADOWTYPE_TEXTURE_MODULATIVE && 
 			mIlluminationStage == IRS_RENDER_TO_TEXTURE)
@@ -225,5 +229,5 @@
 		}
 		// only shadow casters will be rendered in shadow texture pass
-		//mHierarchyInterface->SetOnlyShadowCasters(onlyShadowCasters);
+		// mHierarchyInterface->SetOnlyShadowCasters(onlyShadowCasters);
 	}
 	//TerrainSceneManager::_findVisibleObjects(cam, onlyShadowCasters);
@@ -236,14 +240,17 @@
 void VisibilityTerrainSceneManager::_renderVisibleObjects()
 {
+	// save ambient light to reset later
 	ColourValue savedAmbient = mAmbientLight;
 
-	// visualization or shadow pass: apply standard rendering
-	if (mShowVisualization || (mShadowTechnique == SHADOWTYPE_TEXTURE_MODULATIVE && 
-		mIlluminationStage == IRS_RENDER_TO_TEXTURE))
+	// --- apply standard rendering for some cases 
+    // e.g., visualization, shadow pass
+
+	if (mShowVisualization || mRenderOnlyBoundingBoxes ||
+	   (mShadowTechnique == SHADOWTYPE_TEXTURE_MODULATIVE && mIlluminationStage == IRS_RENDER_TO_TEXTURE))
 	{	
 		IlluminationRenderStage savedStage = mIlluminationStage; 
 	
 		if (mShowVisualization) 
-			// disable illumination stage so we have no shadows in visualization
+			// disable illumination stage because we want no shadows in visualization
 			mIlluminationStage = IRS_NONE;
 
@@ -455,5 +462,5 @@
 	d << "Depth pass: " << StringConverter::toString(mUseDepthPass) << ", "
 	  << "Delay transparents: " << StringConverter::toString(mDelayRenderTransparents) << ", "
-	  << "Use optimization: " << StringConverter::toString(mHierarchyInterface->GetUseOptimization()) << ", "
+	  << "Use optimization: " << StringConverter::toString(mHierarchyInterface->GetTestGeometryForVisibleLeaves()) << ", "
 	  << "Algorithm type: " << mVisibilityManager->GetCullingManagerType() << ", "
 	  << "Hierarchy nodes: " << mNumOctreeNodes << ", " 
@@ -699,8 +706,11 @@
 		(mLeavePassesInQueue & RenderPriorityGroup::TRANSPARENT_PASSES);
 
+	// -- initialise interface for rendering traversal of the hierarchy
+	mHierarchyInterface->SetHierarchyRoot(mOctree);
+	
 	// possible two cameras (one for culling, one for rendering)
-	mHierarchyInterface->InitFrame(mOctree, cam, 
-						mCullCamera ? getCamera("CullCamera") : NULL,
-						mLeavePassesInQueue);
+	mHierarchyInterface->InitTraversal(mCameraInProgress, 
+							mCullCamera ? getCamera("CullCamera") : NULL,
+							mLeavePassesInQueue);
 		
 	//std::stringstream d; d << "leave passes in queue: " << mLeavePassesInQueue;LogManager::getSingleton().logMessage(d.str());
Index: trunk/VUT/Ogre/src/OgreVisibilityOptionsManager.cpp
===================================================================
--- trunk/VUT/Ogre/src/OgreVisibilityOptionsManager.cpp	(revision 146)
+++ trunk/VUT/Ogre/src/OgreVisibilityOptionsManager.cpp	(revision 155)
@@ -26,10 +26,10 @@
 	if (key == "AssumedVisibility")
 	{
-		mVisibilityManager->SetAssumedVisibility(*static_cast<const int *>(val));
+		mVisibilityManager->SetAssumedVisibilityForChc(*static_cast<const int *>(val));
 		return true;
 	}
-	if (key == "UseOptimization")
+	if (key == "TestGeometryForVisibleLeaves")
 	{
-		mHierarchyInterface->SetUseOptimization(*static_cast<const bool *>(val));
+		mHierarchyInterface->TestGeometryForVisibleLeaves(*static_cast<const bool *>(val));
 		return true;
 	}
Index: trunk/VUT/Ogre/src/OgreVisibilitySceneManager.cpp
===================================================================
--- trunk/VUT/Ogre/src/OgreVisibilitySceneManager.cpp	(revision 139)
+++ trunk/VUT/Ogre/src/OgreVisibilitySceneManager.cpp	(revision 155)
@@ -40,6 +40,6 @@
 	if (!mShowVisualization)
 	{
-		// two cameras (one for culling, one for rendering)
-		mHierarchyInterface->InitFrame(mSceneRoot, mCameraInProgress);
+		mHierarchyInterface->SetHierarchyRoot(mSceneRoot);
+		mHierarchyInterface->InitTraversal(mCameraInProgress);
 
 		// reset culling manager stats
Index: trunk/VUT/Ogre/src/OgreOctreeHierarchyInterface.cpp
===================================================================
--- trunk/VUT/Ogre/src/OgreOctreeHierarchyInterface.cpp	(revision 154)
+++ trunk/VUT/Ogre/src/OgreOctreeHierarchyInterface.cpp	(revision 155)
@@ -10,9 +10,9 @@
 //-----------------------------------------------------------------------
 OctreeHierarchyInterface::OctreeHierarchyInterface(OctreeSceneManager *sm, RenderSystem *rsys): 
-SceneNodeHierarchyInterface(sm, rsys)
-{
-}
-//-----------------------------------------------------------------------
-void OctreeHierarchyInterface::TraverseNode(GtpVisibility::HierarchyNode *node)
+SceneNodeHierarchyInterface(sm, rsys), mCurrentOctreePosition(0)
+{
+}
+//-----------------------------------------------------------------------
+void OctreeHierarchyInterface::TraverseAndRenderNode(GtpVisibility::HierarchyNode *node)
 {
 	++ mNumTraversedNodes;
@@ -84,5 +84,5 @@
 	Octree *octant = static_cast<Octree *>(node);
 
-	while(octant && !octant->isOctreeVisible())
+	while (octant && !octant->isOctreeVisible())
 	{
 		octant->setOctreeVisible(true);
@@ -129,10 +129,9 @@
 AxisAlignedBox *OctreeHierarchyInterface::GetBoundingBox(GtpVisibility::HierarchyNode *node)
 {
-	if (node != mPreviousNode)	
-	{
-		mPreviousNode = node;
+	if (node != mSavedNode)
+	{
+		mSavedNode = node;
 	    //static_cast<Octree *>(node)->_getCullBounds(&mBox);
 		mBox = static_cast<Octree *>(node)->_getWorldAABB();
-		//std::stringstream d; d << mBox;LogManager::getSingleton().logMessage(d.str()); 
 	}
 
@@ -157,5 +156,5 @@
 }
 //-----------------------------------------------------------------------
-void OctreeHierarchyInterface::GetGeometry(GtpVisibility::HierarchyNode *node,	
+void OctreeHierarchyInterface::GetNodeGeometryList(GtpVisibility::HierarchyNode *node,	
 										   GtpVisibility::GeometryList *geometryList, 
 										   bool includeChildren)
@@ -166,5 +165,5 @@
 	for (nodeIt = static_cast<Octree *>(node)->mNodes.begin(); nodeIt != nodeIt_end; ++nodeIt)
 	{
-		SceneNodeHierarchyInterface::GetGeometry(*nodeIt, geometryList, includeChildren);
+		SceneNodeHierarchyInterface::GetNodeGeometryList(*nodeIt, geometryList, includeChildren);
 	}
 }
@@ -180,30 +179,25 @@
 }
 //-----------------------------------------------------------------------
-/*bool OctreeHierarchyInterface::FindVisibleObjects(GtpVisibility::HierarchyNode *node,	
-									InfoContainer<GtpVisibility::MeshInfo> *visibleGeometry, 
-									bool includeChildren)
-{
-	bool foundVisible = false;
-
-	PlatformOcclusionQuery query(mRenderSystem);
-
-	NodeList *nodes = &static_cast<Octree *>(node)->mNodes;
+GtpVisibility::HierarchyNode *OctreeHierarchyInterface::GetNextNode()
+{
+	if (mTraversalStack->empty())
+		return NULL;
 	
-	NodeList::const_iterator nodeIt = nodes->begin(), nodeIt_end;
-	
-	nodeIt_end = nodes->end();
-
-	while (nodeIt != nodeIt_end)
-	{
-		OctreeNode *octreeNode = (*nodeIt);
-		if (SceneNodeHierarchyInterface::FindVisibleObjects(octreeNode, visibleGeometry, includeChildren))
+	Octree *octree = static_cast<Octree *>(mTraversalStack->top());
+	mTraversalStack->pop();
+		
+	for(int i=0; i<8; ++i)
+	{
+		Octree *nextChild = 
+			octree->mChildren[(i & 4) >> 2][(i & 2) >> 1][i & 1];
+
+		if (nextChild)
 		{
-			foundVisible = true;
+			mTraversalStack->push(nextChild);
 		}
-		++nodeIt;
-	}
-
-	return foundVisible;
-}*/
-
+	}
+
+	return octree;
+} 
+		
 } // namespace Ogre
Index: trunk/VUT/Ogre/src/OgreVisibilityOctreeSceneManager.cpp
===================================================================
--- trunk/VUT/Ogre/src/OgreVisibilityOctreeSceneManager.cpp	(revision 154)
+++ trunk/VUT/Ogre/src/OgreVisibilityOctreeSceneManager.cpp	(revision 155)
@@ -184,8 +184,12 @@
 	bool leaveTransparentsInQueue = mDelayRenderTransparents && !mUseDepthPass;
 
+    // -- initialise interface for rendering traversal of the hierarchy
+	mHierarchyInterface->SetHierarchyRoot(mOctree);
+	
 	// possible two cameras (one for culling, one for rendering)
-	mHierarchyInterface->InitFrame(mOctree, mCameraInProgress, 
+	mHierarchyInterface->InitTraversal(mCameraInProgress, 
 							mCullCamera ? getCamera("CullCamera") : NULL,
 							leaveTransparentsInQueue);
+		
 
 	// reset culling manager stats
@@ -352,5 +356,5 @@
 	d << "Depth pass: " << StringConverter::toString(mUseDepthPass) << ", "
 	  << "Delay transparents: " << StringConverter::toString(mDelayRenderTransparents) << ", "
-	  << "Use optimization: " << StringConverter::toString(mHierarchyInterface->GetUseOptimization()) << ", "
+	  << "Use optimization: " << StringConverter::toString(mHierarchyInterface->GetTestGeometryForVisibleLeaves()) << ", "
 	  << "Algorithm type: " << mVisibilityManager->GetCullingManagerType() << "\n"
 	  << "Hierarchy nodes: " << mNumOctreeNodes << ", " 
Index: trunk/VUT/Ogre/src/OgreBspHierarchyInterface.cpp
===================================================================
--- trunk/VUT/Ogre/src/OgreBspHierarchyInterface.cpp	(revision 87)
+++ trunk/VUT/Ogre/src/OgreBspHierarchyInterface.cpp	(revision 155)
@@ -12,5 +12,5 @@
 }
 //-----------------------------------------------------------------------
-void BspHierarchyInterface::TraverseNode(GtpVisibility::HierarchyNode *node)
+void BspHierarchyInterface::TraverseAndRenderNode(GtpVisibility::HierarchyNode *node)
 {
 }
Index: trunk/VUT/Ogre/src/OgrePlatformHierarchyInterface.cpp
===================================================================
--- trunk/VUT/Ogre/src/OgrePlatformHierarchyInterface.cpp	(revision 139)
+++ trunk/VUT/Ogre/src/OgrePlatformHierarchyInterface.cpp	(revision 155)
@@ -130,10 +130,9 @@
 }
 //-----------------------------------------------------------------------
-void PlatformHierarchyInterface::InitFrame(GtpVisibility::HierarchyNode *root, 
-										   Camera *cam, Camera *cullCam, int leavePassesInQueue)
-{
-	GtpVisibility::HierarchyInterface::InitFrame(root);
-	
-	mPreviousNode = NULL;
+void PlatformHierarchyInterface::InitTraversal(Camera *cam, Camera *cullCam, int leavePassesInQueue)
+{
+	GtpVisibility::HierarchyInterface::InitTraversal();
+	
+	mSavedNode = NULL;
 	mLeavePassesInQueue = leavePassesInQueue;
 
@@ -178,5 +177,5 @@
 	// If camera for culling is different from camera for rendering or only solids 
 	// will be rendereded => cannot optimize
-	if (mUseOptimization && (mCamera == mCullCamera) && wasVisible && IsLeaf(node)) 
+	if (mTestGeometryForVisibleLeaves && (mCamera == mCullCamera) && wasVisible && IsLeaf(node)) 
 	{
 		//LogManager::getSingleton().logMessage("render node\n");
@@ -253,7 +252,7 @@
 }
 //-----------------------------------------------------------------------
-bool PlatformHierarchyInterface::GetUseOptimization()
-{
-	return mUseOptimization;
+bool PlatformHierarchyInterface::GetTestGeometryForVisibleLeaves()
+{
+	return mTestGeometryForVisibleLeaves;
 }
 //-----------------------------------------------------------------------
Index: trunk/VUT/Ogre/src/OgreItemBufferQueryManager.cpp
===================================================================
--- trunk/VUT/Ogre/src/OgreItemBufferQueryManager.cpp	(revision 154)
+++ trunk/VUT/Ogre/src/OgreItemBufferQueryManager.cpp	(revision 155)
@@ -32,5 +32,5 @@
 	SceneManager *sm = pfHierarchyInterface->GetSceneManager();
 
-	//-- Render scene as item buffer (e.g., color coded objects)
+	// ---- Render scene as item buffer (i.e., objects with their id as color codes)
 
 	// const_cast allowed because camera is not changed in renderScene
@@ -49,8 +49,10 @@
 	mViewport->setBackgroundColour(ColourValue(0, 0, 0, 0));
 
-	//pfHierarchyInterface->GetRenderSystem()->clearFrameBuffer(FBT_COLOUR);
-	// render item buffer
+
+	// --- render item buffer
 	pfHierarchyInterface->GetSceneManager()->_renderScene(pCam, mViewport, false);
 	
+
+
 	// reset old overlay status
 	mViewport->setOverlaysEnabled(overlayEnabled);
@@ -84,7 +86,4 @@
 			((*visibleGeometry)[id]).AddVisibility(1, 1);
 		}
-		/*else {	std::stringstream d; 
-			d << "adding pixel to geometry with id: " << id << ", buf 1: " << (int)buf[idx] << ", buf 2: " << (int)buf[idx + 1] << ", buf 3: " << (int)buf[idx + 2];
-			LogManager::getSingleton().logMessage(d.str());	}*/
 	}
 
@@ -101,9 +100,11 @@
 		return;
 
+
 	mWasInitialised = true;
 
-	SceneManager::EntityIterator it = 
-		dynamic_cast<PlatformHierarchyInterface *>(mHierarchyInterface)->
-		GetSceneManager()->getEntityIterator();
+	SceneManager *sm = 
+		dynamic_cast<PlatformHierarchyInterface *>(mHierarchyInterface)->GetSceneManager();
+
+	SceneManager::EntityIterator it = sm->getEntityIterator();
 
 	// TODO: make this more efficient
@@ -115,4 +116,15 @@
 		visibleGeometry->push_back(GtpVisibility::MeshInfo(it.getNext(), 0, 0));
 	}
+
+	// -- initialise hierarchy interface for simple node traversal
+	mHierarchyInterface->InitTraversal(false);
+
+	GtpVisibility::HierarchyNode *node = NULL;
+	
+	while (node = mHierarchyInterface->GetNextNode())
+	{
+		visibleNodes->push_back(GtpVisibility::NodeInfo(node, 0, 0));
+	}
 }
+
 } // namespace Ogre
Index: trunk/VUT/Ogre/src/OgreOcclusionQueriesQueryManager.cpp
===================================================================
--- trunk/VUT/Ogre/src/OgreOcclusionQueriesQueryManager.cpp	(revision 154)
+++ trunk/VUT/Ogre/src/OgreOcclusionQueriesQueryManager.cpp	(revision 155)
@@ -83,5 +83,5 @@
 			if (i == 0)
 			{
-				mHierarchyInterface->GetGeometry(*nodeIt, &geometryList, false);
+				mHierarchyInterface->GetNodeGeometryList(*nodeIt, &geometryList, false);
 			}
 		}
@@ -105,5 +105,5 @@
 	mViewport->setOverlaysEnabled(overlayEnabled);
 
-	//---- collect results
+	// ---- collect results
 	GtpVisibility::QueryList::iterator visQueryIt, projQueryIt;
 
@@ -135,5 +135,5 @@
 	}
 
-	//---- queries for geometry
+	// ---- queries for geometry
 	geometryIt_end = geometryList.end();
 	
@@ -154,5 +154,5 @@
 		++visQueryIt;
 
-		// approximate depth ordering during rendering => 
+		// WARNING: approximate depth ordering during rendering => 
 		// geometry maybe occluded
 		if (visiblePixels > 0)
Index: trunk/VUT/Ogre/resources/VisibilityDemo.overlay
===================================================================
--- trunk/VUT/Ogre/resources/VisibilityDemo.overlay	(revision 147)
+++ trunk/VUT/Ogre/resources/VisibilityDemo.overlay	(revision 155)
@@ -22,5 +22,5 @@
 		left 5 
 		top 5
-		width 400
+		width 430
 		height 90
 		material Core/StatsBlockCenter
@@ -46,7 +46,7 @@
 		element TextArea(Example/Visibility/AlgorithmInfo): Example/Visibility/Templates/BasicText
 		{
-			left 170
+			left 210
 			top 5
-			width 90
+			width 120
 			height 30
 			caption :
@@ -57,5 +57,5 @@
 			left 5
 			top 20
-			width 90
+			width 120
 			height 30
 			caption [-][+] Threshold
@@ -63,23 +63,23 @@
 		element TextArea(Example/Visibility/ThresholdInfo): Example/Visibility/Templates/BasicText
 		{
-			left 170
+			left 210
 			top 20
-			width 90
-			height 30
-			caption :
-		}
-		element TextArea(Example/Visibility/UseOptimization): Example/Visibility/Templates/BasicText
+			width 120
+			height 30
+			caption :
+		}
+		element TextArea(Example/Visibility/TestGeometryForVisibleLeaves): Example/Visibility/Templates/BasicText
 		{
 			left 5
 			top 35
-			width 90
-			height 30
-			caption [O] Optimization
-		}
-		element TextArea(Example/Visibility/UseOptimizationInfo): Example/Visibility/Templates/BasicText
-		{
-			left 170
+			width 120
+			height 30
+			caption [G] Test Geometry For Leaves
+		}
+		element TextArea(Example/Visibility/TestGeometryForVisibleLeavesInfo): Example/Visibility/Templates/BasicText
+		{
+			left 210
 			top 35
-			width 90
+			width 120
 			height 30
 			caption :
@@ -89,5 +89,5 @@
 			left 5
 			top 50
-			width 90
+			width 120
 			height 30
 			caption [X] Depth pass
@@ -95,7 +95,7 @@
 		element TextArea(Example/Visibility/UseDepthPassInfo): Example/Visibility/Templates/BasicText
 		{
-			left 170
+			left 210
 			top 50
-			width 90
+			width 120
 			height 30
 			caption :
@@ -105,5 +105,5 @@
 			left 5
 			top 65
-			width 90
+			width 120
 			height 30
 			caption [8][9] Assumed Visibility
@@ -112,7 +112,7 @@
 		element TextArea(Example/Visibility/AssumedVisibilityInfo): Example/Visibility/Templates/BasicText
 		{
-			left 170
+			left 210
 			top 65
-			width 90
+			width 120
 			height 30
 			caption :
@@ -128,5 +128,5 @@
 		top 5
 		width 320
-		height 120
+		height 150
 		material Core/StatsBlockCenter
         	border_size 1 1 1 1
@@ -249,4 +249,36 @@
 			left 180
 			top 95
+			width 90
+			font_name TrebuchetMSBold
+			caption :			
+		}		
+		element TextArea(Example/Visibility/DelayedQueriesIssued): Example/Visibility/Templates/BasicText
+		{
+			left 5
+			top 110
+			width 180
+			height 30
+			caption Avg. queries issued 
+		}	
+		element TextArea(Example/Visibility/DelayedQueriesIssuedInfo): Example/Visibility/Templates/BasicText
+		{
+			left 180
+			top 110
+			width 90
+			font_name TrebuchetMSBold
+			caption :			
+		}		
+		element TextArea(Example/Visibility/DelayedTraversedNodes): Example/Visibility/Templates/BasicText
+		{
+			left 5
+			top 125
+			width 180
+			height 30
+			caption Avg. traversed Nodes
+		}	
+		element TextArea(Example/Visibility/DelayedTraversedNodesInfo): Example/Visibility/Templates/BasicText
+		{
+			left 180
+			top 125
 			width 90
 			font_name TrebuchetMSBold
