Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/OgreIlluminationManager.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/OgreIlluminationManager.h	(revision 1628)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/OgreIlluminationManager.h	(revision 1639)
@@ -73,4 +73,5 @@
 	bool useVSM;
 	bool blurSM;
+	bool focusingSM;
 	unsigned int phaseTextureSize;
 	std::map<RenderingRunType,float> maxRads;
@@ -308,7 +309,9 @@
 	bool getUseLISPSM(){return useLISPSM;}
 	bool getUseVSM(){return useVSM;}
+	bool getFocusingShadowMap(){return focusingSM;}
 	bool getBlurShadowMap(){return blurSM;}
 	void setUseLISPSM(bool use){useLISPSM = use;}
 	void setUseVSM(bool use){useVSM = use;}
+	void setFocusingSM(bool use){focusingSM = use;}
 	void setBlurShadowMap(bool use){blurSM = use;}
 };
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreDepthShadowMapRenderingRun.cpp
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreDepthShadowMapRenderingRun.cpp	(revision 1628)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreDepthShadowMapRenderingRun.cpp	(revision 1639)
@@ -119,4 +119,5 @@
 	{
 		bool uselispsm = OgreIlluminationManager::getSingleton().getUseLISPSM();
+		bool usefocusing = OgreIlluminationManager::getSingleton().getFocusingShadowMap();
 		if(light->getType() == Light::LT_DIRECTIONAL)
 		{
@@ -317,31 +318,37 @@
 			}
 			
-
-			Matrix4 lightMatrix = depthMapCamera->getViewMatrix();
-			frun->setLightMatrix(lightMatrix);
-			
-			OgreIlluminationManager::getSingleton().updateGlobalRun( ILLUMRUN_FOCUSING_MAP,
-																		frameNum);
-
-			frun->getMinMax(min, max);			
-			
-			if(min.z < 0)
-			{
-				float farP= -1.5 * min.z;
-				if(farP < 0.2) farP = 0.2;
-				depthMapCamera->setFarClipDistance(farP);
-
-				Vector3 scale = (max - min);
-				scale *= 1.5; // just for safety
-				
-				Matrix4 projection = Matrix4::IDENTITY;
-				Matrix4 trans = Matrix4::IDENTITY;
-				trans.setTrans(Vector3(-(max.x + min.x) / 2.0,
-								   -(max.y + min.y) / 2.0,
-								     0));
-				Matrix4 scaleM = Matrix4::IDENTITY;
-				scaleM.setScale(Vector3(2.0 / scale.x, 2.0 / scale.y, 1));
-				projection = scaleM * trans;			
-				depthMapCamera->setCustomProjectionMatrix(true, projection * depthMapCamera->getProjectionMatrix());				               
+			if(!usefocusing)
+			{
+				depthMapCamera->setFarClipDistance(light->getAttenuationRange() );
+			}
+			else
+			{
+				Matrix4 lightMatrix = depthMapCamera->getViewMatrix();
+				frun->setLightMatrix(lightMatrix);
+				
+				OgreIlluminationManager::getSingleton().updateGlobalRun( ILLUMRUN_FOCUSING_MAP,
+																			frameNum);
+
+				frun->getMinMax(min, max);			
+				
+				if(min.z < 0)
+				{
+					float farP= -1.5 * min.z;
+					if(farP < 0.2) farP = 0.2;
+					depthMapCamera->setFarClipDistance(farP);
+
+					Vector3 scale = (max - min);
+					scale *= 1.5; // just for safety
+					
+					Matrix4 projection = Matrix4::IDENTITY;
+					Matrix4 trans = Matrix4::IDENTITY;
+					trans.setTrans(Vector3(-(max.x + min.x) / 2.0,
+									-(max.y + min.y) / 2.0,
+										0));
+					Matrix4 scaleM = Matrix4::IDENTITY;
+					scaleM.setScale(Vector3(2.0 / scale.x, 2.0 / scale.y, 1));
+					projection = scaleM * trans;			
+					depthMapCamera->setCustomProjectionMatrix(true, projection * depthMapCamera->getProjectionMatrix());				               
+				}
 			}
 		}
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/OgreIlluminationManager.cpp
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/OgreIlluminationManager.cpp	(revision 1628)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/OgreIlluminationManager.cpp	(revision 1639)
@@ -85,4 +85,5 @@
 	useVSM = false;
 	blurSM = false;
+	focusingSM = true;
 	
 	for(int i = 0; i < RUN_TYPE_COUNT; i++)
