Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreDepthShadowMapRenderingRun.cpp
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreDepthShadowMapRenderingRun.cpp	(revision 2379)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreDepthShadowMapRenderingRun.cpp	(revision 2406)
@@ -52,4 +52,5 @@
 		v->setBackgroundColour(ColourValue::White);
 		v->setOverlaysEnabled(false);
+		v->setSkiesEnabled(false);
 		rt->setAutoUpdated(false);
 		
@@ -77,14 +78,17 @@
 bool  OgreDepthShadowMapRenderingRun::renderableQueued (Renderable *rend, uint8 groupID, ushort priority, Technique **ppTech)
 {
+	if((*ppTech)->isTransparent())
+		return false;
+
+	String materialToSet = materialName;
 	OgreTechniqueGroup* TG = (OgreTechniqueGroup*) rend->getRenderTechniqueGroup();
 	if(TG)
 	{
-		String materialToSet = materialName;
 		String triggeredMaterial = TG->getMaterialNameForTrigger(triggerName);
 		if(triggeredMaterial != "")//a trigger is associated
 			materialToSet = triggeredMaterial;
-		Technique* techn = ((Material*)MaterialManager::getSingleton().getByName(	materialToSet ).getPointer())->getTechnique(0);
-		*ppTech = techn;	
 	}
+	Technique* techn = ((Material*)MaterialManager::getSingleton().getByName(	materialToSet ).getPointer())->getTechnique(0);
+	*ppTech = techn;	
 	return true;
 }
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreSceneCameraDepthRenderingRun.cpp
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreSceneCameraDepthRenderingRun.cpp	(revision 2379)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreSceneCameraDepthRenderingRun.cpp	(revision 2406)
@@ -38,4 +38,5 @@
 	 Viewport* v = rt->addViewport(playerCamera);
 	 v->setOverlaysEnabled(false);
+	 v->setSkiesEnabled(false);
 	 rt->setAutoUpdated(false);
 }
@@ -46,14 +47,15 @@
 		return false;
 
+	String materialToSet = String("GTP/Basic/CameraDepth");
 	OgreTechniqueGroup* TG = (OgreTechniqueGroup*) rend->getRenderTechniqueGroup();
 	if(TG)
 	{
-		String materialToSet = String("GTP/Basic/CameraDepth");
 		String triggeredMaterial = TG->getMaterialNameForTrigger("ILLUM_TRIGGER_CAMERADEPTH");
 		if(triggeredMaterial != "")//a trigger is associated
 			materialToSet = triggeredMaterial;
-		Technique* techn = ((Material*)MaterialManager::getSingleton().getByName(	materialToSet ).getPointer())->getTechnique(0);
-		*ppTech = techn;	
 	}
+
+	Technique* techn = ((Material*)MaterialManager::getSingleton().getByName(	materialToSet ).getPointer())->getTechnique(0);
+	*ppTech = techn;	
 	return true;
 }
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreDepthShadowReceiverRenderTechnique.cpp
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreDepthShadowReceiverRenderTechnique.cpp	(revision 2397)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreDepthShadowReceiverRenderTechnique.cpp	(revision 2406)
@@ -101,8 +101,14 @@
 	for(unsigned int i = 0; i < maxlights; i++)
 	{
-		while(lights.size() != l && !lights.at(l)->getCastShadows())
-		 l++;
-
-		if(lights.size() > l)
+		int lightcount = lights.size();
+		while( lightcount > l)
+		{
+		 if(!lights.at(l)->getCastShadows())
+			l++;
+		 else
+			break;
+		}
+
+		if(lightcount > l)
 		{
 			
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgrePathMapRenderTechnique.cpp
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgrePathMapRenderTechnique.cpp	(revision 2397)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgrePathMapRenderTechnique.cpp	(revision 2406)
@@ -52,6 +52,6 @@
 	GpuProgramParameters* Fparams = passToSet->getFragmentProgramParameters().getPointer();
 	
-	int prmxres = clusters->pathMapResolution * clusters->count;
-	int prmyres = clusters->pathMapResolution;
+	int prmxres = this->clusters->pathMapResolution * this->clusters->count;
+	int prmyres = this->clusters->pathMapResolution;
 	while(prmxres > 4096)
 	{
@@ -59,5 +59,5 @@
 		prmyres *= 2;		
 	}
-	int prmnt[2] = {prmxres / clusters->pathMapResolution, prmyres / clusters->pathMapResolution};
+	int prmnt[2] = {prmxres / this->clusters->pathMapResolution, prmyres / this->clusters->pathMapResolution};
 
 	float halfPixel[2] = {0.5 / prmxres, 0.5 / prmyres};
@@ -80,5 +80,5 @@
 		st1 = passToSet->createTextureUnitState();		
 		st1->setTextureFiltering(TFO_BILINEAR);
-		st1->setTextureAddressingMode(TextureUnitState::TAM_CLAMP);
+		st1->setTextureAddressingMode(TextureUnitState::TAM_BORDER);
 		st1->setTextureBorderColour(ColourValue::Green);
 
