Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/OgreIlluminationManager.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/OgreIlluminationManager.h	(revision 836)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/OgreIlluminationManager.h	(revision 874)
@@ -20,5 +20,5 @@
 	@brief Implementation of IlluminationManager in an OGRE environment.
 */
-class OgreIlluminationManager
+class OgreIlluminationManager: public FrameListener
 {
 protected:
@@ -251,4 +251,10 @@
 	*/
 	void updatePerLightRun(String lightName, RenderingRunType runType, unsigned long frameNum);
+
+	bool frameStarted(const FrameEvent& evt)
+    {
+		update(Root::getSingleton().getCurrentFrameNumber(), mainViewport->getTarget());
+		return FrameListener::frameStarted(evt);
+	}
 };
 
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreDepthShadowMapRenderingRun.cpp
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreDepthShadowMapRenderingRun.cpp	(revision 808)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreDepthShadowMapRenderingRun.cpp	(revision 874)
@@ -10,6 +10,6 @@
 														   )
 														   :DepthShadowMapRenderingRun(resolutionX, resolutionY)
-														   , OgreRenderingRun(0, 1)
-														   , RenderingRun(0, 1)
+														   , OgreRenderingRun(1, 1)
+														   , RenderingRun(1, 1)
 {
 	this->light = light;
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreSceneCameraDepthRenderingRun.cpp
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreSceneCameraDepthRenderingRun.cpp	(revision 790)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreSceneCameraDepthRenderingRun.cpp	(revision 874)
@@ -7,6 +7,6 @@
 														   )
 														   :SceneCameraDepthRenderingRun()
