Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreDepthShadowRecieverRenderTechnique.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreDepthShadowRecieverRenderTechnique.h	(revision 2240)
+++ 	(revision )
@@ -1,160 +1,0 @@
-#pragma once
-
-//disable inheritance warning caused by multiple inheritance
-#if _WIN32
-#if _MSC_VER
-#pragma warning(disable: 4250)
-#endif
-#endif
-
-#include "OgreRenderTechnique.h"
-#include "DepthShadowRecieverRenderTechnique.h"
-#include "Ogre.h"
-
-using namespace Ogre;
-
-/**
-	@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 OgreDepthShadowRecieverRenderTechnique : public OgreRenderTechnique,
-										public DepthShadowRecieverRenderTechnique
-{
-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 WorldViewProjParamName   the name of the gpu program parameter the world-view-projection matrix should be bound to
-		@param WorldParamName			the name of the gpu program parameter the world matrix should be bound to
-		@param setLightViewMatrix		bound light space view matrix to a gpu program parameter
-		@param setLightViewProjMatrix   bound light space view-projection matrix to a gpu program parameter
-		@param setLightProjFarPlane		bound light space projection far plane to a gpu program parameter
-		@param lightViewProjParamName   the name of the gpu program parameter the light space view-projection matrix should be bound to
-		@param lightViewParamName       the name of the gpu program parameter the light space view matrix should be bound to
-		@param lightFarPlaneParamName	the name of the gpu program parameter the light space projection far plane should be bound to
-		@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
-	*/
-	OgreDepthShadowRecieverRenderTechnique(
-							int maxlights,
-							String shadowVertexProgram,
-							String shadowFragmentProgram,
-							String WorldViewProjParamName,
-							String WorldParamName,
-							bool setLightViewMatrix,
-							bool setLightViewProjMatrix,
-							bool setLightProjFarPlane,
-							String lightViewProjParamName,
-							String lightViewParamName,
-							String lightFarPlaneParamName,
-							Pass* pass,
-							OgreRenderable* parentRenderable,
-							OgreTechniqueGroup* parentTechniqueGroup
-							);
-	/**
-		@brief Destructor.
-	*/
-	~OgreDepthShadowRecieverRenderTechnique();
-	
-	//inherited
-	virtual void update(unsigned long frameNum);
-	
-protected:	
-	/**
-		@brief	the maximum number of light sources to recieve shadow from
-
-		During update the nearest light sources will be found and used.
-	*/
-	int maxlights;
-	/**
-		@brief the vertex program to be used in the shadowing passes
-	*/
-	String shadowVertexProgram;
-	/**
-		@brief 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. 
-	*/
-	String shadowFragmentProgram;
-	/**
-		@breif new passes created by this technique
-	*/
-	std::vector<Pass*> passes;
-	/**
-		@brief bound light space view matrix to a gpu program parameter
-	*/
-	bool setLightViewMatrix;
-	/**
-		@brief bound light space view-projection matrix to a gpu program parameter
-	*/
-	bool setLightViewProjMatrix;
-	/**
-		@brief bound light space projection far plane to a gpu program parameter
-	*/
-	bool setLightProjFarPlane;
-	/**
-		@brief the name of the gpu program parameter the light space view-projection matrix should be bound to
-	*/
-	String lightViewProjParamName;
-	/**
-		@brief the name of the gpu program parameter the light space view matrix should be bound to
-	*/
-	String lightViewParamName;
-	/**
-		@brief the name of the gpu program parameter the light space projection far plane should be bound to
-	*/
-	String lightFarPlaneParamName;
-	/**
-		@brief the name of the gpu program parameter the world-view-projection matrix should be bound to
-	*/	
-	String WorldViewProjParamName;
-	/**
-		@brief the name of the gpu program parameter the world matrix should be bound to
-	*/
-	String WorldParamName;
-												
-};
-
-/**
-	@brief RenderTechniqueFactory to create OgreDepthShadowRecieverRenderTechnique instances.
-*/
-class OgreDepthShadowRecieverRenderTechniqueFactory : public RenderTechniqueFactory
-{
-public:
-	
-	OgreDepthShadowRecieverRenderTechniqueFactory();
-
-	OgreRenderTechnique* createInstance(IllumTechniqueParams* params,
-										Pass* pass,
-										OgreRenderable* parentRenderable,
-										OgreTechniqueGroup* parentTechniqueGroup);
-
-
-	int maxlights;
-	String shadowVertexProgram;
-	String shadowFragmentProgram;
-	bool setLightViewMatrix;
-	bool setLightViewProjMatrix;
-	bool setLightProjFarPlane;
-	String lightViewProjParamName;
-	String lightViewParamName;
-	String lightFarPlaneParamName;
-	String WorldViewProjParamName;
-	String WorldParamName;
-};
-
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreCausticRecieverRenderTechnique.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreCausticRecieverRenderTechnique.h	(revision 2240)
+++ 	(revision )
@@ -1,106 +1,0 @@
-#pragma once
-
-//disable inheritance warning caused by multiple inheritance
-#if _WIN32
-#if _MSC_VER
-#pragma warning(disable: 4250)
-#endif
-#endif
-
-#include "OgreRenderTechnique.h"
-#include "CausticRecieverRenderTechnique.h"
-#include "Ogre.h"
-
-using namespace Ogre;
-
-/**
-	@brief CausticRecieverRenderTechnique used in an OGRE environment.
-
-	This technique defines that the object will recieve caustic lighting from caustic caster objects.
-	The caustic light spots will be calculated by the caustic caster's RenderingRuns.
-	These runs will only be updated if caustic redievers are visible, so it is the reciever technique's
-	responsibility to update them.
-
-	Each caustic caster's light contribution will be added in separate passes. Each pass
-	will add some light to the shaded image, so these passes should be the last passes.
-	In the constructor the given Pass* parameter will be the pass after which the caustic lighting
-	passes will be added by the technique.
-*/
-class OgreCausticRecieverRenderTechnique : public OgreRenderTechnique,
-										public CausticRecieverRenderTechnique
-{
-public:
-	/**
-		@brief Constructor.
-
-		@param maxcasters				the maximum number of caustic casters from which this reciever can recieve caustic light
-		@param causticVertexProgram		the vertex program to be used in the caustic gathering passes
-		@param causticFragmentProgram	the fragment program to be used in the caustic gathering passes.
-										It should have one pass and the caustic cubemap of a caster will be bound to the first sampler unit. 
-		@param pass						the pass after which caustic gathering passes should be added
-		@param parentRenderable			the object to operate on
-		@param parentTechniqueGroup		the TechniqueGroup this RenderedTechnique is attached to
-	*/
-	OgreCausticRecieverRenderTechnique(
-							int maxcasters,
-							String causticVertexProgram,
-							String causticFragmentProgram,
-							Pass* pass,
-							OgreRenderable* parentRenderable,
-							OgreTechniqueGroup* parentTechniqueGroup
-							);
-	/**
-		@brief Destructor.
-	*/
-	~OgreCausticRecieverRenderTechnique();
-	
-	//inherited
-	virtual void update(unsigned long frameNum);
-	
-protected:
-	/**
-		@brief the maximum number of caustic casters from which this reciever can recieve caustic light
-	*/
-	int maxcasters;
-	/**
-		@brief the vertex program to be used in the caustic gathering passes
-	*/
-	String causticVertexProgram;
-	/**
-		@brief the fragment program to be used in the caustic gathering passes
-
-		It should have one pass and the caustic cubemap of a caster will be bound to the first sampler unit. 
-	*/
-	String causticFragmentProgram;
-	/**
-		@breif new passes created by this technique
-	*/
-	std::vector<Pass*> passes;
-	/**
-		@brief the nearest caustic casters found during update
-	*/
-	std::vector<OgreSharedRuns*> causticCasters;
-	
-};
-
-/**
-	@brief RenderTechniqueFactory to create OgreCausticRecieverRenderTechnique instances.
-*/
-class OgreCausticRecieverRenderTechniqueFactory : public RenderTechniqueFactory
-{
-public:
-	
-	OgreCausticRecieverRenderTechniqueFactory();
-
-	OgreRenderTechnique* createInstance(IllumTechniqueParams* params,
-										Pass* pass,
-										OgreRenderable* parentRenderable,
-										OgreTechniqueGroup* parentTechniqueGroup);
-
-
-	int maxcasters;
-	String causticVertexProgram;
-	String causticFragmentProgram;
-
-};
-
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreDepthShadowRecieverRenderTechnique.cpp
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreDepthShadowRecieverRenderTechnique.cpp	(revision 2189)
+++ 	(revision )
@@ -1,281 +1,0 @@
-#include "OgreDepthShadowRecieverRenderTechnique.h"
-#include "OgreTechniqueGroup.h"
-#include "OgreIlluminationManager.h"
-#include "OgreDepthShadowMapRenderingRun.h"
-
-OgreDepthShadowRecieverRenderTechnique::OgreDepthShadowRecieverRenderTechnique(
-												int maxlights,
-												String shadowVertexProgram,
-												String shadowFragmentProgram,
-												String WorldViewProjParamName,
-												String WorldParamName,
-												bool setLightViewMatrix,
-												bool setLightViewProjMatrix,
-												bool setLightProjFarPlane,
-												String lightViewProjParamName,
-												String lightViewParamName,
-												String lightFarPlaneParamName,
-												Pass* pass,
-												OgreRenderable* parentRenderable,
-												OgreTechniqueGroup* parentTechniqueGroup)
-							:RenderTechnique( parentRenderable, parentTechniqueGroup),
-							OgreRenderTechnique(pass, parentRenderable, parentTechniqueGroup),
-							DepthShadowRecieverRenderTechnique(parentRenderable, parentTechniqueGroup)
-{
-	this->maxlights = maxlights;
-	this->shadowVertexProgram = shadowVertexProgram ;
-	this->shadowFragmentProgram = shadowFragmentProgram;
-	this->setLightViewMatrix = setLightViewMatrix;
-	this->setLightViewProjMatrix = setLightViewProjMatrix;
-	this->setLightProjFarPlane = setLightProjFarPlane;
-	this->lightViewProjParamName = lightViewProjParamName;
-	this->lightViewParamName = lightViewParamName;
-	this->lightFarPlaneParamName = lightFarPlaneParamName;
-	this->WorldParamName = WorldParamName;
-	this->WorldViewProjParamName = WorldViewProjParamName;
-		
-	//insert new passes
-	Ogre::Technique* techn = pass->getParent();
-	Technique::PassIterator it = techn->getPassIterator();
-	
-	int index = 0;
-	while(it.hasMoreElements())
-	{
-		if( it.getNext() == pass)
-			break;
-		index++;
-		it.moveNext();
-	}
-	
-	index++;
-	for(int i = 0; i < maxlights; i++)
-	{
-		int lastpass = techn->getNumPasses();
-		Pass* newpass = techn->createPass();
-		passes.push_back(newpass);
-
-		newpass->setVertexProgram(shadowVertexProgram);
-		newpass->setFragmentProgram(shadowFragmentProgram);
-		
-		GpuProgramParameters* Vparams = newpass->getVertexProgramParameters().getPointer();
-		Vparams->setNamedAutoConstant(WorldViewProjParamName,
-									GpuProgramParameters::ACT_WORLDVIEWPROJ_MATRIX);	
-		Vparams->setNamedAutoConstant(WorldParamName,
-									GpuProgramParameters::ACT_WORLD_MATRIX);
-		GpuProgramParameters* Fparams = newpass->getFragmentProgramParameters().getPointer();
-		
-		TextureUnitState* st = newpass->createTextureUnitState();		
-		st->setTextureFiltering(TFO_NONE);
-		st->setTextureAddressingMode(TextureUnitState::TAM_BORDER);
-		st->setTextureBorderColour(ColourValue::White);
-
-		newpass->setSceneBlending(SBT_MODULATE);
-		//newpass->setSceneBlending(SBF_ONE, SBF_ZERO);
-
-		newpass->setDepthBias(1);
-		techn->movePass(lastpass, index);			
-	}
-	
-}
-
-OgreDepthShadowRecieverRenderTechnique::~OgreDepthShadowRecieverRenderTechnique()
-{
-
-}
-
-void OgreDepthShadowRecieverRenderTechnique::update(unsigned long frameNum)
-{
-	LightList lights;
-	Root::getSingleton()._getCurrentSceneManager()->_populateLightList(
-						((OgreSharedRuns*) sharedRuns)->getRootPosition(),
-							100000.0,
-							lights);
-
-	//fill passes
-	unsigned int l = 0;
-	for(unsigned int i = 0; i < passes.size(); i++)
-	{
-		while(lights.size() != l && !lights.at(l)->getCastShadows())
-		 l++;
-
-		if(lights.size() > l)
-		{
-			
-				//create run if not exists
-				OgreIlluminationManager::getSingleton().createPerLightRun(lights.at(l)->getName(),
-																			ILLUMRUN_DEPTH_SHADOWMAP);
-				//update light depth map
-				OgreIlluminationManager::getSingleton().updatePerLightRun(lights.at(l)->getName(),
-																			ILLUMRUN_DEPTH_SHADOWMAP,
-																			frameNum);
-				
-				//set texture to pass
-				OgreDepthShadowMapRenderingRun* depthRun = 
-					(OgreDepthShadowMapRenderingRun*) OgreIlluminationManager::getSingleton()
-														.getPerLightRun(lights.at(l)->getName(), 
-														ILLUMRUN_DEPTH_SHADOWMAP)->asOgreRenderingRun();
-						
-				passes.at(i)->getTextureUnitState(0)->setTextureName(
-					depthRun->getDepthMapTextureName());
-			
-				//TODO: set matrices
-				GpuProgramParametersSharedPtr fpParams = passes.at(i)->getFragmentProgramParameters();
-				GpuProgramParametersSharedPtr vpParams = passes.at(i)->getVertexProgramParameters();
-			
-				//fpParams->setNamedConstant("lightViewProj", depthRun->getLightViewProjMatrix()); 
-				if(setLightViewProjMatrix)
-					vpParams->setNamedConstant(lightViewProjParamName, depthRun->getLightViewProjMatrix());
-				if(setLightViewMatrix)
-					vpParams->setNamedConstant(lightViewParamName, depthRun->getLightViewMatrix());
-				if(setLightProjFarPlane)
-					fpParams->setNamedConstant(lightFarPlaneParamName, depthRun->getLightFarPlane());
-				
-				
-				passes.at(i)->setActive(true);
-			
-		}	
-		else
-			passes.at(i)->setActive(false);
-
-	}
-}
-
-
-///Technique parsers
-namespace DepthShadowRecieverParsers
-{
-	void parseMaxLights(String& params, RenderTechniqueFactory* factory)
-	{
-		OgreDepthShadowRecieverRenderTechniqueFactory* f = (OgreDepthShadowRecieverRenderTechniqueFactory*) factory;
-		f->maxlights =  StringConverter::parseInt(params);
-	}
-
-	void parseVertexProgram(String& params, RenderTechniqueFactory* factory)
-	{
-		OgreDepthShadowRecieverRenderTechniqueFactory* f = (OgreDepthShadowRecieverRenderTechniqueFactory*) factory;
-		f->shadowVertexProgram =  params;
-	}
-
-	void parseFragmentProgram(String& params, RenderTechniqueFactory* factory)
-	{
-		OgreDepthShadowRecieverRenderTechniqueFactory* f = (OgreDepthShadowRecieverRenderTechniqueFactory*) factory;
-		f->shadowFragmentProgram =  params;
-	}
-
-	void parseSetLightViewProj(String& params, RenderTechniqueFactory* factory)
-	{
-		OgreDepthShadowRecieverRenderTechniqueFactory* f = (OgreDepthShadowRecieverRenderTechniqueFactory*) factory;
-		StringVector vecparams = StringUtil::split(params, " \t");
-		f->setLightViewProjMatrix = StringConverter::parseBool(vecparams[0]);
-		if(f->setLightViewProjMatrix && vecparams.size() > 1)
-			f->lightViewProjParamName =  vecparams[1];
-	}
-
-	void parseSetLightView(String& params, RenderTechniqueFactory* factory)
-	{
-		OgreDepthShadowRecieverRenderTechniqueFactory* f = (OgreDepthShadowRecieverRenderTechniqueFactory*) factory;
-		StringVector vecparams = StringUtil::split(params, " \t");
-		f->setLightViewMatrix = StringConverter::parseBool(vecparams[0]);
-		if(f->setLightViewMatrix && vecparams.size() > 1)
-			f->lightViewParamName =  vecparams[1];
-	}
-
-	void parseSetLightFarPlane(String& params, RenderTechniqueFactory* factory)
-	{
-		OgreDepthShadowRecieverRenderTechniqueFactory* f = (OgreDepthShadowRecieverRenderTechniqueFactory*) factory;
-		StringVector vecparams = StringUtil::split(params, " \t");
-		f->setLightProjFarPlane = StringConverter::parseBool(vecparams[0]);
-		if(f->setLightProjFarPlane && vecparams.size() > 1)
-			f->lightFarPlaneParamName =  vecparams[1];
-	}
-
-	void parseLightProjParamName(String& params, RenderTechniqueFactory* factory)
-	{
-		OgreDepthShadowRecieverRenderTechniqueFactory* f = (OgreDepthShadowRecieverRenderTechniqueFactory*) factory;
-		f->lightViewProjParamName =  params;
-	}
-
-	void parseLightViewParamName(String& params, RenderTechniqueFactory* factory)
-	{
-		OgreDepthShadowRecieverRenderTechniqueFactory* f = (OgreDepthShadowRecieverRenderTechniqueFactory*) factory;
-		f->lightViewParamName =  params;
-	}
-
-	void parseWorldViewProjParamName(String& params, RenderTechniqueFactory* factory)
-	{
-		OgreDepthShadowRecieverRenderTechniqueFactory* f = (OgreDepthShadowRecieverRenderTechniqueFactory*) factory;
-		f->WorldViewProjParamName =  params;
-	}
-
-	void parseWorldParamName(String& params, RenderTechniqueFactory* factory)
-	{
-		OgreDepthShadowRecieverRenderTechniqueFactory* f = (OgreDepthShadowRecieverRenderTechniqueFactory*) factory;
-		f->WorldParamName =  params;
-	}
-
-	void parseLightFarPlaneParamName(String& params, RenderTechniqueFactory* factory)
-	{
-		OgreDepthShadowRecieverRenderTechniqueFactory* f = (OgreDepthShadowRecieverRenderTechniqueFactory*) factory;
-		f->lightFarPlaneParamName =  params;
-	}
-}
-
-OgreDepthShadowRecieverRenderTechniqueFactory::OgreDepthShadowRecieverRenderTechniqueFactory()
-{
-	typeName = "DepthShadowReciever";
-
-	using namespace DepthShadowRecieverParsers;
-	//register parsers
-	this->attributeParsers.insert(AttribParserList::value_type("max_light_count", (ILLUM_ATTRIBUTE_PARSER) parseMaxLights));
-	this->attributeParsers.insert(AttribParserList::value_type("vertex_program_name", (ILLUM_ATTRIBUTE_PARSER) parseVertexProgram));
-	this->attributeParsers.insert(AttribParserList::value_type("fragment_program_name", (ILLUM_ATTRIBUTE_PARSER) parseFragmentProgram));
-	this->attributeParsers.insert(AttribParserList::value_type("set_light_viewproj", (ILLUM_ATTRIBUTE_PARSER) parseSetLightViewProj));
-	this->attributeParsers.insert(AttribParserList::value_type("set_light_view", (ILLUM_ATTRIBUTE_PARSER) parseSetLightView));
-	this->attributeParsers.insert(AttribParserList::value_type("set_light_farplane", (ILLUM_ATTRIBUTE_PARSER) parseSetLightFarPlane));
-	this->attributeParsers.insert(AttribParserList::value_type("light_viewproj_param_name", (ILLUM_ATTRIBUTE_PARSER) parseLightProjParamName));
-	this->attributeParsers.insert(AttribParserList::value_type("light_view_param_name", (ILLUM_ATTRIBUTE_PARSER) parseLightViewParamName));
-	this->attributeParsers.insert(AttribParserList::value_type("world_view_proj_param_name", (ILLUM_ATTRIBUTE_PARSER) parseWorldViewProjParamName));
-	this->attributeParsers.insert(AttribParserList::value_type("world_param_name", (ILLUM_ATTRIBUTE_PARSER) parseWorldParamName));
-	this->attributeParsers.insert(AttribParserList::value_type("light_farplane_param_name", (ILLUM_ATTRIBUTE_PARSER) parseLightFarPlaneParamName));
-}
-
-OgreRenderTechnique* OgreDepthShadowRecieverRenderTechniqueFactory::createInstance( 
-										IllumTechniqueParams* params,
-										Pass* pass,
-										OgreRenderable* parentRenderable,
-										OgreTechniqueGroup* parentTechniqueGroup)
-{	
-	//reset parameters
-	maxlights = 1;
-	shadowVertexProgram = "GTP/Basic/LightCPos_VS";
-	shadowFragmentProgram = "GTP/Basic/SM/Dist_PS";
-	setLightViewMatrix = false;
-	setLightViewProjMatrix = true;
-	setLightProjFarPlane = false;
-	lightViewProjParamName = "LightViewProj";
-	lightViewParamName = "LightView";
-	lightFarPlaneParamName = "lightFarPlane";
-	WorldViewProjParamName = "WorldViewProj";
-	WorldParamName = "World";
-
-	parseParams(params);
-
-	OgreDepthShadowRecieverRenderTechnique* result = new OgreDepthShadowRecieverRenderTechnique(
-												maxlights,
-												shadowVertexProgram,
-												shadowFragmentProgram,
-												WorldViewProjParamName,
-												WorldParamName,
-												setLightViewMatrix ,
-												setLightViewProjMatrix,
-												setLightProjFarPlane,
-												lightViewProjParamName,
-												lightViewParamName,
-												lightFarPlaneParamName,
-												pass,
-												parentRenderable,
-												parentTechniqueGroup);	
-
-	return result;
-}
-
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreCausticRecieverRenderTechnique.cpp
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreCausticRecieverRenderTechnique.cpp	(revision 2265)
+++ 	(revision )
@@ -1,175 +1,0 @@
-#include "OgreCausticRecieverRenderTechnique.h"
-#include "OgreTechniqueGroup.h"
-#include "OgreIlluminationManager.h"
-#include "OgreCausticCubeMapRenderingRun.h"
-#include "OgreCubeMapRenderingRun.h"
-
-OgreCausticRecieverRenderTechnique::OgreCausticRecieverRenderTechnique(
-												int maxcasters,
-												String causticVertexProgram,
-												String causticFragmentProgram,
-												Pass* pass,
-												OgreRenderable* parentRenderable,
-												OgreTechniqueGroup* parentTechniqueGroup)
-							:RenderTechnique( parentRenderable, parentTechniqueGroup),
-							OgreRenderTechnique(pass, parentRenderable, parentTechniqueGroup),
-							CausticRecieverRenderTechnique(parentRenderable, parentTechniqueGroup)
-{
-	this->maxcasters = maxcasters;
-	this->causticVertexProgram = causticVertexProgram;
-	this->causticFragmentProgram = causticFragmentProgram;
-	
-	//insert new passes
-	Ogre::Technique* techn = pass->getParent();
-	Technique::PassIterator it = techn->getPassIterator();
-	
-	int index = 0;
-	while(it.hasMoreElements())
-	{
-		if( it.getNext() == pass)
-			break;
-		index++;
-		it.moveNext();
-	}
-	
-	index++;
-	for(int i = 0; i < maxcasters; i++)
-	{
-		int lastpass = techn->getNumPasses();
-		Pass* newpass = techn->createPass();
-		passes.push_back(newpass);
-
-		newpass->setVertexProgram(causticVertexProgram);
-		newpass->setFragmentProgram(causticFragmentProgram);
-		
-		GpuProgramParameters* Vparams = newpass->getVertexProgramParameters().getPointer();
-		Vparams->setNamedAutoConstant("WorldViewProj",
-									GpuProgramParameters::ACT_WORLDVIEWPROJ_MATRIX);
-		Vparams->setNamedAutoConstant("World",
-									GpuProgramParameters::ACT_WORLD_MATRIX);
-		GpuProgramParameters* Fparams = newpass->getFragmentProgramParameters().getPointer();
-		//Fparams->setNamedConstant("cubeMapCameraPosition", Vector3(0,0,0));
-
-		TextureUnitState* st = newpass->createTextureUnitState();
-		TextureUnitState* st2 = newpass->createTextureUnitState();
-
-		st->setTextureFiltering(TFO_BILINEAR);
-		st2->setTextureFiltering(TFO_BILINEAR);
-
-		newpass->setSceneBlending(SBF_DEST_COLOUR, SBF_ONE);
-		//newpass->setSceneBlending(SBF_ONE, SBF_ZERO);
-		newpass->setDepthBias(1);
-		//newpass->setSceneBlending(SBT_ADD);
-		
-		techn->movePass(lastpass, index);			
-	}
-	
-}
-
-OgreCausticRecieverRenderTechnique::~OgreCausticRecieverRenderTechnique()
-{
-
-}
-
-void OgreCausticRecieverRenderTechnique::update(unsigned long frameNum)
-{
-	//find nearest casters
-	causticCasters.clear();
-	OgreIlluminationManager::getSingleton().getNearestCausticCasters(
-				((OgreSharedRuns*)sharedRuns)->getRootPosition(),
-				&causticCasters,
-				maxcasters);
-	//fill passes
-	for(unsigned int i = 0; i < passes.size(); i++)
-	{
-		if(causticCasters.size() > i)
-		{
-			
-			//update caustic caster
-			causticCasters.at(i)->updateRun(ILLUMRUN_PHOTONMAP, frameNum);	
-			causticCasters.at(i)->updateRun(ILLUMRUN_CAUSTIC_CUBEMAP, frameNum);
-
-			//set texture to pass
-			OgreCausticCubeMapRenderingRun* cauCubeRun = 
-				(OgreCausticCubeMapRenderingRun*) causticCasters.at(i)->
-					getRun(ILLUMRUN_CAUSTIC_CUBEMAP)->asOgreRenderingRun();
-			passes.at(i)->getTextureUnitState(0)->setTextureName(
-				cauCubeRun->getCausticCubeMapTextureName());
-
-			OgreCubeMapRenderingRun* distCubeRun = 
-				(OgreCubeMapRenderingRun*) causticCasters.at(i)->
-					getRun(ILLUMRUN_DISTANCE_CUBEMAP)->asOgreRenderingRun();
-			passes.at(i)->getTextureUnitState(1)->setTextureName(
-				distCubeRun->getCubeMapTextureName());
-			
-			//set caster position
-			GpuProgramParameters* Fparams = passes.at(i)->getFragmentProgramParameters().getPointer();
-			Fparams->setNamedConstant("cubeMapCameraPosition",
-				causticCasters.at(i)->getRootPosition(ILLUMRUN_CAUSTIC_CUBEMAP));
-			Fparams->setNamedConstant("attenuation", cauCubeRun->getAttenuation());
-			passes.at(i)->setActive(true);
-		}	
-		else
-			passes.at(i)->setActive(false);
-
-	}
-}
-
-
-namespace CausticRecieverParsers
-{
-	///Technique parsers
-	void parseMaxCasters(String& params, RenderTechniqueFactory* factory)
-	{
-		OgreCausticRecieverRenderTechniqueFactory* f = (OgreCausticRecieverRenderTechniqueFactory*) factory;
-		f->maxcasters =  StringConverter::parseInt(params);
-	}
-
-	void parseVertexProgram(String& params, RenderTechniqueFactory* factory)
-	{
-		OgreCausticRecieverRenderTechniqueFactory* f = (OgreCausticRecieverRenderTechniqueFactory*) factory;
-		f->causticVertexProgram =  params;
-	}
-
-	void parseFragmentProgram(String& params, RenderTechniqueFactory* factory)
-	{
-		OgreCausticRecieverRenderTechniqueFactory* f = (OgreCausticRecieverRenderTechniqueFactory*) factory;
-		f->causticFragmentProgram =  params;
-	}
-	
-}
-OgreCausticRecieverRenderTechniqueFactory::OgreCausticRecieverRenderTechniqueFactory()
-{
-	typeName = "CausticReciever";
-
-	using namespace CausticRecieverParsers;
-	//register parsers
-	this->attributeParsers.insert(AttribParserList::value_type("max_caster_count", (ILLUM_ATTRIBUTE_PARSER) parseMaxCasters));
-	this->attributeParsers.insert(AttribParserList::value_type("vertex_program_name", (ILLUM_ATTRIBUTE_PARSER) parseVertexProgram));
-	this->attributeParsers.insert(AttribParserList::value_type("fragment_program_name", (ILLUM_ATTRIBUTE_PARSER) parseFragmentProgram));
-	
-}
-
-OgreRenderTechnique* OgreCausticRecieverRenderTechniqueFactory::createInstance( 
-										IllumTechniqueParams* params,
-										Pass* pass,
-										OgreRenderable* parentRenderable,
-										OgreTechniqueGroup* parentTechniqueGroup)
-{	
-	//reset parameters
-	maxcasters = 1;
-	causticVertexProgram = "GTP/Basic/Shaded_VS";
-	causticFragmentProgram = "GTP/Caustic/GatherCaustic_Cube_PS";
-
-	parseParams(params);
-
-	OgreCausticRecieverRenderTechnique* result = new OgreCausticRecieverRenderTechnique(
-												maxcasters,
-												causticVertexProgram,
-												causticFragmentProgram,
-												pass,
-												parentRenderable,
-												parentTechniqueGroup);
-
-	return result;
-}
