Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/OgreIlluminationManager.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/OgreIlluminationManager.h	(revision 1711)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/OgreIlluminationManager.h	(revision 2185)
@@ -17,8 +17,22 @@
 #include "OgreIllumVolumeRenderTechnique.h"
 #include "OgrePhaseTextureRenderingRun.h"
+#include "OgrePathMapRenderTechnique.h"
 
 
 using namespace Ogre;
 
+struct PathMapClusters
+{
+	unsigned int count;
+	unsigned int* clusters;
+	String pathMapTextureFilename;
+	unsigned int pathMapResolution;
+};
+
+struct PathMapEntryPoint
+{
+    Vector3 position;
+	Vector3 normal;
+};
 /**
 	@brief Implementation of IlluminationManager in an OGRE environment.
@@ -77,4 +91,7 @@
 	unsigned int phaseTextureSize;
 	std::map<RenderingRunType,float> maxRads;
+	std::map<String, PathMapClusters> pathMapClusters;
+	std::vector<PathMapEntryPoint> pathMapEntryPoints;
+	std::vector<unsigned int> pathMapClusterLengths;
 	/**
 		@brief The camera attached to the player.
@@ -317,4 +334,21 @@
 	void setBlurShadowMap(bool use){blurSM = use;}
 	void setShadowMapMaterialName(String name){shadowMapMaterialName = name;}
+
+	void addPathMapClusters(String subEntityName, PathMapClusters clusters)
+	{
+		this->pathMapClusters[subEntityName] = clusters;
+	}
+	PathMapClusters* getPathMapClusters(String subEntityName)
+	{
+		return &pathMapClusters[subEntityName];
+	}
+	void addPathMapEntryPoint(PathMapEntryPoint p)
+	{
+		this->pathMapEntryPoints.push_back(p);
+	}
+	void addPathMapClusterLength(unsigned int l)
+	{
+		this->pathMapClusterLengths.push_back(l);
+	}
 };
 
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgrePathMapRenderTechnique.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgrePathMapRenderTechnique.h	(revision 2185)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgrePathMapRenderTechnique.h	(revision 2185)
@@ -0,0 +1,73 @@
+#pragma once
+
+//disable inheritance warning caused by multiple inheritance
+#if _WIN32
+#if _MSC_VER
+#pragma warning(disable: 4250)
+#endif
+#endif
+
+#include "OgreRenderTechnique.h"
+#include "Ogre.h"
+
+using namespace Ogre;
+
+struct PathMapClusters;
+/**
+	@brief DepthShadowRecieverRenderTechnique used in an OGRE environment.
+
+	This technique defines that the object will recieve shadows with the help of depth shadow maps.
+	Each lightsource can have a depth map assigned to it. These are going to be refreshed only 
+	if shadow recievers are visible. It is the shadow reciever technique's resposibility
+	to refresh them.
+
+	The shadows from each light are calculated in separate passes. Each pass will
+	modulate the shaded image, so thes should be the last passes (but before caustic passes).
+	The given Pass* parameter n the constructor defines the pass after which new
+	shadow recieving passes will be added by the technique.
+
+*/
+class OgrePathMapRenderTechnique : public OgreRenderTechnique
+{
+public:
+	/**
+		@brief Constructor.
+
+		@param maxlights				the maximum number of light sources to recieve shadow from
+		@param shadowVertexProgram		the vertex program to be used in the shadowing passes
+		@param shadowFragmentProgram	the fragment program to be used in the shadowing passes
+										It should have one pass and the depth map of a light will be bound to the first sampler unit. 
+		@param pass						the pass after which shadowing passes should be added
+		@param parentRenderable			the object to operate on
+		@param parentTechniqueGroup		the TechniqueGroup this RenderedTechnique is attached to
+	*/
+	OgrePathMapRenderTechnique(Pass* pass,
+							OgreRenderable* parentRenderable,
+							OgreTechniqueGroup* parentTechniqueGroup
+							);
+	/**
+		@brief Destructor.
+	*/
+	~OgrePathMapRenderTechnique();
+	
+	//inherited
+	virtual void update(unsigned long frameNum);
+	
+protected:	
+	
+	PathMapClusters* clusters;	
+};
+
+
+class OgrePathMapRenderTechniqueFactory : public RenderTechniqueFactory
+{
+public:
+	
+	OgrePathMapRenderTechniqueFactory();
+
+	OgreRenderTechnique* createInstance(IllumTechniqueParams* params,
+										Pass* pass,
+										OgreRenderable* parentRenderable,
+										OgreTechniqueGroup* parentTechniqueGroup);
+};
+
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/scripts/OgreIllumModule.7.10.vcproj
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/scripts/OgreIllumModule.7.10.vcproj	(revision 2174)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/scripts/OgreIllumModule.7.10.vcproj	(revision 2185)
@@ -171,4 +171,7 @@
 				</File>
 				<File