-														   , OgreRenderingRun(0, 1)
-														   , RenderingRun(0, 1)
+														   , OgreRenderingRun(1, 1)
+														   , RenderingRun(1, 1)
 {
 	this->sharedRuns = sharedRuns;
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreConvolvedCubeMapRenderTechnique.cpp
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreConvolvedCubeMapRenderTechnique.cpp	(revision 836)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreConvolvedCubeMapRenderTechnique.cpp	(revision 874)
@@ -196,5 +196,5 @@
 {	
 	//reset parameters
-	startFrame = 0;
+	startFrame = 1;
 	cubeMapUpdateInterval = 1;
 	cubeMapResolution = 256;
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreCubeMapRenderTechnique.cpp
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreCubeMapRenderTechnique.cpp	(revision 836)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreCubeMapRenderTechnique.cpp	(revision 874)
@@ -165,5 +165,5 @@
 {	
 	//reset parameters
-	startFrame = 0;
+	startFrame = 1;
 	cubeMapUpdateInterval = 1;
 	cubeMapResolution = 256;												
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreCausticCasterRenderTechnique.cpp
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreCausticCasterRenderTechnique.cpp	(revision 836)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreCausticCasterRenderTechnique.cpp	(revision 874)
@@ -202,5 +202,5 @@
 {	
 	//reset parameters
-	startFrame = 0;
+	startFrame = 1;
 	photonMapUpdateInterval = 1;
 	photonMapResolution = 64;
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreSBBRenderTechnique.cpp
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreSBBRenderTechnique.cpp	(revision 836)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreSBBRenderTechnique.cpp	(revision 874)
@@ -60,5 +60,5 @@
 {	
 	//reset parameters
-	depthTexID = 0;
+	depthTexID = 1;
 	
 	parseParams(params);
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreDistanceCubeMapRenderTechnique.cpp
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreDistanceCubeMapRenderTechnique.cpp	(revision 836)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreDistanceCubeMapRenderTechnique.cpp	(revision 874)
@@ -166,5 +166,5 @@
 {	
 	//reset parameters
-	startFrame = 0;
+	startFrame = 1;
 	cubeMapUpdateInterval = 1;
 	cubeMapResolution = 256;												
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/OgreIlluminationManager.cpp
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/OgreIlluminationManager.cpp	(revision 836)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/OgreIlluminationManager.cpp	(revision 874)
@@ -361,9 +361,4 @@
 
 	}
-
-	Root::getSingleton().renderOneFrame();
-	//Root::getSingleton()._updateAllRenderTargets();
-
-
 }
 
Index: GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderingRuns/DepthShadowMapRenderingRun.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderingRuns/DepthShadowMapRenderingRun.h	(revision 780)
+++ GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderingRuns/DepthShadowMapRenderingRun.h	(revision 874)
@@ -18,5 +18,5 @@
 	DepthShadowMapRenderingRun( unsigned int resolutionX,
 								  unsigned int resolutionY)
-							:RenderingRun(0, 1)
+							:RenderingRun(1, 1)
 	{
 		this->resolutionX = resolutionX;
Index: GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderingRuns/SceneCameraDepthRenderingRun.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderingRuns/SceneCameraDepthRenderingRun.h	(revision 780)
+++ GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderingRuns/SceneCameraDepthRenderingRun.h	(revision 874)
@@ -14,5 +14,5 @@
 	*/
 	SceneCameraDepthRenderingRun()
-							:RenderingRun(0, 1)
+							:RenderingRun(1, 1)
 	{
 	}
Index: GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderingRun.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderingRun.h	(revision 790)
+++ GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderingRun.h	(revision 874)
@@ -57,5 +57,5 @@
 			if ( updateInterval == 0 ) //update only once
 			{
-				if( lastupdated == -1)
+				if( lastupdated == 0)
 				{
 					return true;
Index: GTP/trunk/Lib/Illum/IllumModule/IllumModule/src/RenderingRun.cpp
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/IllumModule/src/RenderingRun.cpp	(revision 780)
+++ GTP/trunk/Lib/Illum/IllumModule/IllumModule/src/RenderingRun.cpp	(revision 874)
@@ -6,5 +6,5 @@
 							unsigned long updateInterval)
 {
-	lastupdated = -1;
+	lastupdated = 0;
 	this->startFrame = startFrame;
 	this->updateInterval = updateInterval;
Index: GTP/trunk/Lib/Illum/IllumModule/IllumModule/src/RenderingRuns/ColorCubeMapRenderingRun.cpp
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/IllumModule/src/RenderingRuns/ColorCubeMapRenderingRun.cpp	(revision 780)
+++ GTP/trunk/Lib/Illum/IllumModule/IllumModule/src/RenderingRuns/ColorCubeMapRenderingRun.cpp	(revision 874)
@@ -34,5 +34,5 @@
 	else
 	{
-		if(lastupdated == -1 && updateInterval == 0)
+		if(lastupdated == 0 && updateInterval == 0)
 		{
 			for(int i=0;i<6;i++)
Index: GTP/trunk/Lib/Illum/IllumModule/IllumModule/src/RenderingRuns/DistanceCubeMapRenderingRun.cpp
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/IllumModule/src/RenderingRuns/DistanceCubeMapRenderingRun.cpp	(revision 780)
+++ GTP/trunk/Lib/Illum/IllumModule/IllumModule/src/RenderingRuns/DistanceCubeMapRenderingRun.cpp	(revision 874)
@@ -34,5 +34,5 @@
 	else
 	{
-		if(lastupdated == -1 && updateInterval == 0)
+		if(lastupdated == 0 && updateInterval == 0)
 		{
 			for(int i=0;i<6;i++)
Index: GTP/trunk/Lib/Illum/IllumModule/IllumModule/src/RenderingRuns/CausticCubeMapRenderingRun.cpp
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/IllumModule/src/RenderingRuns/CausticCubeMapRenderingRun.cpp	(revision 780)
+++ GTP/trunk/Lib/Illum/IllumModule/IllumModule/src/RenderingRuns/CausticCubeMapRenderingRun.cpp	(revision 874)
@@ -26,5 +26,5 @@
 	else
 	{
-		if(lastupdated == -1 && updateInterval == 0)
+		if(lastupdated == 0 && updateInterval == 0)
 		{
 			for(int i=0;i<6;i++)
Index: GTP/trunk/Lib/Illum/IllumModule/IllumModule/src/RenderingRuns/ReducedCubeMapRenderingRun.cpp
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/IllumModule/src/RenderingRuns/ReducedCubeMapRenderingRun.cpp	(revision 780)
+++ GTP/trunk/Lib/Illum/IllumModule/IllumModule/src/RenderingRuns/ReducedCubeMapRenderingRun.cpp	(revision 874)
@@ -34,5 +34,5 @@
 	else
 	{
-		if(lastupdated == -1 && updateInterval == 0)
+		if(lastupdated == 0 && updateInterval == 0)
 		{
 			for(int i=0;i<6;i++)
