Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/OgreIlluminationManager.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/OgreIlluminationManager.h	(revision 1670)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/OgreIlluminationManager.h	(revision 1711)
@@ -4,5 +4,5 @@
 #include "OgreTechniqueGroup.h"
 #include "OgreRenderable.h"
-#include "OgreCubeMapRenderTechnique.h"
+#include "OgreColorCubeMapRenderTechnique.h"
 #include "OgreDistanceCubeMapRenderTechnique.h"
 #include "OgreConvolvedCubeMapRenderTechnique.h"
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreDistanceCubeMapRenderTechnique.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreDistanceCubeMapRenderTechnique.h	(revision 836)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreDistanceCubeMapRenderTechnique.h	(revision 1711)
@@ -9,5 +9,5 @@
 
 #include "DistanceCubeMapRenderTechnique.h"
-#include "OgreRenderTechnique.h"
+#include "OgreCubeMapRenderTechnique.h"
 #include "Ogre.h"
 
@@ -18,5 +18,5 @@
 */
 class OgreDistanceCubeMapRenderTechnique :	public DistanceCubeMapRenderTechnique,
-									public OgreRenderTechnique
+											public OgreCubeMapRenderTechnique
 {
 public:
@@ -47,4 +47,5 @@
 							float angleTolerance,
 							bool updateAllFace,
+							bool renderSelf,
 							Pass* pass,
 							OgreRenderable* parentRenderable,
@@ -60,9 +61,5 @@
 	
 protected:	
-	/**
-		@brief the id of the texture unit state the resulting cubemap should be bound to
-	*/
-	unsigned char texID;
-	
+
 	//inherited
 	void distanceCubeMapRunChanged(RenderingRun* run);
@@ -76,5 +73,5 @@
 
 
-class OgreDistanceCubeMapRenderTechniqueFactory : public RenderTechniqueFactory
+class OgreDistanceCubeMapRenderTechniqueFactory : public OgreCubeMapRenderTechniqueFactory
 {
 public:
@@ -85,16 +82,5 @@
 										Pass* pass,
 										OgreRenderable* parentRenderable,
-										OgreTechniqueGroup* parentTechniqueGroup);
-
-
-	unsigned long startFrame;
-	unsigned long cubeMapUpdateInterval;
-	unsigned int cubeMapResolution;												
-	unsigned char texID;
-	bool useDistCalc;
-	bool useFaceAngleCalc;
-	float distTolerance;
-	float angleTolerance;
-	bool updateAllFace;
+										OgreTechniqueGroup* parentTechniqueGroup);	
 
 };
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreColorCubeMapRenderTechnique.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreColorCubeMapRenderTechnique.h	(revision 1711)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreColorCubeMapRenderTechnique.h	(revision 1711)
@@ -0,0 +1,82 @@
+#pragma once
+
+//disable inheritance warning caused by multiple inheritance
+#if _WIN32
+#if _MSC_VER
+#pragma warning(disable: 4250)
+#endif
+#endif
+
+#include "ColorCubeMapRenderTechnique.h"
+#include "OgreCubeMapRenderTechnique.h"
+#include "Ogre.h"
+
+using namespace Ogre;
+
+/**
+	@brief CubeMapRenderTechnique used in an Ogre environment.
+*/
+class OgreColorCubeMapRenderTechnique :	public ColorCubeMapRenderTechnique,
+										public OgreCubeMapRenderTechnique
+{
+public:
+
+	/**
+		@brief Constructor.
+
+		@param startFrame				adds an offset to the current frame number to help evenly distribute updates between frames
+		@param cubeMapUpdateInterval	update frequency
+		@param cubeMapResolution		color cubemap resolution
+		@param texID					the id of the texture unit state the resulting cubemap should be bound to
+		@param useDistCalc				flag to skip cube face update if object is far away
+		@param useFaceAngleCalc			flag to skip cube face update if face is neglible
+		@param distTolerance			distance tolerance used in face skip
+		@param angleTolerance			angle tolerance used in face skip
+		@param updateAllFace			defines if all cubemap faces should be updated in a frame or only one face per frame
+		@param pass						the pass to operate on			
+		@param parentRenderable			the object to operate on
+		@param parentTechniqueGroup		the TechniqueGroup this RenderedTechnique is attached to
+	*/
+	OgreColorCubeMapRenderTechnique( unsigned long startFrame,
+									unsigned long cubeMapUpdateInterval,
+									unsigned int cubeMapResolution,												
+									unsigned char texID,
+									bool useDistCalc,
+									bool useFaceAngleCalc,
+									float distTolerance,
+									float angleTolerance,
+									bool updateAllFace,
+									bool renderSelf,
+									Pass* pass,
+									OgreRenderable* parentRenderable,
+									OgreTechniqueGroup* parentTechniqueGroup
+									);
+	/**
+		@brief Destructor.
+	*/
+	~OgreColorCubeMapRenderTechnique();
+	
+	//inherited
+	void update(unsigned long frameNum);
+	
+protected:		
+	
+	//inherited
+	void colorCubeMapRunChanged(RenderingRun* run);
+	//inherited
+	RenderingRun* createColorCubeMapRun();
+
+	
+};
+
+class OgreColorCubeMapRenderTechniqueFactory : public OgreCubeMapRenderTechniqueFactory
+{
+public:
+	
+	OgreColorCubeMapRenderTechniqueFactory();
+
+	OgreRenderTechnique* createInstance(IllumTechniqueParams* params,
+										Pass* pass,
+										OgreRenderable* parentRenderable,
+										OgreTechniqueGroup* parentTechniqueGroup);
+};
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreConvolvedCubeMapRenderTechnique.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreConvolvedCubeMapRenderTechnique.h	(revision 836)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreConvolvedCubeMapRenderTechnique.h	(revision 1711)
@@ -9,5 +9,5 @@
 
 #include "ConvolvedCubeMapRenderTechnique.h"
