Index: /GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgrePathMapRenderTechnique.h
===================================================================
--- /GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgrePathMapRenderTechnique.h	(revision 2240)
+++ /GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgrePathMapRenderTechnique.h	(revision 2299)
@@ -25,9 +25,14 @@
 		@brief Constructor.
 
+		@param passBlendingSRC			source blend factor of the new pass
+		@param passBlendingDEST			destination blend factor of the new pass
 		@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,
+	OgrePathMapRenderTechnique(
+							SceneBlendFactor passBlendingSRC,
+							SceneBlendFactor passBlendingDEST,
+							Pass* pass,
 							OgreRenderable* parentRenderable,
 							OgreTechniqueGroup* parentTechniqueGroup
@@ -58,4 +63,12 @@
 	*/
 	void createWeightIndexTexture();
+	/**
+		@brief source blend factor of the new pass
+	*/
+	SceneBlendFactor passBlendingSRC;
+	/**
+		@brief destination blend factor of the new pass
+	*/
+	SceneBlendFactor passBlendingDEST;
 };
 
@@ -73,4 +86,7 @@
 										OgreRenderable* parentRenderable,
 										OgreTechniqueGroup* parentTechniqueGroup);
+
+	SceneBlendFactor passBlendingSRC;
+	SceneBlendFactor passBlendingDEST;
 };
 
Index: /GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreCausticCasterRenderTechnique.h
===================================================================
--- /GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreCausticCasterRenderTechnique.h	(revision 2285)
+++ /GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreCausticCasterRenderTechnique.h	(revision 2299)
@@ -94,5 +94,5 @@
 	*/
 	bool blurCauCubeMap;
-	
+		
 	//inherited
 	void photonMapRunChanged(RenderingRun* run);
@@ -137,4 +137,4 @@
 	bool useDistance;
 	bool useTriangles;
-	bool blurCauCubeMap;
+	bool blurCauCubeMap;	
 };
Index: /GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreDepthShadowReceiverRenderTechnique.h
===================================================================
--- /GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreDepthShadowReceiverRenderTechnique.h	(revision 2285)
+++ /GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreDepthShadowReceiverRenderTechnique.h	(revision 2299)
@@ -47,4 +47,6 @@
 		@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 passBlendingSRC				source blend factor of the new passes
+		@param passBlendingDEST				destination blend factor of the new passes
 		@param pass						the pass after which shadowing passes should be added
 		@param parentRenderable			the object to operate on
@@ -63,4 +65,6 @@
 							String lightViewParamName,
 							String lightFarPlaneParamName,
+							SceneBlendFactor passBlendingSRC,
+							SceneBlendFactor passBlendingDEST,
 							Pass* pass,
 							OgreRenderable* parentRenderable,
@@ -128,5 +132,12 @@
 	*/
 	String WorldParamName;
-												
+	/**
+		@brief source blend factor of the new passes
+	*/
+	SceneBlendFactor passBlendingSRC;
+	/**
+		@brief destination blend factor of the new passes
+	*/
+	SceneBlendFactor passBlendingDEST;											
 };
 
@@ -157,4 +168,6 @@
 	String WorldViewProjParamName;
 	String WorldParamName;
+	SceneBlendFactor passBlendingSRC;
+	SceneBlendFactor passBlendingDEST;
 };
 
Index: /GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreCausticReceiverRenderTechnique.h
===================================================================
--- /GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreCausticReceiverRenderTechnique.h	(revision 2285)
+++ /GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreCausticReceiverRenderTechnique.h	(revision 2299)
@@ -38,4 +38,6 @@
 		@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 passBlendingSRC				source blend factor of the new passes
+		@param passBlendingDEST				destination blend factor of the new passes
 		@param pass						the pass after which caustic gathering passes should be added
 		@param parentRenderable			the object to operate on
@@ -46,4 +48,6 @@
 							String causticVertexProgram,
 							String causticFragmentProgram,
