Index: GTP/trunk/App/Demos/Vis/KdTreeDemo/README.txt
===================================================================
--- GTP/trunk/App/Demos/Vis/KdTreeDemo/README.txt	(revision 1300)
+++ GTP/trunk/App/Demos/Vis/KdTreeDemo/README.txt	(revision 1304)
@@ -62,4 +62,9 @@
       2 ... use view cells and visibility filter
     These setting can also be changeg ingame (see INGAME COMMANDS).
+    
+  --nodelrq
+    Do not delete render queue after each frame (which actually is normal
+    Ogre behavior). Deleting the render queue significantly improves framerates
+    when using occlusion culling.
 
   --comment
@@ -87,6 +92,6 @@
   --buildmode <bm_id>
     Select the mode of building the KdTree.
-      Priority Queue    bm_id=PQ (DEFAULT)
-      Recursive         bm_id=RE
+      Priority Queue    bm_id=PQ
+      Recursive         bm_id=RE (DEFAULT)
     This setting can also be changed ingame (see INGAME COMMANDS).
 
Index: GTP/trunk/App/Demos/Vis/KdTreeDemo/OGRE/include/TestKdTreeAppListener.h
===================================================================
--- GTP/trunk/App/Demos/Vis/KdTreeDemo/OGRE/include/TestKdTreeAppListener.h	(revision 1300)
+++ GTP/trunk/App/Demos/Vis/KdTreeDemo/OGRE/include/TestKdTreeAppListener.h	(revision 1304)
@@ -132,10 +132,11 @@
 		mKT(2.0f),
 		mKI(1.0f),
-		mMaxDepth(12),
+		mMaxDepth(10),
 		mSceneManager(SM_KDT),
 		mRenderMethod(KdTree::KDRM_GTP_CHC),
-		mBuildMethod(KdTree::KDBM_PRIORITYQUEUE),
+		mBuildMethod(KdTree::KDBM_RECURSIVE),
 		mSceneType(ST_SIMPLE),
 		mViewCells(VCM_OFF),
+		mDelRenderQueue(true),
 		mFastStart(false),
 		mBurnIn(false),
@@ -164,4 +165,5 @@
 		int mSceneType;
 		int mViewCells;
+		bool mDelRenderQueue;
 		bool mFastStart;
 		bool mBurnIn;
Index: GTP/trunk/App/Demos/Vis/KdTreeDemo/OGRE/src/TestKdTree.cpp
===================================================================
--- GTP/trunk/App/Demos/Vis/KdTreeDemo/OGRE/src/TestKdTree.cpp	(revision 1300)
+++ GTP/trunk/App/Demos/Vis/KdTreeDemo/OGRE/src/TestKdTree.cpp	(revision 1304)
@@ -42,5 +42,6 @@
 				.addOpt("f","faststart", ARGUMENT_NONE)
 				.addOpt("b","burnin", ARGUMENT_NONE)
-				.addOpt("v","viewcells", ARGUMENT_OPTIONAL);
+				.addOpt("v","viewcells", ARGUMENT_OPTIONAL)
+				.addOpt("","nodelrq", ARGUMENT_NONE);
 
 
@@ -49,4 +50,5 @@
 			cmdparser.getOpt("l", options.mDemoLogfileName);
 			cmdparser.getOpt("comment", options.mComment);
+			options.mDelRenderQueue = !cmdparser.getOpt("nodelrq");
 			options.mFastStart = cmdparser.getOpt("f");
 			options.mBurnIn = cmdparser.getOpt("b");
@@ -621,4 +623,5 @@
 		mSceneMgr->setOption("RenderMethod", &mOptions.mRenderMethod);
 		mSceneMgr->setOption("EnhancedVisibility", &mOptions.mEnhancedVisibility);
+		mSceneMgr->setOption("DeleteRenderQueue", &mOptions.mDelRenderQueue);
 		// fix
 		bool depthpass = false;
@@ -630,4 +633,5 @@
 		int alg = CONV_KDT_TO_OCM_ALG(mOptions.mRenderMethod);
 		mSceneMgr->setOption("Algorithm", &alg);
+		mSceneMgr->setOption("DeleteRenderQueue", &mOptions.mDelRenderQueue);
 	}
 