-#include "OgreRenderTechnique.h"
+#include "OgreCubeMapRenderTechnique.h"
 #include "Ogre.h"
 
@@ -18,5 +18,5 @@
 */
 class OgreConvolvedCubeMapRenderTechnique :	public ConvolvedCubeMapRenderTechnique,
-									public OgreRenderTechnique
+											public OgreCubeMapRenderTechnique
 {
 public:
@@ -43,5 +43,5 @@
 							unsigned int cubeMapResolution,
 							unsigned int reducedCubeMapResolution,
-							unsigned char reducedTexID,
+							unsigned char texID,
 							bool useDistCalc,
 							bool useFaceAngleCalc,
@@ -49,4 +49,5 @@
 							float angleTolerance,
 							bool updateAllFace,
+							bool renderSelf,
 							Pass* pass,
 							OgreRenderable* parentRenderable,
@@ -62,8 +63,4 @@
 	
 protected:	
-	/**
-		@brief the id of the texture unit state the resulting cubemap should be bound to
-	*/
-	unsigned char reducedTexID;
 	
 	//inherited
@@ -80,5 +77,5 @@
 
 
-class OgreConvoledCubeMapRenderTechniqueFactory : public RenderTechniqueFactory
+class OgreConvoledCubeMapRenderTechniqueFactory : public OgreCubeMapRenderTechniqueFactory
 {
 public:
@@ -92,14 +89,4 @@
 
 
-	unsigned long startFrame;
-	unsigned long cubeMapUpdateInterval;
-	unsigned int cubeMapResolution;												
 	unsigned int reducedCubeMapResolution;
-	unsigned char texID;
-	bool useDistCalc;
-	bool useFaceAngleCalc;
-	float distTolerance;
-	float angleTolerance;
-	bool updateAllFace;
-
 };
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreCubeMapRenderTechnique.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreCubeMapRenderTechnique.h	(revision 836)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreCubeMapRenderTechnique.h	(revision 1711)
@@ -17,5 +17,5 @@
 	@brief CubeMapRenderTechnique used in an Ogre environment.
 */
-class OgreCubeMapRenderTechnique :	public CubeMapRenderTechnique,
+class OgreCubeMapRenderTechnique :	virtual public CubeMapRenderTechnique,
 									public OgreRenderTechnique
 {
@@ -47,4 +47,5 @@
 							float angleTolerance,
 							bool updateAllFace,
+							bool renderSelf,
 							Pass* pass,
 							OgreRenderable* parentRenderable,
@@ -55,8 +56,5 @@
 	*/
 	~OgreCubeMapRenderTechnique();
-	
-	//inherited
-	void update(unsigned long frameNum);
-	
+		
 protected:
 		
@@ -64,26 +62,13 @@
 		@brief the id of the texture unit state the resulting cubemap should be bound to
 	*/
-	unsigned char texID;
-	
-	//inherited
-	void colorCubeMapRunChanged(RenderingRun* run);
-	//inherited
-	RenderingRun* createColorCubeMapRun();
-
-	
+	unsigned char texID;	
 };
 
-class OgreColorCubeMapRenderTechniqueFactory : public RenderTechniqueFactory
+class OgreCubeMapRenderTechniqueFactory : public RenderTechniqueFactory
 {
 public:
 	
-	OgreColorCubeMapRenderTechniqueFactory();
-
-	OgreRenderTechnique* createInstance(IllumTechniqueParams* params,
-										Pass* pass,
-										OgreRenderable* parentRenderable,
-										OgreTechniqueGroup* parentTechniqueGroup);
-
-
+	OgreCubeMapRenderTechniqueFactory();
+	
 	unsigned long startFrame;
 	unsigned long cubeMapUpdateInterval;
@@ -95,4 +80,7 @@
 	float angleTolerance;
 	bool updateAllFace;
+	bool renderSelf;
+
+	void resetParams();
 
 };
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/scripts/OgreIllumModule.vcproj
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/scripts/OgreIllumModule.vcproj	(revision 1681)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/scripts/OgreIllumModule.vcproj	(revision 1711)
@@ -42,5 +42,5 @@
 				Optimization="0"
 				AdditionalIncludeDirectories="&quot;$(OGRE_PATH)\Samples\Common\include&quot;;&quot;$(OGRE_PATH)\OgreMain\include&quot;;..\include;..\include\RenderingRuns;..\include\RenderTechniques;..\..\IllumModule\include;..\..\IllumModule\include\RenderingRuns;..\..\IllumModule\include\RenderTechniques;&quot;$(OGRE_PATH)\PlugIns\OctreeSceneManager\include\&quot;"
-				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;GAMETOOLS_ILLUMINATION_MODULE;GTP_VISIBILITY_MODIFIED_OGRE"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;GAMETOOLS_ILLUMINATION_MODULE"
 				MinimalRebuild="true"
 				BasicRuntimeChecks="3"
@@ -115,5 +115,5 @@
 				OmitFramePointers="true"
 				AdditionalIncludeDirectories="&quot;$(OGRE_PATH)\Samples\Common\include&quot;;&quot;$(OGRE_PATH)\OgreMain\include&quot;;..\include;..\include\RenderingRuns;..\include\RenderTechniques;..\..\IllumModule\include;..\..\IllumModule\include\RenderingRuns;..\..\IllumModule\include\RenderTechniques;&quot;$(OGRE_PATH)\PlugIns\OctreeSceneManager\include\&quot;"
-				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;GAMETOOLS_ILLUMINATION_MODULE;GTP_VISIBILITY_MODIFIED_OGRE"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;GAMETOOLS_ILLUMINATION_MODULE"
 				StringPooling="true"
 				MinimalRebuild="true"
@@ -201,4 +201,8 @@
 				</File>
 				<File
+					RelativePath="..\src\RenderTechniques\OgreColorCubeMapRenderTechnique.cpp"
+					>
+				</File>
+				<File
 					RelativePath="..\src\RenderTechniques\OgreConvolvedCubeMapRenderTechnique.cpp"
 					>
@@ -327,4 +331,8 @@
 				</File>
 				<File
+					RelativePath="..\include\RenderTechniques\OgreColorCubeMapRenderTechnique.h"
+					>
+				</File>
+				<File
 					RelativePath="..\include\RenderTechniques\OgreConvolvedCubeMapRenderTechnique.h"
 					>
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreColorCubeMapRenderTechnique.cpp
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreColorCubeMapRenderTechnique.cpp	(revision 1711)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreColorCubeMapRenderTechnique.cpp	(revision 1711)
@@ -0,0 +1,104 @@
+#include "OgreColorCubeMapRenderTechnique.h"
+#include "OgreTechniqueGroup.h"
+#include "OgreColorCubeMapRenderingRun.h"
+
+OgreColorCubeMapRenderTechnique::OgreColorCubeMapRenderTechnique(unsigned long startFrame,
+														unsigned long cubeMapUpdateInterval,
+														unsigned int cubeMapResolution,												
+														unsigned char texID,
+														bool useDistCalc,
+														bool useFaceAngleCalc,
+														float distTolerance,
+														float angleTolerance,
+														bool updateAllFace,
+														bool renderSelf,
+														Pass* pass,
+														OgreRenderable* parentRenderable,
+														OgreTechniqueGroup* parentTechniqueGroup)
+							:OgreCubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, texID, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, renderSelf, pass, parentRenderable, parentTechniqueGroup),
+							ColorCubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, renderSelf, parentRenderable, parentTechniqueGroup),
+							CubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, renderSelf, parentRenderable, parentTechniqueGroup),
+							RenderTechnique(parentRenderable, parentTechniqueGroup) 
+{	
+	
+	if(sharedRuns->getRun(ILLUMRUN_COLOR_CUBEMAP) == 0)
+		sharedRuns->addRun(ILLUMRUN_COLOR_CUBEMAP, createColorCubeMapRun());
+	
+	colorCubeMapRunChanged(sharedRuns->getRun(ILLUMRUN_COLOR_CUBEMAP));
+}
+
+
+OgreColorCubeMapRenderTechnique::~OgreColorCubeMapRenderTechnique()
+{
+
+}
+
+void OgreColorCubeMapRenderTechnique::update(unsigned long frameNum)
+{
+	ColorCubeMapRenderTechnique::update(frameNum);
+	/*
+	GpuProgramParametersSharedPtr fpParams = pass->getFragmentProgramParameters();
+	Vector3 center = ((OgreSharedRuns*) sharedRuns)->getRootPosition();
+	fpParams->setNamedConstant("lastCenter",center); 
+	pass->setFragmentProgramParameters(fpParams); */
+	
+}
+
+void OgreColorCubeMapRenderTechnique::colorCubeMapRunChanged(RenderingRun* run)
+{
+	OgreColorCubeMapRenderingRun* cuberun =(OgreColorCubeMapRenderingRun*) (run->asOgreRenderingRun());
+	String cubemapname = cuberun->getColorCubeMapTextureName();
+	
+	pass->getTextureUnitState(texID)->setTextureName(cubemapname);
+}
+
+RenderingRun* OgreColorCubeMapRenderTechnique::createColorCubeMapRun()
+{
+	return new OgreColorCubeMapRenderingRun( (OgreSharedRuns*) parentTechniqueGroup->getSharedRuns(), 
+												parentOgreRenderable->getName()  + "_COLORCUBEMAP",
+												startFrame,
+												cubeMapUpdateInterval,
+												cubeMapResolution,
+												useDistCalc,
+												useFaceAngleCalc,
+												distTolerance,
+												angleTolerance,
+												updateAllFace);
+}
+
+
+///Technique factory
+OgreColorCubeMapRenderTechniqueFactory::OgreColorCubeMapRenderTechniqueFactory()
+{
+	typeName = "ColorCubeMap";	
+}
+
+OgreRenderTechnique* OgreColorCubeMapRenderTechniqueFactory::createInstance( 
+										IllumTechniqueParams* params,
+										Pass* pass,
+										OgreRenderable* parentRenderable,
+										OgreTechniqueGroup* parentTechniqueGroup)
+{	
+	
+	OgreCubeMapRenderTechniqueFactory::resetParams();
+	OgreCubeMapRenderTechniqueFactory::parseParams(params);	
+	parseParams(params);
+	
+	OgreColorCubeMapRenderTechnique* result = new OgreColorCubeMapRenderTechnique(
+													startFrame,
+													cubeMapUpdateInterval,
+													cubeMapResolution,
+													texID,
+													useDistCalc,
+													useFaceAngleCalc,
+													distTolerance,
+													angleTolerance,
+													updateAllFace,
+													renderSelf,
+													pass,
+													parentRenderable,
+													parentTechniqueGroup);
+	
+	return result;
+}
+
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreConvolvedCubeMapRenderTechnique.cpp
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreConvolvedCubeMapRenderTechnique.cpp	(revision 874)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreConvolvedCubeMapRenderTechnique.cpp	(revision 1711)
@@ -8,5 +8,5 @@
 														unsigned int cubeMapResolution,
 														unsigned int reducedCubeMapResolution,
