Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreDepthShadowReceiverRenderTechnique.cpp
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreDepthShadowReceiverRenderTechnique.cpp	(revision 2299)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreDepthShadowReceiverRenderTechnique.cpp	(revision 2333)
@@ -125,6 +125,5 @@
 				GpuProgramParametersSharedPtr fpParams = passes.at(i)->getFragmentProgramParameters();
 				GpuProgramParametersSharedPtr vpParams = passes.at(i)->getVertexProgramParameters();
-			
-				//fpParams->setNamedConstant("lightViewProj", depthRun->getLightViewProjMatrix()); 
+
 				if(setLightViewProjMatrix)
 					vpParams->setNamedConstant(lightViewProjParamName, depthRun->getLightViewProjMatrix());
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgrePathMapRenderTechnique.cpp
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgrePathMapRenderTechnique.cpp	(revision 2299)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgrePathMapRenderTechnique.cpp	(revision 2333)
@@ -63,5 +63,5 @@
 	TextureUnitState* st = newpass->createTextureUnitState();		
 	st->setTextureFiltering(TFO_BILINEAR);
-	st->setTextureAddressingMode(TextureUnitState::TAM_BORDER);
+	st->setTextureAddressingMode(TextureUnitState::TAM_CLAMP);
 	st->setTextureBorderColour(ColourValue::Green);
 	st->setTextureName(clusters->pathMapTextureFilename);
@@ -71,5 +71,5 @@
 	st = newpass->createTextureUnitState();		
 	st->setTextureFiltering(TFO_NONE);
-	st->setTextureAddressingMode(TextureUnitState::TAM_BORDER);
+	st->setTextureAddressingMode(TextureUnitState::TAM_CLAMP);
 	st->setTextureBorderColour(ColourValue::Red);
 	st->setTextureName(weightIndexTexture->getName());
@@ -77,5 +77,5 @@
 	st = newpass->createTextureUnitState();		
 	st->setTextureFiltering(TFO_NONE);
-	st->setTextureAddressingMode(TextureUnitState::TAM_BORDER);
+	st->setTextureAddressingMode(TextureUnitState::TAM_CLAMP);
 	st->setTextureBorderColour(ColourValue::Blue);
 
@@ -122,39 +122,18 @@
 	LightList lights;
 	SceneManager* sm = Root::getSingleton()._getCurrentSceneManager();
-	sm->_populateLightList(Vector3(0,0,0), 1000, lights); //TODO
-//TODO set weights
-	/*
-	unsigned int entryPointCount = OgreIlluminationManager::getSingleton().getPathMapEntryPoints().size();
-	PathMapClusters* clusters = OgreIlluminationManager::getSingleton().getPathMapClusters(parentOgreRenderable->getName());
-	int weightTextureWidth = clusters->count / 4;
-	*/
-	for(int i = 0 ; i < 1; i++)
-	{
-		String lightName = lights.at(0)->getName();
+	sm->_populateLightList(OgreIlluminationManager::getSingleton().getMainCamera()->getPosition(), 1000, lights);
+
+	for(int i = 0 ; i < 5 && i < lights.size(); i++)
+	{
+		String lightName = lights.at(i)->getName();
 		OgreIlluminationManager::getSingleton().createPerLightRun(lightName, ILLUMRUN_PM_WEIGHTMAP);
-		OgreIlluminationManager::getSingleton().updatePerLightRun(lightName, ILLUMRUN_PM_WEIGHTMAP, frameNum);
-		OgrePMWeightComputeRenderingRun* PMWeightRun = (OgrePMWeightComputeRenderingRun*)
-			OgreIlluminationManager::getSingleton().getPerLightRun(lightName, ILLUMRUN_PM_WEIGHTMAP)->asOgreRenderingRun();
-
-		TextureUnitState* st = pathMapPass->getTextureUnitState(2);
-		st->setTextureName(PMWeightRun->getPMWeightTetureName());
-
-		/*
-		TexturePtr tex = TextureManager::getSingleton().getByName(PMWeightRun->getPMWeightTetureName());
-		float *allClusterWeights = new float[entryPointCount];
-		PixelBox lockBox(entryPointCount, 1, 1, PF_FLOAT32_R, allClusterWeights);
-		tex->getBuffer()->blitToMemory(lockBox);
-
-		float *weightIndices = new float[clusters->count];
-		for(int j = 0; j< clusters->count; j++)
-			weightIndices[j] = allClusterWeights[clusters->clusters[j]];
-		
-		PixelBox lockBox2(weightTextureWidth, 1, 1, PF_FLOAT32_RGBA, weightIndices);
-		weightIndexTexture->getBuffer()->blitFromMemory(lockBox2);
-
-		TextureUnitState* st = pathMapPass->getTextureUnitState(1);
-		st->setTextureName(weightIndexTexture->getName());	*/			
+		OgreIlluminationManager::getSingleton().updatePerLightRun(lightName, ILLUMRUN_PM_WEIGHTMAP, frameNum);		
 	}
-}
+	OgrePMWeightComputeRenderingRun::sumWeights(frameNum);
+	TextureUnitState* st = pathMapPass->getTextureUnitState(2);
+	st->setTextureName(OgrePMWeightComputeRenderingRun::getPMWeightTextureName());
+}
+
+
 
 namespace PathMapParsers