+							SceneBlendFactor passBlendingSRC,
+							SceneBlendFactor passBlendingDEST,
 							Pass* pass,
 							OgreRenderable* parentRenderable,
@@ -81,5 +85,12 @@
 	*/
 	std::vector<OgreSharedRuns*> causticCasters;
-	
+	/**
+		@brief source blend factor of the new passes
+	*/
+	SceneBlendFactor passBlendingSRC;
+	/**
+		@brief destination blend factor of the new passes
+	*/
+	SceneBlendFactor passBlendingDEST;
 };
 
@@ -102,5 +113,6 @@
 	String causticVertexProgram;
 	String causticFragmentProgram;
-
+	SceneBlendFactor passBlendingSRC;
+	SceneBlendFactor passBlendingDEST;
 };
 
Index: /GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreDepthShadowReceiverRenderTechnique.cpp
===================================================================
--- /GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreDepthShadowReceiverRenderTechnique.cpp	(revision 2297)
+++ /GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreDepthShadowReceiverRenderTechnique.cpp	(revision 2299)
@@ -16,4 +16,6 @@
 												String lightViewParamName,
 												String lightFarPlaneParamName,
+												SceneBlendFactor passBlendingSRC,
+												SceneBlendFactor passBlendingDEST,
 												Pass* pass,
 												OgreRenderable* parentRenderable,
@@ -23,4 +25,6 @@
 							DepthShadowReceiverRenderTechnique(parentRenderable, parentTechniqueGroup)
 {
+	this->passBlendingSRC = passBlendingSRC;
+	this->passBlendingDEST = passBlendingDEST;
 	this->maxlights = maxlights;
 	this->shadowVertexProgram = shadowVertexProgram ;
@@ -70,7 +74,6 @@
 		st->setTextureBorderColour(ColourValue::White);
 
-		newpass->setSceneBlending(SBT_MODULATE);
-		//newpass->setSceneBlending(SBF_ONE, SBF_ZERO);
-
+		newpass->setSceneBlending(passBlendingSRC, passBlendingDEST);
+		
 		newpass->setDepthBias(1);
 		techn->movePass(lastpass, index);			
@@ -219,4 +222,67 @@
 		f->lightFarPlaneParamName =  params;
 	}
+
+	SceneBlendFactor convertBlendFactor(const String& param)
+    {
+        if (param == "one")
+            return SBF_ONE;
+        else if (param == "zero")
+            return SBF_ZERO;
+        else if (param == "dest_colour")
+            return SBF_DEST_COLOUR;
+        else if (param == "src_colour")
+            return SBF_SOURCE_COLOUR;
+        else if (param == "one_minus_dest_colour")
+            return SBF_ONE_MINUS_DEST_COLOUR;
+        else if (param == "one_minus_src_colour")
+            return SBF_ONE_MINUS_SOURCE_COLOUR;
+        else if (param == "dest_alpha")
+            return SBF_DEST_ALPHA;
+        else if (param == "src_alpha")
+            return SBF_SOURCE_ALPHA;
+        else if (param == "one_minus_dest_alpha")
+            return SBF_ONE_MINUS_DEST_ALPHA;
+        else if (param == "one_minus_src_alpha")
+            return SBF_ONE_MINUS_SOURCE_ALPHA;       
+    }
+
+	void parsePassBlending(String& params, RenderTechniqueFactory* factory)
+	{
+		OgreDepthShadowReceiverRenderTechniqueFactory* f = (OgreDepthShadowReceiverRenderTechniqueFactory*) factory;
+		StringVector vecparams = StringUtil::split(params, " \t");
+		if(vecparams.size() == 1)
+		{
+			if (vecparams[0] == "none")
+			{
+                f->passBlendingSRC =  SBF_ONE;
+				f->passBlendingDEST = SBF_ZERO;
+			}
+			if (vecparams[0] == "add")
+			{
+                f->passBlendingSRC =  SBF_ONE;
+				f->passBlendingDEST = SBF_ONE;
+			}
+            else if (vecparams[0] == "modulate")
+            {
+				f->passBlendingSRC =  SBF_DEST_COLOUR;
+				f->passBlendingDEST = SBF_ZERO;
+			}
+			else if (vecparams[0] == "colour_blend")
+			{
+				f->passBlendingSRC =  SBF_SOURCE_COLOUR;
+				f->passBlendingDEST = SBF_ONE_MINUS_SOURCE_COLOUR;
+			}
+            else if (vecparams[0] == "alpha_blend")
+            {
+                f->passBlendingSRC =  SBF_SOURCE_ALPHA;
+				f->passBlendingDEST = SBF_ONE_MINUS_SOURCE_ALPHA;
+			}            
+		}
+		else if (vecparams.size() == 2)
+		{
+		  f->passBlendingSRC =  convertBlendFactor(vecparams[0]);
+		  f->passBlendingDEST = convertBlendFactor(vecparams[1]) ;
+		}		
+	}	
 }
 