-														unsigned char reducedTexID,
+														unsigned char texID,
 														bool useDistCalc,
 														bool useFaceAngleCalc,
@@ -14,13 +14,14 @@
 														float angleTolerance,
 														bool updateAllFace,
+														bool renderSelf,
 														Pass* pass,
 														OgreRenderable* parentRenderable,
 														OgreTechniqueGroup* parentTechniqueGroup)
-							:OgreRenderTechnique( pass, parentRenderable, parentTechniqueGroup),
-							ConvolvedCubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, reducedCubeMapResolution, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, parentRenderable, parentTechniqueGroup),
+							:
+							OgreCubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, texID, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, renderSelf, pass, parentRenderable, parentTechniqueGroup),
+							CubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, renderSelf, parentRenderable, parentTechniqueGroup),
+							ConvolvedCubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, reducedCubeMapResolution, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, renderSelf, parentRenderable, parentTechniqueGroup),
 							RenderTechnique(parentRenderable, parentTechniqueGroup) 
 {	
-	this->reducedTexID = reducedTexID;
-		
 	if(sharedRuns->getRun(ILLUMRUN_COLOR_CUBEMAP) == 0)
 		sharedRuns->addRun(ILLUMRUN_COLOR_CUBEMAP, createColorCubeMapRun());
@@ -49,5 +50,5 @@
 	String cubemapname = cuberun->getReducedCubeMapTextureName();
 	
-	pass->getTextureUnitState(reducedTexID)->setTextureName(cubemapname);
+	pass->getTextureUnitState(texID)->setTextureName(cubemapname);
 }
 
