Index: trunk/VUT/work/TestCullingTerrain/TerrainFrameListener.cpp
===================================================================
--- trunk/VUT/work/TestCullingTerrain/TerrainFrameListener.cpp	(revision 154)
+++ trunk/VUT/work/TestCullingTerrain/TerrainFrameListener.cpp	(revision 155)
@@ -89,5 +89,5 @@
 mShowOctree(false),
 mUseDepthPass(false),
-mUseOptimization(true),
+mTestGeometryForVisibleLeaves(true),
 mShowVisualization(false),
 mCullCamera(false),
@@ -101,5 +101,7 @@
 mShowQueryStats(false),
 mQueryManager(NULL),
-mVisibilityManager(NULL)
+mVisibilityManager(NULL),
+mDelayedQueriesIssued(0.0),
+mDelayedTraversedNodes(0.0)
 {
 	//mInputDevice = PlatformManager::getSingleton().createInputReader();
@@ -129,5 +131,5 @@
 	mAlgorithmInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/AlgorithmInfo");
 	mThresholdInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/ThresholdInfo");
-	mUseOptimizationInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/UseOptimizationInfo");
+	mTestGeometryForVisibleLeavesInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/TestGeometryForVisibleLeavesInfo");
 	mUseDepthPassInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/UseDepthPassInfo");
 	mAssumedVisibilityInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/AssumedVisibilityInfo");
@@ -140,5 +142,7 @@
 	mObjectsInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/ObjectsInfo");
 	mQueriesIssuedInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/QueriesIssuedInfo");
-	
+	mDelayedQueriesIssuedInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/DelayedQueriesIssuedInfo");
+	mDelayedTraversedNodesInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/DelayedTraversedNodesInfo");
+
 	mAlgorithmInfo->setCaption(": " + currentAlgorithmCaptions[mCurrentAlgorithm]);
 	mThresholdInfo->setCaption(": 0");
@@ -149,9 +153,10 @@
 	mRenderedNodesInfo->setCaption(": 0");
 	mObjectsInfo->setCaption(": 0");
-	mUseOptimizationInfo->setCaption(": true");
+	mTestGeometryForVisibleLeavesInfo->setCaption(": true");
 	mUseDepthPassInfo->setCaption(": false");
 	mQueriesIssuedInfo->setCaption(": 0");
 	mAssumedVisibilityInfo->setCaption(": 0");
-
+	mDelayedQueriesIssuedInfo->setCaption(": 0");
+	mDelayedTraversedNodesInfo->setCaption(": 0");
 
 	//-- visibility query stats overlay
@@ -170,9 +175,9 @@
 
 	// set scene manager options
-	mSceneMgr->setOption("UseOptimization", &mUseOptimization);
+	mSceneMgr->setOption("TestGeometryForVisibleLeaves", &mTestGeometryForVisibleLeaves);
 
 	// apply delayed rendering (i.e., transparents after hierarchical culling pass)
 	// only if optimization is not used 
-	bool delayRenderTransparents = !mUseOptimization;
+	bool delayRenderTransparents = !mTestGeometryForVisibleLeaves;
 
 	mSceneMgr->setOption("DelayRenderTransparents", &delayRenderTransparents);
@@ -736,6 +741,8 @@
 		mSceneMgr->getOption("NumFrustumCulledNodes", &opt); sprintf(str,": %d", opt); 
 		mFrustumCulledNodesInfo->setCaption(str);
-	
-		mSceneMgr->getOption("NumQueriesIssued", &opt); sprintf(str,": %d", opt); 
+
+		// delay so there is no jump
+		mSceneMgr->getOption("NumQueriesIssued", &opt); 
+		sprintf(str,": %d", (int)opt); 
 		mQueriesIssuedInfo->setCaption(str);
 
@@ -754,4 +761,16 @@
 		sprintf(str,": %d", mTerrainContentGenerator->GetObjectCount()); 
 		mObjectsInfo->setCaption(str);
+
+		// delay so there is no jump
+		mSceneMgr->getOption("NumQueriesIssued", &opt); 
+		mDelayedQueriesIssued = mDelayedQueriesIssued * 0.8 + (float)opt * 0.2;
+		sprintf(str,": %d", (int)mDelayedQueriesIssued); 
+		mDelayedQueriesIssuedInfo->setCaption(str);
+
+		mSceneMgr->getOption("NumTraversedNodes", &opt); 
+		mDelayedTraversedNodes = mDelayedTraversedNodes * 0.8 + (float)opt * 0.2;
+		sprintf(str,": %d", (int)mDelayedTraversedNodes); 
+		mDelayedTraversedNodesInfo->setCaption(str);
+
 	}
 	catch (...)