@@ -238,4 +304,5 @@
 	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));
+	this->attributeParsers.insert(AttribParserList::value_type("pass_blending", (ILLUM_ATTRIBUTE_PARSER) parsePassBlending));
 }
 
@@ -258,4 +325,6 @@
 	WorldViewProjParamName = "WorldViewProj";
 	WorldParamName = "World";
+	passBlendingSRC = SBF_DEST_COLOUR;
+	passBlendingDEST = SBF_ZERO;
 
 	parseParams(params);
@@ -273,4 +342,6 @@
 												lightViewParamName,
 												lightFarPlaneParamName,
+												passBlendingSRC,
+												passBlendingDEST,
 												pass,
 												parentRenderable,
Index: /GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreCausticReceiverRenderTechnique.cpp
===================================================================
--- /GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreCausticReceiverRenderTechnique.cpp	(revision 2285)
+++ /GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreCausticReceiverRenderTechnique.cpp	(revision 2299)
@@ -9,4 +9,6 @@
 												String causticVertexProgram,
 												String causticFragmentProgram,
+												SceneBlendFactor passBlendingSRC,
+												SceneBlendFactor passBlendingDEST,
 												Pass* pass,
 												OgreRenderable* parentRenderable,
@@ -16,4 +18,6 @@
 							CausticReceiverRenderTechnique(parentRenderable, parentTechniqueGroup)
 {
+	this->passBlendingSRC = passBlendingSRC;
+	this->passBlendingDEST = passBlendingDEST;
 	this->maxcasters = maxcasters;
 	this->causticVertexProgram = causticVertexProgram;
@@ -57,8 +61,6 @@
 		st2->setTextureFiltering(TFO_BILINEAR);
 
-		newpass->setSceneBlending(SBF_DEST_COLOUR, SBF_ONE);
-		//newpass->setSceneBlending(SBF_ONE, SBF_ZERO);
-		newpass->setDepthBias(1);
-		//newpass->setSceneBlending(SBT_ADD);
+		newpass->setSceneBlending(passBlendingSRC, passBlendingDEST);
+		newpass->setDepthBias(1);		
 		
 		techn->movePass(lastpass, index);			
@@ -138,4 +140,66 @@
 	}
 	