@@ -94,80 +95,9 @@
 namespace ConvolvedCubemapParsers
 {
-	void parseStartFrame(String& params, RenderTechniqueFactory* factory)
-	{
-		OgreConvoledCubeMapRenderTechniqueFactory* f = (OgreConvoledCubeMapRenderTechniqueFactory*) factory;
-		f->startFrame =  StringConverter::parseUnsignedLong(params);
-	}
-	void parseCubeMapUpdateInterval(String& params, RenderTechniqueFactory* factory)
-	{
-		OgreConvoledCubeMapRenderTechniqueFactory* f = (OgreConvoledCubeMapRenderTechniqueFactory*) factory;
-		f->cubeMapUpdateInterval =  StringConverter::parseUnsignedLong(params);
-	}
-
-	void parseCubeMapResolution(String& params, RenderTechniqueFactory* factory)
-	{
-		OgreConvoledCubeMapRenderTechniqueFactory* f = (OgreConvoledCubeMapRenderTechniqueFactory*) factory;
-		f->cubeMapResolution =  StringConverter::parseUnsignedInt(params);
-	}
-
 	void parseReducedCubeMapResolution(String& params, RenderTechniqueFactory* factory)
 	{
 		OgreConvoledCubeMapRenderTechniqueFactory* f = (OgreConvoledCubeMapRenderTechniqueFactory*) factory;
 		f->reducedCubeMapResolution =  StringConverter::parseUnsignedInt(params);
-	}
-
-	void parseTexID(String& params, RenderTechniqueFactory* factory)
-	{
-		OgreConvoledCubeMapRenderTechniqueFactory* f = (OgreConvoledCubeMapRenderTechniqueFactory*) factory;
-		f->texID =  StringConverter::parseUnsignedInt(params);
-	}
-
-	void parseUseDistCalc(String& params, RenderTechniqueFactory* factory)
-	{
-		OgreConvoledCubeMapRenderTechniqueFactory* f = (OgreConvoledCubeMapRenderTechniqueFactory*) factory;
-		// format: on/off tolerance(float)
-		StringVector vecparams = StringUtil::split(params, " \t");
-
-		if(StringConverter::parseBool(vecparams[0]))//on
-		{
-			f->useDistCalc = true;
-
-			if(vecparams.size()>1)
-			{			
-				f->distTolerance = StringConverter::parseReal(vecparams[1]);
-			}
-		}
-		else
-		{
-			f->useDistCalc = false;
-		}
-	}
-
-	void parseUseFaceAngleCalc(String& params, RenderTechniqueFactory* factory)
-	{
-		OgreConvoledCubeMapRenderTechniqueFactory* f = (OgreConvoledCubeMapRenderTechniqueFactory*) factory;
-		// format: on/off tolerance(float)
-		StringVector vecparams = StringUtil::split(params, " \t");
-
-		if(StringConverter::parseBool(vecparams[0]))//on
-		{
-			f->useFaceAngleCalc = true;
-
-			if(vecparams.size()>1)
-			{			
-				f->angleTolerance = StringConverter::parseReal(vecparams[1]);
-			}
-		}
-		else
-		{
-			f->useFaceAngleCalc = false;
-		}
-	}
-
-	void parseUpdateAllFace(String& params, RenderTechniqueFactory* factory)
-	{
-		OgreConvoledCubeMapRenderTechniqueFactory* f = (OgreConvoledCubeMapRenderTechniqueFactory*) factory;
-		f->updateAllFace =  StringConverter::parseBool(params);
-	}
+	}	
 }
 ///Technique factory