Index: GTP/trunk/App/Demos/Vis/KdTreeDemo/OGRE/src/TestKdTreeAppListener.cpp
===================================================================
--- GTP/trunk/App/Demos/Vis/KdTreeDemo/OGRE/src/TestKdTreeAppListener.cpp	(revision 1301)
+++ GTP/trunk/App/Demos/Vis/KdTreeDemo/OGRE/src/TestKdTreeAppListener.cpp	(revision 1304)
@@ -122,6 +122,8 @@
 // rendering/texture options
 mSceneDetailIndex(PM_SOLID),
-mFiltering(TFO_ANISOTROPIC),
-mAniso(8),
+//mFiltering(TFO_ANISOTROPIC),
+//mAniso(8),
+mFiltering(TFO_BILINEAR),
+mAniso(1),
 // chc stats
 mDelayedQueriesIssued(0.0f),
@@ -139,5 +141,5 @@
 mTimeUntilNextToggle(0.0f),
 // stuff for walkthrough recording/playback
-mTimeUntilNextLogWrite(options.mDemoInterval),
+mTimeUntilNextLogWrite(0.0f),
 mTimeRemaining(0.0f),
 mWaitBeforeDemoStart(0.0f),
@@ -208,4 +210,6 @@
 		// force X second wait when in demo mode - avoids initial low framerate due to loading delays
 		mWaitBeforeDemoStart = DEMO_WAIT;
+		// wait one interval before first write
+		mTimeUntilNextLogWrite = mOptions.mDemoInterval;
 		// set playback icon
 		togglePlayback();
@@ -1336,7 +1340,12 @@
 				saveLog();
 				if (mOptions.mBurnIn)
+				{
+					mTimeUntilNextLogWrite = mOptions.mDemoInterval;
 					togglePlayback();
+				}
 				else
+				{
 					return false;
+				}
 			}
 		}
@@ -1736,4 +1745,5 @@
 		logread >> line;
 		storedname = line.substr(0,line.find_first_of(','));
+		logread.close();
 		if (storedname != demoname)
 		{
@@ -1741,5 +1751,4 @@
 				"##Error##: Saved demo stats do not match the current demo: " +
 				storedname + " != " + demoname);
-			logread.close();
 			return;
 		}
@@ -1760,6 +1769,6 @@
 			// minFPS, avgFPS, maxFPS, frames, time, render system, comment, record separator
 			logheader << "\"min FPS\"" << fs << "\"avg FPS\"" << fs << "\"max FPS\"" << fs 
-				<< "\"# Frames \"" << fs << "\"Total Time\"" << fs << "\"Render System\"" << fs
-				<< "\"Comment\"" << rs;
+				<< "\"# Frames \"" << fs << "\"Total Time\"" << fs << "\"Comment\"" << fs
+				<< "\"Render System\"" << rs;
 			logheader.close();
 		}
@@ -1786,4 +1795,11 @@
 		}
 		rendersys += "\"";
+
+		// view cells used?
+		String viewcells;
+		if (mOptions.mViewCells == VCM_ON)
+			viewcells = ds + "VC";
+		else if (mOptions.mViewCells == VCM_FILTER)
+			viewcells = ds + "VC+VF";
 
 		// demo settings
@@ -1803,9 +1819,9 @@
 			logwrite << ds << RENDERMETHOD[mOptions.mRenderMethod] << ds << senhvis << 
 				mOptions.mMaxDepth << ds << mOptions.mKT << ds << mOptions.mKI << ds << 
-				BUILDMETHOD[mOptions.mBuildMethod];
+				BUILDMETHOD[mOptions.mBuildMethod] << viewcells;
 		}
 		else if (mOptions.mSceneManager == SM_OCM && mOptions.mRenderMethod != KdTree::KDRM_INTERNAL)
 		{
-			logwrite << ds << RENDERMETHOD[CONV_OCM_TO_KDT_ALG(mOptions.mRenderMethod)];
+			logwrite << ds << RENDERMETHOD[CONV_OCM_TO_KDT_ALG(mOptions.mRenderMethod)] << viewcells;
 		}
 		logwrite << "\"" << fs;
@@ -1829,5 +1845,5 @@
 		logwrite << (int)minFPS << fs << (int)avgFPS << fs << (int)maxFPS << fs 
 			<< mDemoStats.mTotalNumFrames << fs << mDemoStats.mTotalEllapsedTime << fs
-			<< rendersys << fs << "\"" << mOptions.mComment << "\"" << rs;
+			<< "\"" << mOptions.mComment << "\"" << fs << rendersys << rs;
 		logwrite.close();
 	}