+	SceneBlendFactor convertBlendFactor(const String& param)
+    {
+        if (param == "one")
+            return SBF_ONE;
+        else if (param == "zero")
+            return SBF_ZERO;
+        else if (param == "dest_colour")
+            return SBF_DEST_COLOUR;
+        else if (param == "src_colour")
+            return SBF_SOURCE_COLOUR;
+        else if (param == "one_minus_dest_colour")
+            return SBF_ONE_MINUS_DEST_COLOUR;
+        else if (param == "one_minus_src_colour")
+            return SBF_ONE_MINUS_SOURCE_COLOUR;
+        else if (param == "dest_alpha")
+            return SBF_DEST_ALPHA;
+        else if (param == "src_alpha")
+            return SBF_SOURCE_ALPHA;
+        else if (param == "one_minus_dest_alpha")
+            return SBF_ONE_MINUS_DEST_ALPHA;
+        else if (param == "one_minus_src_alpha")
+            return SBF_ONE_MINUS_SOURCE_ALPHA;       
+    }
+
+	void parsePassBlending(String& params, RenderTechniqueFactory* factory)
+	{
+		OgreCausticReceiverRenderTechniqueFactory* f = (OgreCausticReceiverRenderTechniqueFactory*) factory;
+		StringVector vecparams = StringUtil::split(params, " \t");
+		if(vecparams.size() == 1)
+		{
+			if (vecparams[0] == "none")
+			{
+                f->passBlendingSRC =  SBF_ONE;
+				f->passBlendingDEST = SBF_ZERO;
+			}
+			if (vecparams[0] == "add")
+			{
+                f->passBlendingSRC =  SBF_ONE;
+				f->passBlendingDEST = SBF_ONE;
+			}
+            else if (vecparams[0] == "modulate")
+            {
+				f->passBlendingSRC =  SBF_DEST_COLOUR;
+				f->passBlendingDEST = SBF_ZERO;
+			}
+			else if (vecparams[0] == "colour_blend")
+			{
+				f->passBlendingSRC =  SBF_SOURCE_COLOUR;
+				f->passBlendingDEST = SBF_ONE_MINUS_SOURCE_COLOUR;
+			}
+            else if (vecparams[0] == "alpha_blend")
+            {
+                f->passBlendingSRC =  SBF_SOURCE_ALPHA;
+				f->passBlendingDEST = SBF_ONE_MINUS_SOURCE_ALPHA;
+			}            
+		}
+		else if (vecparams.size() == 2)
+		{
+		  f->passBlendingSRC =  convertBlendFactor(vecparams[0]);
+		  f->passBlendingDEST = convertBlendFactor(vecparams[1]) ;
+		}		
+	}	
 }
 OgreCausticReceiverRenderTechniqueFactory::OgreCausticReceiverRenderTechniqueFactory()
@@ -148,4 +212,5 @@
 	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("pass_blending", (ILLUM_ATTRIBUTE_PARSER) parsePassBlending));
 	
 }
@@ -161,4 +226,6 @@
 	causticVertexProgram = "GTP/Basic/Shaded_VS";
 	causticFragmentProgram = "GTP/Caustic/GatherCaustic_Cube_PS";
+	passBlendingSRC = SBF_DEST_COLOUR;
+	passBlendingDEST = SBF_ONE;
 
 	parseParams(params);
@@ -168,4 +235,6 @@
 												causticVertexProgram,
 												causticFragmentProgram,
+												passBlendingSRC,
+												passBlendingDEST,
 												pass,
 												parentRenderable,
Index: /GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgrePathMapRenderTechnique.cpp
===================================================================
--- /GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgrePathMapRenderTechnique.cpp	(revision 2249)
+++ /GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgrePathMapRenderTechnique.cpp	(revision 2299)
@@ -7,4 +7,6 @@
 
 OgrePathMapRenderTechnique::OgrePathMapRenderTechnique(											
+												SceneBlendFactor passBlendingSRC,
+												SceneBlendFactor passBlendingDEST,
 												Pass* pass,
 												OgreRenderable* parentRenderable,
@@ -13,4 +15,7 @@
 							OgreRenderTechnique(pass, parentRenderable, parentTechniqueGroup)
 {	
+	this->passBlendingSRC = passBlendingSRC;
+	this->passBlendingDEST = passBlendingDEST;
+
 	this->clusters = OgreIlluminationManager::getSingleton().getPathMapClusters(parentRenderable->getName());
 	
@@ -81,11 +86,6 @@
 	st->setTextureName(pass->getTextureUnitState(0)->getTextureName());
 	
-	//newpass->setSceneBlending(SBT_MODULATE);
-	newpass->setSceneBlending(SBT_ADD);
-	//newpass->setSceneBlending(SBF_ONE, SBF_ZERO);
+	newpass->setSceneBlending(passBlendingSRC, passBlendingDEST);
 	newpass->setDepthBias(1);
-	
-
-	
 }
 
@@ -158,7 +158,75 @@
 }
 