@@ -177,14 +107,5 @@
 
 	using namespace ConvolvedCubemapParsers;
-	//register parsers
-	this->attributeParsers.insert(AttribParserList::value_type("start_frame", (ILLUM_ATTRIBUTE_PARSER) parseStartFrame));
-	this->attributeParsers.insert(AttribParserList::value_type("update_interval", (ILLUM_ATTRIBUTE_PARSER) parseCubeMapUpdateInterval));
-	this->attributeParsers.insert(AttribParserList::value_type("resolution", (ILLUM_ATTRIBUTE_PARSER) parseCubeMapResolution));
-	this->attributeParsers.insert(AttribParserList::value_type("reduced_resolution", (ILLUM_ATTRIBUTE_PARSER) parseReducedCubeMapResolution));
-	this->attributeParsers.insert(AttribParserList::value_type("texture_unit_id", (ILLUM_ATTRIBUTE_PARSER) parseTexID));
-	this->attributeParsers.insert(AttribParserList::value_type("distance_calc", (ILLUM_ATTRIBUTE_PARSER) parseUseDistCalc));
-	this->attributeParsers.insert(AttribParserList::value_type("face_angle_calc", (ILLUM_ATTRIBUTE_PARSER) parseUseFaceAngleCalc));
-	this->attributeParsers.insert(AttribParserList::value_type("update_all_face", (ILLUM_ATTRIBUTE_PARSER) parseUpdateAllFace));
-
+	this->attributeParsers.insert(AttribParserList::value_type("reduced_resolution", (ILLUM_ATTRIBUTE_PARSER) parseReducedCubeMapResolution));	
 }
 
@@ -195,16 +116,8 @@
 										OgreTechniqueGroup* parentTechniqueGroup)
 {	
-	//reset parameters
-	startFrame = 1;
-	cubeMapUpdateInterval = 1;
-	cubeMapResolution = 256;
 	reducedCubeMapResolution = 8;	
-	texID = 0;
-	useDistCalc = 1;
-	useFaceAngleCalc = false;
-	distTolerance = 2.0;
-	angleTolerance = 2.0;
-	updateAllFace = false;
 
+	OgreCubeMapRenderTechniqueFactory::resetParams();
+	OgreCubeMapRenderTechniqueFactory::parseParams(params);	
 	parseParams(params);
 
@@ -220,4 +133,5 @@
 												angleTolerance,
 												updateAllFace,
+												renderSelf,
 												pass,
 												parentRenderable,
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreCubeMapRenderTechnique.cpp
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreCubeMapRenderTechnique.cpp	(revision 874)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreCubeMapRenderTechnique.cpp	(revision 1711)
@@ -12,17 +12,13 @@
 														float angleTolerance,
 														bool updateAllFace,
+														bool renderSelf,
 														Pass* pass,
 														OgreRenderable* parentRenderable,
 														OgreTechniqueGroup* parentTechniqueGroup)
 							:OgreRenderTechnique( pass, parentRenderable, parentTechniqueGroup),