+					RelativePath="..\src\RenderTechniques\OgrePathMapRenderTechnique.cpp">
+				</File>
+				<File
 					RelativePath="..\src\RenderTechniques\OgreSBBRenderTechnique.cpp">
 				</File>
@@ -268,4 +271,7 @@
 				</File>
 				<File
+					RelativePath="..\include\RenderTechniques\OgrePathMapRenderTechnique.h">
+				</File>
+				<File
 					RelativePath="..\include\RenderTechniques\OgreSBBRenderTechnique.h">
 				</File>
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgrePathMapRenderTechnique.cpp
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgrePathMapRenderTechnique.cpp	(revision 2185)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgrePathMapRenderTechnique.cpp	(revision 2185)
@@ -0,0 +1,93 @@
+#include "OgrePathMapRenderTechnique.h"
+#include "OgreTechniqueGroup.h"
+#include "OgreIlluminationManager.h"
+
+
+OgrePathMapRenderTechnique::OgrePathMapRenderTechnique(											
+												Pass* pass,
+												OgreRenderable* parentRenderable,
+												OgreTechniqueGroup* parentTechniqueGroup)
+							:RenderTechnique( parentRenderable, parentTechniqueGroup),
+							OgreRenderTechnique(pass, parentRenderable, parentTechniqueGroup)
+{		
+	this->clusters = OgreIlluminationManager::getSingleton().getPathMapClusters(parentRenderable->getName());
+	
+	//insert new pass
+	Ogre::Technique* techn = pass->getParent();
+	Technique::PassIterator it = techn->getPassIterator();
+	
+	int index = 0;
+	while(it.hasMoreElements())
+	{
+		if( it.getNext() == pass)
+			break;
+		index++;
+		it.moveNext();
+	}
+	
+	Pass* newpass = techn->createPass();
+	
+	newpass->setVertexProgram("GTP/PathMap_VS");
+	newpass->setFragmentProgram("GTP/PathMap_PS");
+	
+	//bind vertex program parameters
+	GpuProgramParameters* Vparams = newpass->getVertexProgramParameters().getPointer();
+	Vparams->setNamedAutoConstant("WorldViewProj", GpuProgramParameters::ACT_WORLDVIEWPROJ_MATRIX);	
+	//bind fragment program parameters
+	GpuProgramParameters* Fparams = newpass->getFragmentProgramParameters().getPointer();
+	int prmxres = clusters->pathMapResolution * clusters->count;
+	int prmyres = clusters->pathMapResolution;
+	while(prmxres > 4096)
+	{
+		prmxres /= 2;
+		prmyres *= 2;		
+	}
+	int prmnt[2] = {prmxres / clusters->pathMapResolution, prmyres / clusters->pathMapResolution};
+
+	float halfPixel[2] = {0.5 / prmxres, 0.5 / prmyres};
+	Fparams->setNamedConstant("prmAtlasTiles",prmnt,2);
+    Fparams->setNamedConstant("atlasHalfPixel", halfPixel, 2);
+			
+	TextureUnitState* st = newpass->createTextureUnitState();		
+	st->setTextureFiltering(TFO_BILINEAR);
+	st->setTextureAddressingMode(TextureUnitState::TAM_BORDER);
+	st->setTextureBorderColour(ColourValue::Blue);
+	st->setTextureName(clusters->pathMapTextureFilename);
+
+	//newpass->setSceneBlending(SBT_MODULATE);
+	newpass->setSceneBlending(SBF_ONE, SBF_ZERO);
+
+	newpass->setDepthBias(1);
+}
+
+OgrePathMapRenderTechnique::~OgrePathMapRenderTechnique()
+{
+
+}
+
+void OgrePathMapRenderTechnique::update(unsigned long frameNum)
+{	
+	//TODO set weights
+}
+
+OgrePathMapRenderTechniqueFactory::OgrePathMapRenderTechniqueFactory()
+{
+	typeName = "PathMap";
+}
+
+OgreRenderTechnique* OgrePathMapRenderTechniqueFactory::createInstance( 
+										IllumTechniqueParams* params,
+										Pass* pass,
+										OgreRenderable* parentRenderable,
+										OgreTechniqueGroup* parentTechniqueGroup)
+{	
+	parseParams(params);
+
+	OgrePathMapRenderTechnique* result = new OgrePathMapRenderTechnique(
+												pass,
+												parentRenderable,
+												parentTechniqueGroup);	
+
+	return result;
+}
+
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/OgreIlluminationManager.cpp
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/OgreIlluminationManager.cpp	(revision 2180)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/OgreIlluminationManager.cpp	(revision 2185)
@@ -113,4 +113,6 @@
 	OgreIllumVolumeRenderTechniqueFactory* illumVolume = new OgreIllumVolumeRenderTechniqueFactory();
 		addRenderTechniqueFactory(illumVolume);
+	OgrePathMapRenderTechniqueFactory* pathmap = new OgrePathMapRenderTechniqueFactory();
+        addRenderTechniqueFactory(pathmap);
 }
 