+namespace PathMapParsers
+{
+	SceneBlendFactor convertBlendFactor(const String& param)
+    {
+        if (param == "one")
+            return SBF_ONE;
+        else if (param == "zero")
+            return SBF_ZERO;
+        else if (param == "dest_colour")
+            return SBF_DEST_COLOUR;
+        else if (param == "src_colour")
+            return SBF_SOURCE_COLOUR;
+        else if (param == "one_minus_dest_colour")
+            return SBF_ONE_MINUS_DEST_COLOUR;
+        else if (param == "one_minus_src_colour")
+            return SBF_ONE_MINUS_SOURCE_COLOUR;
+        else if (param == "dest_alpha")
+            return SBF_DEST_ALPHA;
+        else if (param == "src_alpha")
+            return SBF_SOURCE_ALPHA;
+        else if (param == "one_minus_dest_alpha")
+            return SBF_ONE_MINUS_DEST_ALPHA;
+        else if (param == "one_minus_src_alpha")
+            return SBF_ONE_MINUS_SOURCE_ALPHA;       
+    }
+
+	void parsePassBlending(String& params, RenderTechniqueFactory* factory)
+	{
+		OgrePathMapRenderTechniqueFactory* f = (OgrePathMapRenderTechniqueFactory*) factory;
+		StringVector vecparams = StringUtil::split(params, " \t");
+		if(vecparams.size() == 1)
+		{
+			if (vecparams[0] == "none")
+			{
+                f->passBlendingSRC =  SBF_ONE;
+				f->passBlendingDEST = SBF_ZERO;
+			}
+			if (vecparams[0] == "add")
+			{
+                f->passBlendingSRC =  SBF_ONE;
+				f->passBlendingDEST = SBF_ONE;
+			}
+            else if (vecparams[0] == "modulate")
+            {
+				f->passBlendingSRC =  SBF_DEST_COLOUR;
+				f->passBlendingDEST = SBF_ZERO;
+			}
+			else if (vecparams[0] == "colour_blend")
+			{
+				f->passBlendingSRC =  SBF_SOURCE_COLOUR;
+				f->passBlendingDEST = SBF_ONE_MINUS_SOURCE_COLOUR;
+			}
+            else if (vecparams[0] == "alpha_blend")
+            {
+                f->passBlendingSRC =  SBF_SOURCE_ALPHA;
+				f->passBlendingDEST = SBF_ONE_MINUS_SOURCE_ALPHA;
+			}            
+		}
+		else if (vecparams.size() == 2)
+		{
+		  f->passBlendingSRC =  convertBlendFactor(vecparams[0]);
+		  f->passBlendingDEST = convertBlendFactor(vecparams[1]) ;
+		}		
+	}	
+}
+
 OgrePathMapRenderTechniqueFactory::OgrePathMapRenderTechniqueFactory()
 {
 	typeName = "PathMap";
+	using namespace PathMapParsers;
+	this->attributeParsers.insert(AttribParserList::value_type("pass_blending", (ILLUM_ATTRIBUTE_PARSER) parsePassBlending));
 }
 
@@ -169,7 +237,12 @@
 										OgreTechniqueGroup* parentTechniqueGroup)
 {	
+	passBlendingSRC = SBF_ONE;
+	passBlendingDEST = SBF_ONE;
+
 	parseParams(params);
 
 	OgrePathMapRenderTechnique* result = new OgrePathMapRenderTechnique(
+												passBlendingSRC,
+												passBlendingDEST,
 												pass,
 												parentRenderable,