@@ -761,22 +780,23 @@
 }
 //-----------------------------------------------------------------------
-void TerrainFrameListener::toggleUseOptimization()
-{
-	mUseOptimization = !mUseOptimization;
-	mSceneMgr->setOption("UseOptimization", &mUseOptimization);
+void TerrainFrameListener::toggleTestGeometryForVisibleLeaves()
+{
+	mTestGeometryForVisibleLeaves = !mTestGeometryForVisibleLeaves;
+	mSceneMgr->setOption("TestGeometryForVisibleLeaves", &mTestGeometryForVisibleLeaves);
 	
 	// disable optimization which tests geometry instead of aabb
 	// for delayed rendering (i.e., render transparents after all the solids)
 	// because otherwise visible transparents could be skipped
-	bool delayedRendering = !mUseOptimization;
+	bool delayedRendering = !mTestGeometryForVisibleLeaves;
+
 	mSceneMgr->setOption("DelayRenderTransparents", &delayedRendering);
 
-	if (mUseOptimization)
-	{
-		mUseOptimizationInfo->setCaption(": true");
+	if (mTestGeometryForVisibleLeaves)
+	{
+		mTestGeometryForVisibleLeavesInfo->setCaption(": true");
 	}
 	else
 	{
-		mUseOptimizationInfo->setCaption(": false");
+		mTestGeometryForVisibleLeavesInfo->setCaption(": false");
 	}
 }
@@ -898,6 +918,6 @@
 		toggleDisplayCameraDetails();
 		break;
-	case KC_O:
-		toggleUseOptimization();
+	case KC_G:
+		toggleTestGeometryForVisibleLeaves();
 		break;
 	case KC_T:
Index: trunk/VUT/work/TestCullingTerrain/TestCullingTerrainApplication.cpp
===================================================================
--- trunk/VUT/work/TestCullingTerrain/TestCullingTerrainApplication.cpp	(revision 150)
+++ trunk/VUT/work/TestCullingTerrain/TestCullingTerrainApplication.cpp	(revision 155)
@@ -162,6 +162,6 @@
 
 		// the objects are generated on the whole terrain
-		//mTerrainContentGenerator->GenerateScene(1500, "robot");
-		mTerrainContentGenerator->GenerateScene(1500, "athene");
+		mTerrainContentGenerator->GenerateScene(1500, "robot");
+		//mTerrainContentGenerator->GenerateScene(1500, "athene");
 		//mTerrainContentGenerator->GenerateScene(500, "ninja");
 	}
Index: trunk/VUT/work/TestCullingTerrain/TerrainFrameListener.h
===================================================================
--- trunk/VUT/work/TestCullingTerrain/TerrainFrameListener.h	(revision 154)
+++ trunk/VUT/work/TestCullingTerrain/TerrainFrameListener.h	(revision 155)
@@ -109,5 +109,5 @@
     void changeThreshold(int incr);
 	void changeAssumedVisibility(int incr);
-	void toggleUseOptimization();
+	void toggleTestGeometryForVisibleLeaves();
 	void toggleShowOctree();
 	void toggleUseDepthPass();
@@ -159,9 +159,11 @@
     OverlayElement *mTraversedNodesInfo;
 	OverlayElement *mHierarchyNodesInfo;
-	OverlayElement *mUseOptimizationInfo;
+	OverlayElement *mTestGeometryForVisibleLeavesInfo;
 	OverlayElement *mUseDepthPassInfo;
 	OverlayElement *mRenderedNodesInfo;
 	OverlayElement *mObjectsInfo;
 	OverlayElement *mQueriesIssuedInfo;
+	OverlayElement *mDelayedQueriesIssuedInfo;
+	OverlayElement *mDelayedTraversedNodesInfo;
 
 	OverlayElement *mQueryTypeInfo;
@@ -175,5 +177,5 @@
 	TerrainContentGenerator *mTerrainContentGenerator;
 
-	bool mUseOptimization;
+	bool mTestGeometryForVisibleLeaves;
 	bool mShowOctree;
 	bool mUseDepthPass;
@@ -236,4 +238,7 @@
 	//bool mUseBufferedInputKeys, mUseBufferedInputMouse, mInputTypeSwitchingOn;
 	PlatformQueryManager *mQueryManager;
+
+	float mDelayedQueriesIssued;
+	float mDelayedTraversedNodes;
 };
 