-							CubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, parentRenderable, parentTechniqueGroup),
+							CubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, renderSelf, parentRenderable, parentTechniqueGroup),
 							RenderTechnique(parentRenderable, parentTechniqueGroup) 
 {	
-	this->texID = texID;
-	
-	if(sharedRuns->getRun(ILLUMRUN_COLOR_CUBEMAP) == 0)
-		sharedRuns->addRun(ILLUMRUN_COLOR_CUBEMAP, createColorCubeMapRun());
-	
-	colorCubeMapRunChanged(sharedRuns->getRun(ILLUMRUN_COLOR_CUBEMAP));
+	this->texID = texID;	
 }
 
@@ -33,48 +29,15 @@
 }
 
-void OgreCubeMapRenderTechnique::update(unsigned long frameNum)
-{
-	CubeMapRenderTechnique::update(frameNum);
-	/*
-	GpuProgramParametersSharedPtr fpParams = pass->getFragmentProgramParameters();
-	Vector3 center = ((OgreSharedRuns*) sharedRuns)->getRootPosition();
-	fpParams->setNamedConstant("lastCenter",center); 
-	pass->setFragmentProgramParameters(fpParams); */
-	
-}
-
-void OgreCubeMapRenderTechnique::colorCubeMapRunChanged(RenderingRun* run)
-{
-	OgreColorCubeMapRenderingRun* cuberun =(OgreColorCubeMapRenderingRun*) (run->asOgreRenderingRun());
-	String cubemapname = cuberun->getColorCubeMapTextureName();
-	
-	pass->getTextureUnitState(texID)->setTextureName(cubemapname);
-}
-
-RenderingRun* OgreCubeMapRenderTechnique::createColorCubeMapRun()
-{
-	return new OgreColorCubeMapRenderingRun( (OgreSharedRuns*) parentTechniqueGroup->getSharedRuns(), 
-												parentOgreRenderable->getName()  + "_COLORCUBEMAP",
-												startFrame,
-												cubeMapUpdateInterval,
-												cubeMapResolution,
-												useDistCalc,
-												useFaceAngleCalc,
-												distTolerance,
-												angleTolerance,
-												updateAllFace);
-}
-
 ///Technique Parsers