Index: trunk/VUT/work/TestCulling/TestCullingApplication.cpp
===================================================================
--- trunk/VUT/work/TestCulling/TestCullingApplication.cpp	(revision 139)
+++ trunk/VUT/work/TestCulling/TestCullingApplication.cpp	(revision 155)
@@ -112,5 +112,5 @@
 mShowOctree(false),
 mUseDepthPass(false),
-mUseOptimization(true),
+mTestGeometryForVisibleLeaves(true),
 mShowVisualization(false),
 mVisualizeCulledNodes(false)
@@ -137,6 +137,7 @@
 	mRenderedNodesInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/RenderedNodesInfo");
 	mObjectsInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/ObjectsInfo");
-	mUseOptimizationInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/UseOptimizationInfo");
+	mTestGeometryForVisibleLeavesInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/TestGeometryForVisibleLeavesInfo");
 	mQueriesIssuedInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/QueriesIssuedInfo");
+	
 
 	mAlgorithmInfo->setCaption(": " + mCurrentAlgorithmCaptions[mCurrentAlgorithm]);
@@ -148,10 +149,11 @@
 	mRenderedNodesInfo->setCaption(": 0");
 	mObjectsInfo->setCaption(": 0");
-	mUseOptimizationInfo->setCaption(": true");
+	mTestGeometryForVisibleLeavesInfo->setCaption(": true");
 	mQueriesIssuedInfo->setCaption(": 0");
+	
 
 	setAlgorithm(mCurrentAlgorithm);
 	
-	mSceneMgr->setOption("UseOptimization", &mUseOptimization);
+	mSceneMgr->setOption("TestGeometryForVisibleLeaves", &mTestGeometryForVisibleLeaves);
 	mSceneMgr->setOption("UseDepthPass", &mUseDepthPass);
 	mSceneMgr->setOption("ShowVizualisation", &mShowVisualization);
@@ -236,5 +238,5 @@
 	KEY_PRESSED(KC_SUBTRACT, 0, changeThreshold(-10));
 	KEY_PRESSED(KC_ADD, 0, changeThreshold(10));
-	KEY_PRESSED(KC_O, 0.3, toggleUseOptimization());
+	KEY_PRESSED(KC_O, 0.3, toggleTestGeometryForVisibleLeaves());
 	KEY_PRESSED(KC_C, 0.3, toggleUseDepthPass());
 	KEY_PRESSED(KC_V, 0.3, toggleShowViz());
@@ -264,14 +266,14 @@
 }
 //-----------------------------------------------------------------------
-void TerrainFrameListener::toggleUseOptimization()
-{
-	mUseOptimization = !mUseOptimization;
-
-	mSceneMgr->setOption("UseOptimization", &mUseOptimization);
-
-	if(mUseOptimization)
-		mUseOptimizationInfo->setCaption(": true");
+void TerrainFrameListener::toggleTestGeometryForVisibleLeaves()
+{
+	mTestGeometryForVisibleLeaves = !mTestGeometryForVisibleLeaves;
+
+	mSceneMgr->setOption("TestGeometryForVisibleLeaves", &mTestGeometryForVisibleLeaves);
+
+	if(mTestGeometryForVisibleLeaves)
+		mTestGeometryForVisibleLeavesInfo->setCaption(": true");
 	else
-		mUseOptimizationInfo->setCaption(": false");
+		mTestGeometryForVisibleLeavesInfo->setCaption(": false");
 }
 //-----------------------------------------------------------------------
Index: trunk/VUT/work/TestCulling/TestCullingApplication.h
===================================================================
--- trunk/VUT/work/TestCulling/TestCullingApplication.h	(revision 133)
+++ trunk/VUT/work/TestCulling/TestCullingApplication.h	(revision 155)
@@ -64,5 +64,5 @@
 	void changeThreshold(int incr);
 	void updateStats();
-	void toggleUseOptimization();
+	void toggleTestGeometryForVisibleLeaves();
 	void toggleShowOctree();
 	void toggleUseDepthPass();
@@ -87,10 +87,10 @@
 	OverlayElement *mRenderedNodesInfo;
 	OverlayElement *mObjectsInfo;
-	OverlayElement *mUseOptimizationInfo;
+	OverlayElement *mTestGeometryForVisibleLeavesInfo;
 	OverlayElement *mQueriesIssuedInfo;
 
 	SceneContentGenerator *mSceneContentGenerator;
 
-	bool mUseOptimization;
+	bool mTestGeometryForVisibleLeaves;
 	bool mShowOctree;
 	bool mUseDepthPass;