-namespace ColorCubemapParsers
+namespace CubemapParsers
 {
 	void parseStartFrame(String& params, RenderTechniqueFactory* factory)
 	{
-		OgreColorCubeMapRenderTechniqueFactory* f = (OgreColorCubeMapRenderTechniqueFactory*) factory;
+		OgreCubeMapRenderTechniqueFactory* f = (OgreCubeMapRenderTechniqueFactory*) factory;
 		f->startFrame =  StringConverter::parseUnsignedLong(params);
 	}
 	void parseCubeMapUpdateInterval(String& params, RenderTechniqueFactory* factory)
 	{
-		OgreColorCubeMapRenderTechniqueFactory* f = (OgreColorCubeMapRenderTechniqueFactory*) factory;
+		OgreCubeMapRenderTechniqueFactory* f = (OgreCubeMapRenderTechniqueFactory*) factory;
 		f->cubeMapUpdateInterval =  StringConverter::parseUnsignedLong(params);
 	}
@@ -82,5 +45,5 @@
 	void parseCubeMapResolution(String& params, RenderTechniqueFactory* factory)
 	{
-		OgreColorCubeMapRenderTechniqueFactory* f = (OgreColorCubeMapRenderTechniqueFactory*) factory;
+		OgreCubeMapRenderTechniqueFactory* f = (OgreCubeMapRenderTechniqueFactory*) factory;
 		f->cubeMapResolution =  StringConverter::parseUnsignedInt(params);
 	}
@@ -88,5 +51,5 @@
 	void parseTexID(String& params, RenderTechniqueFactory* factory)
 	{
-		OgreColorCubeMapRenderTechniqueFactory* f = (OgreColorCubeMapRenderTechniqueFactory*) factory;
+		OgreCubeMapRenderTechniqueFactory* f = (OgreCubeMapRenderTechniqueFactory*) factory;
 		f->texID =  StringConverter::parseUnsignedInt(params);
 	}
@@ -94,5 +57,5 @@
 	void parseUseDistCalc(String& params, RenderTechniqueFactory* factory)
 	{
-		OgreColorCubeMapRenderTechniqueFactory* f = (OgreColorCubeMapRenderTechniqueFactory*) factory;
+		OgreCubeMapRenderTechniqueFactory* f = (OgreCubeMapRenderTechniqueFactory*) factory;
 		// format: on/off tolerance(float)
 		StringVector vecparams = StringUtil::split(params, " \t");
@@ -115,5 +78,5 @@
 	void parseUseFaceAngleCalc(String& params, RenderTechniqueFactory* factory)
 	{
-		OgreColorCubeMapRenderTechniqueFactory* f = (OgreColorCubeMapRenderTechniqueFactory*) factory;
+		OgreCubeMapRenderTechniqueFactory* f = (OgreCubeMapRenderTechniqueFactory*) factory;
 		// format: on/off tolerance(float)
 		StringVector vecparams = StringUtil::split(params, " \t");
@@ -136,14 +99,19 @@
 	void parseUpdateAllFace(String& params, RenderTechniqueFactory* factory)
 	{
-		OgreColorCubeMapRenderTechniqueFactory* f = (OgreColorCubeMapRenderTechniqueFactory*) factory;
+		OgreCubeMapRenderTechniqueFactory* f = (OgreCubeMapRenderTechniqueFactory*) factory;
 		f->updateAllFace =  StringConverter::parseBool(params);
+	}
+
+	void parseRenderSelf(String& params, RenderTechniqueFactory* factory)
+	{
+		OgreCubeMapRenderTechniqueFactory* f = (OgreCubeMapRenderTechniqueFactory*) factory;
+		f->renderSelf =  StringConverter::parseBool(params);
 	}
 }
 ///Technique factory
-OgreColorCubeMapRenderTechniqueFactory::OgreColorCubeMapRenderTechniqueFactory()
+OgreCubeMapRenderTechniqueFactory::OgreCubeMapRenderTechniqueFactory()
 {
-	typeName = "ColorCubeMap";
-
-	using namespace ColorCubemapParsers;
+	
+	using namespace CubemapParsers;
 
 	//register parsers
@@ -155,14 +123,10 @@
 	this->attributeParsers.insert(AttribParserList::value_type("face_angle_calc", (ILLUM_ATTRIBUTE_PARSER) parseUseFaceAngleCalc));
 	this->attributeParsers.insert(AttribParserList::value_type("update_all_face", (ILLUM_ATTRIBUTE_PARSER) parseUpdateAllFace));
+	this->attributeParsers.insert(AttribParserList::value_type("render_self", (ILLUM_ATTRIBUTE_PARSER) parseUpdateAllFace));
 
 }
 
-OgreRenderTechnique* OgreColorCubeMapRenderTechniqueFactory::createInstance( 
-										IllumTechniqueParams* params,
-										Pass* pass,
-										OgreRenderable* parentRenderable,
-										OgreTechniqueGroup* parentTechniqueGroup)
-{	
-	//reset parameters
+void OgreCubeMapRenderTechniqueFactory::resetParams()
+{
 	startFrame = 1;
 	cubeMapUpdateInterval = 1;
@@ -174,22 +138,4 @@
 	angleTolerance = 2.0;
 	updateAllFace = false;
-
-	parseParams(params);
-
-	OgreCubeMapRenderTechnique* result = new OgreCubeMapRenderTechnique(
-												startFrame,
-												cubeMapUpdateInterval,
-												cubeMapResolution,
-												texID,
-												useDistCalc,
-												useFaceAngleCalc,
-												distTolerance,
-												angleTolerance,
-												updateAllFace,
-												pass,
-												parentRenderable,
-												parentTechniqueGroup);
-	
-	return result;
+	renderSelf = false;
 }
-
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreDistanceCubeMapRenderTechnique.cpp
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreDistanceCubeMapRenderTechnique.cpp	(revision 874)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreDistanceCubeMapRenderTechnique.cpp	(revision 1711)
@@ -12,13 +12,14 @@
 														float angleTolerance,
 														bool updateAllFace,
+														bool renderSelf,
 														Pass* pass,
 														OgreRenderable* parentRenderable,
 														OgreTechniqueGroup* parentTechniqueGroup)
-							:OgreRenderTechnique( pass, parentRenderable, parentTechniqueGroup),
-							DistanceCubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, parentRenderable, parentTechniqueGroup),
+							:
+							OgreCubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, texID, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, renderSelf, pass, parentRenderable, parentTechniqueGroup),
+							CubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, renderSelf, parentRenderable, parentTechniqueGroup),
+							DistanceCubeMapRenderTechnique(startFrame, cubeMapUpdateInterval, cubeMapResolution, useDistCalc, useFaceAngleCalc, distTolerance, angleTolerance, updateAllFace, renderSelf, parentRenderable, parentTechniqueGroup),
 							RenderTechnique(parentRenderable, parentTechniqueGroup) 
 {	
-	this->texID = texID;
-	
 	if(sharedRuns->getRun(ILLUMRUN_DISTANCE_CUBEMAP) == 0)
 		sharedRuns->addRun(ILLUMRUN_DISTANCE_CUBEMAP, createDistanceCubeMapRun());
@@ -67,94 +68,8 @@
 }
 
-
-///Technique Parsers
-namespace CausticCubemapParsers
-{
-	void parseStartFrame(String& params, RenderTechniqueFactory* factory)
-	{
-		OgreDistanceCubeMapRenderTechniqueFactory* f = (OgreDistanceCubeMapRenderTechniqueFactory*) factory;
-		f->startFrame =  StringConverter::parseUnsignedLong(params);
-	}
-	void parseCubeMapUpdateInterval(String& params, RenderTechniqueFactory* factory)
-	{
-		OgreDistanceCubeMapRenderTechniqueFactory* f = (OgreDistanceCubeMapRenderTechniqueFactory*) factory;
-		f->cubeMapUpdateInterval =  StringConverter::parseUnsignedLong(params);
-	}
-
-	void parseCubeMapResolution(String& params, RenderTechniqueFactory* factory)
-	{
-		OgreDistanceCubeMapRenderTechniqueFactory* f = (OgreDistanceCubeMapRenderTechniqueFactory*) factory;
-		f->cubeMapResolution =  StringConverter::parseUnsignedInt(params);
-	}
-
-	void parseTexID(String& params, RenderTechniqueFactory* factory)
-	{
-		OgreDistanceCubeMapRenderTechniqueFactory* f = (OgreDistanceCubeMapRenderTechniqueFactory*) factory;
-		f->texID =  StringConverter::parseUnsignedInt(params);
-	}
-
-	void parseUseDistCalc(String& params, RenderTechniqueFactory* factory)
-	{
-		OgreDistanceCubeMapRenderTechniqueFactory* f = (OgreDistanceCubeMapRenderTechniqueFactory*) factory;
-		// format: on/off tolerance(float)
-		StringVector vecparams = StringUtil::split(params, " \t");
-
-		if(StringConverter::parseBool(vecparams[0]))//on
-		{
-			f->useDistCalc = true;
-
-			if(vecparams.size()>1)
-			{			
-				f->distTolerance = StringConverter::parseReal(vecparams[1]);
-			}
-		}
-		else
-		{
-			f->useDistCalc = false;
-		}
-	}
-
-	void parseUseFaceAngleCalc(String& params, RenderTechniqueFactory* factory)
-	{
-		OgreDistanceCubeMapRenderTechniqueFactory* f = (OgreDistanceCubeMapRenderTechniqueFactory*) factory;
-		// format: on/off tolerance(float)
-		StringVector vecparams = StringUtil::split(params, " \t");
-
-		if(StringConverter::parseBool(vecparams[0]))//on
-		{
-			f->useFaceAngleCalc = true;
-
-			if(vecparams.size()>1)
-			{			
-				f->angleTolerance = StringConverter::parseReal(vecparams[1]);
-			}
-		}
-		else
-		{
-			f->useFaceAngleCalc = false;
-		}
-	}
-
-	void parseUpdateAllFace(String& params, RenderTechniqueFactory* factory)
-	{
-		OgreDistanceCubeMapRenderTechniqueFactory* f = (OgreDistanceCubeMapRenderTechniqueFactory*) factory;
-		f->updateAllFace =  StringConverter::parseBool(params);
-	}
-}
 ///Technique factory
 OgreDistanceCubeMapRenderTechniqueFactory::OgreDistanceCubeMapRenderTechniqueFactory()
 {
-	typeName = "DistanceCubeMap";
-
-	using namespace CausticCubemapParsers;
-	//register parsers
-	this->attributeParsers.insert(AttribParserList::value_type("start_frame", (ILLUM_ATTRIBUTE_PARSER) parseStartFrame));
-	this->attributeParsers.insert(AttribParserList::value_type("update_interval", (ILLUM_ATTRIBUTE_PARSER) parseCubeMapUpdateInterval));
-	this->attributeParsers.insert(AttribParserList::value_type("resolution", (ILLUM_ATTRIBUTE_PARSER) parseCubeMapResolution));
-	this->attributeParsers.insert(AttribParserList::value_type("texture_unit_id", (ILLUM_ATTRIBUTE_PARSER) parseTexID));
-	this->attributeParsers.insert(AttribParserList::value_type("distance_calc", (ILLUM_ATTRIBUTE_PARSER) parseUseDistCalc));
-	this->attributeParsers.insert(AttribParserList::value_type("face_angle_calc", (ILLUM_ATTRIBUTE_PARSER) parseUseFaceAngleCalc));
-	this->attributeParsers.insert(AttribParserList::value_type("update_all_face", (ILLUM_ATTRIBUTE_PARSER) parseUpdateAllFace));
-
+	typeName = "DistanceCubeMap";	
 }
 
@@ -165,17 +80,9 @@
 										OgreTechniqueGroup* parentTechniqueGroup)
 {	
-	//reset parameters
-	startFrame = 1;
-	cubeMapUpdateInterval = 1;
-	cubeMapResolution = 256;												
+	OgreCubeMapRenderTechniqueFactory::resetParams();
 	texID = 1;
-	useDistCalc = 1;
-	useFaceAngleCalc = false;
-	distTolerance = 2.0;
-	angleTolerance = 2.0;
-	updateAllFace = false;
-
+	OgreCubeMapRenderTechniqueFactory::parseParams(params);	
 	parseParams(params);
-
+	
 	OgreDistanceCubeMapRenderTechnique* result = new OgreDistanceCubeMapRenderTechnique(
 												startFrame,
@@ -188,4 +95,5 @@
 												angleTolerance,
 												updateAllFace,
+												renderSelf,
 												pass,
 												parentRenderable,
