Index: GTP/trunk/App/Demos/Illum/Ogre/Media/PMDemo/PRMDemo.material
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/Media/PMDemo/PRMDemo.material	(revision 2246)
+++ GTP/trunk/App/Demos/Illum/Ogre/Media/PMDemo/PRMDemo.material	(revision 2266)
@@ -22,21 +22,21 @@
 	IllumTechniques
 	{
-	 //  	RenderTechnique PathMap
-	 //	{
+	   	RenderTechnique PathMap
+	 	{
 	    
-	  //	}
-	//	RenderTechnique DepthShadowReciever
-	//  	{
-	//    	max_light_count 2
-	//		vertex_program_name GTP/Basic/LightCPos_VS
-	//		fragment_program_name GTP/Basic/SM/Dist_VSM_PS
-	//		set_light_view true
-	//		set_light_farplane true
-	//		light_viewproj_param_name LightViewProj
-	//		light_view_param_name LightView
-	//		light_farplane_param_name lightFarPlane
-	//		world_view_proj_param_name WorldViewProj
-	//		world_param_name World
-	 // 	}
+	  	}
+		RenderTechnique DepthShadowReciever
+	  	{
+	    	max_light_count 2
+			vertex_program_name GTP/Basic/LightCPos_VS
+			fragment_program_name GTP/Basic/SM/Dist_VSM_PS
+			set_light_view true
+			set_light_farplane true
+			light_viewproj_param_name LightViewProj
+			light_view_param_name LightView
+			light_farplane_param_name lightFarPlane
+			world_view_proj_param_name WorldViewProj
+			world_param_name World
+	  	}
 	}
 	vertex_program_ref GTP/Basic/ShadedTex_VS
Index: GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPEnvMap/GTPEnvMap.hlsl
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPEnvMap/GTPEnvMap.hlsl	(revision 2175)
+++ GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPEnvMap/GTPEnvMap.hlsl	(revision 2266)
@@ -8,5 +8,5 @@
 float readDistanceCubeMap(samplerCUBE dcm, float3 coord)		
 {
-	float dist = texCUBE(dcm, float3(coord.xy, - coord.z)).r;
+	float dist = texCUBE(dcm, float3(coord.xy, - coord.z)).a;
 	if(dist == 0) dist = 1000; ///sky
 	return dist;
@@ -97,5 +97,5 @@
 	float3 R = reflect( V, N);	
 	float3 T = refract(V, N, sRefraction);
-		
+	
 	RR = R;	TT = T; 
 	RR = Hit(cubePos, R, DistanceMap);
@@ -128,5 +128,7 @@
 	RR = R;	
 	RR = Hit(cubePos, R, DistanceMap);
-	Color = readCubeMap(CubeMap, RR );	
+	Color = readCubeMap(CubeMap, RR);
+	//Color = readDistanceCubeMap(DistanceMap, cubePos)/300.0;
+	//return Color;
 	
 	float ctheta_in = dot(N, R);
Index: GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPEnvMap/GTPEnvMap.material
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPEnvMap/GTPEnvMap.material	(revision 2175)
+++ GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPEnvMap/GTPEnvMap.material	(revision 2266)
@@ -74,5 +74,5 @@
 	     texture_unit
 	     {
-	   
+	   	filtering none
 	     }
 	  }
@@ -122,5 +122,5 @@
 	     texture_unit
 	     {
-	   
+	   	filtering none
 	     }
 	  }
@@ -130,5 +130,5 @@
 material GTP/EnvMap/Localized_Metal
 {
-   technique
+   technique maintechnique
    {   
       pass mainpass
@@ -171,5 +171,5 @@
 	     texture_unit
 	     {
-	   
+	   	filtering none
 	     }
 	  }
@@ -179,5 +179,5 @@
 material GTP/EnvMap/Gold : GTP/EnvMap/Localized_Metal
 {
-   technique
+   technique maintechnique
    {   
       pass mainpass
@@ -193,12 +193,13 @@
 material GTP/EnvMap/Silver : GTP/EnvMap/Localized_Metal
 {
-   technique
-   {   
-      pass mainpass
-      {
-        fragment_program_ref
-        {
-          param_named F0 float3 0.97 0.95 0.9
-        }
+   technique maintechnique
+   {   
+      pass mainpass
+      { 	 
+	 fragment_program_ref GTP/EnvMap/Localized_Metal_PS
+     	 { 
+		
+            param_named F0 float3 0.97 0.95 0.9            
+	 }       
       }
    }
@@ -207,5 +208,5 @@
 material GTP/EnvMap/Copper : GTP/EnvMap/Localized_Metal
 {
-   technique
+   technique maintechnique
    {   
       pass mainpass
@@ -221,5 +222,5 @@
 material GTP/EnvMap/Alu : GTP/EnvMap/Localized_Metal
 {
-   technique
+   technique maintechnique
    {   
       pass mainpass
Index: GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPCaustic/GTPCaustic.material
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPCaustic/GTPCaustic.material	(revision 2175)
+++ GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPCaustic/GTPCaustic.material	(revision 2266)
@@ -20,5 +20,5 @@
    texture_unit
    {
-   
+   	filtering none
    }
   }
@@ -97,10 +97,10 @@
 			RenderTechnique ColorCubeMap
 			{
-				update_interval		1
+				update_interval		0
 				update_all_face true									
 			}
 			RenderTechnique DistanceCubeMap
 			{
-				update_interval		1
+				update_interval		0
 				update_all_face true										
 			}
@@ -141,5 +141,5 @@
 	     texture_unit
 	     {
-	   
+	   	filtering none
 	     }
 	  }
@@ -157,10 +157,10 @@
 			RenderTechnique ColorCubeMap
 			{
-				update_interval		1
+				update_interval		0
 				update_all_face true									
 			}
 			RenderTechnique DistanceCubeMap
 			{
-				update_interval		1
+				update_interval		0
 				update_all_face true										
 			}
@@ -199,5 +199,5 @@
 	     texture_unit
 	     {
-	   
+	   	filtering none
 	     }
 	  }
Index: GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPCaustic/GTPCaustic.hlsl
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPCaustic/GTPCaustic.hlsl	(revision 2136)
+++ GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPCaustic/GTPCaustic.hlsl	(revision 2266)
@@ -258,5 +258,5 @@
 	float  dist = readDistanceCubeMap(DistanceCubeMap, dir);
 	
-	float EPSILON = 1.0;
+	float EPSILON = 0.00001;
 
 	if(mydist > dist + EPSILON) caustic = 0;
@@ -265,5 +265,4 @@
 			
 	Color = caustic;
-	//Color += attenuation * 0.000000000001;
 	Color.a = 1;
 
Index: GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/GameTools.material
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/GameTools.material	(revision 2152)
+++ GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/GameTools.material	(revision 2266)
@@ -140,150 +140,4 @@
 }
 
-
-
-material GameTools/UVShader
-{ 
-   technique 
-   { 
-   	pass 
-      { 
-		vertex_program_ref GameTools/UV_VS
-         {       
-            param_named_auto worldViewProj worldviewproj_matrix
-         } 
-		fragment_program_ref GameTools/UV_PS
-         { 
-			param_named_auto ID custom 0
-         }
-        
-
-       }
-    }
-}
-
-material GameTools/DistanceShader
-{ 
-
-   technique 
-   { 
-   	pass 
-      { 
-	 vertex_program_ref GameTools/DistanceVS
-         {       
-            param_named_auto worldView worldview_matrix
-            param_named_auto worldViewProj worldviewproj_matrix
-         } 
-	 fragment_program_ref  GameTools/DistancePS
-         { 
-		 
-         }
-
-       }
-    }
-}
-
-material GameTools/SceneCameraDepthShader
-{ 
-
-   technique 
-   { 
-      scene_blend none
-
-      pass 
-      { 
-	 vertex_program_ref GameTools/SceneCameraDepthVS
-         {       
-            param_named_auto worldView worldview_matrix
-            param_named_auto worldViewProj worldviewproj_matrix
-	    param_named_auto farplane far_clip_distance	 
-         } 
-	 fragment_program_ref  GameTools/SceneDepthPS
-         { 
-	   
-         }
-
-       }
-    }
-}
-
-material GameTools/FocusingShader
-{ 
-
-   technique 
-   { 
-      scene_blend none
-
-      pass 
-      { 
-	 vertex_program_ref GameTools/FocusingVS
-         {       
-			param_named_auto world		world_matrix
-            param_named_auto worldViewProj worldviewproj_matrix
-			param_named lightTransform matrix4x4	 
-         } 
-	 fragment_program_ref  GameTools/FocusingPS
-         { 
-	   
-         }
-
-       }
-    }
-}
-
-material GameTools/ShadowMapDepth
-{ 
-
-   technique 
-   { 
-      scene_blend none
-
-      pass 
-      { 
-		cull_hardware anticlockwise
-		//cull_hardware none
-		
-		vertex_program_ref GameTools/ShadowMap/DepthVS
-        {       
-          param_named_auto worldViewProj worldviewproj_matrix            
-	    } 
-		fragment_program_ref  GameTools/ShadowMap/DepthPS
-        { 
-			
-        }
-        
-       }
-    }
-}
-
-material GameTools/ShadowMapDistance
-{ 
-
-   technique 
-   { 
-      
-      pass 
-      { 
-	scene_blend none
-
-	cull_hardware anticlockwise
-	//cull_hardware none
-        //cull_software none
-	//cull_hardware clockwise
-		
-	vertex_program_ref GameTools/ShadowMap/DistVS
-        {       
-          param_named_auto worldViewProj worldviewproj_matrix
-          param_named_auto worldView worldview_matrix          
-        } 
-	fragment_program_ref  GameTools/ShadowMap/DistPS
-        { 
-	  param_named_auto farPlane far_clip_distance
-        }
-        
-       }
-    }
-}
-
-
 material GameTools/Blur
 { 
Index: GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/kupola.material
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/kupola.material	(revision 2054)
+++ GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/kupola.material	(revision 2266)
@@ -1,5 +1,5 @@
 
 
-material kupolalambert2
+material kupolalambert2_original
 { 
 
@@ -8,10 +8,11 @@
       pass 
       { 
+		
 		IllumTechniques
 		{
-			
+				
 			RenderTechnique CausticReciever
 			{
-				max_caster_count	10
+				max_caster_count	0
 			}
 			//RenderTechnique DepthShadowReciever
@@ -20,29 +21,28 @@
 			//}
 		}
-		
+			
 		scene_blend none
 		scene_blend_op add
 		scene_blend_op_alpha add
 		scene_blend_alpha none
-		 
+			
 		lighting off		
-
+	
 		vertex_program_ref GameTools/CausticSoftShadowVS
 		{       
-         //param_named_auto world_IT inverse_transpose_world_matrix  
-		 param_named_auto worldViewProj worldviewproj_matrix
-		 param_named_auto world world_matrix 
+			param_named_auto worldViewProj worldviewproj_matrix
+			param_named_auto world world_matrix 
+			//param_named_auto world_IT inverse_transpose_world_matrix  
 		} 
 		fragment_program_ref GameTools/CausticSoftShadowPS
 		{ 
-		   param_named_auto world_IT inverse_transpose_world_matrix  
-		   param_named_auto cameraPos camera_position
-		   param_named_auto lightPosition light_position 0 
+			 param_named_auto world_IT inverse_transpose_world_matrix  
+			 param_named_auto cameraPos camera_position
+			 param_named_auto lightPosition light_position 0 
 		} 
 		
-	    texture_unit
-		{
-			texture falt2.tga
-			//texture rnl_cross.hdr
+	    	texture_unit
+		{
+			texture falt2.tga			
 		}
 			 
@@ -56,5 +56,5 @@
 
 
-material kupolalambert5
+material kupolalambert5_original
 {
 	technique
@@ -67,5 +67,5 @@
 				RenderTechnique CausticReciever
 				{
-					max_caster_count	10
+					max_caster_count	1
 				}
 				//RenderTechnique DepthShadowReciever
@@ -159,2 +159,53 @@
 }
 
+
+material kupolalambert2
+{ 
+
+   technique 
+   { 
+      pass 
+      { 	
+		IllumTechniques
+		{
+		
+			RenderTechnique CausticReciever
+			{
+				max_caster_count	1
+			}
+		}
+				
+	    	texture_unit
+		{
+			texture falt2.tga			
+		}
+		
+	}
+  }
+}
+
+
+material kupolalambert5
+{
+	technique
+	{
+		
+		pass
+		{
+			IllumTechniques
+			{
+		
+				RenderTechnique CausticReciever
+				{
+					max_caster_count	1
+				}
+			}						
+			texture_unit
+			{
+				texture talaj2.tga
+			}		
+
+		}
+	}
+}
+
Index: GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/EnvMetals.material
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/EnvMetals.material	(revision 835)
+++ 	(revision )
@@ -1,245 +1,0 @@
-
-material EnvMetals/Copper 
-{ 
-
-   technique 
-   { 
-      pass 
-      { 
-		IllumTechniques
-		{
-			RenderTechnique ColorCubeMap
-			{
-				update_interval		0
-				distance_calc true 1.5
-				face_angle_calc true 1.5		
-			}
-			RenderTechnique DistanceCubeMap
-			{
-				update_interval		0
-				distance_calc true 1.5
-				face_angle_calc true 1.5		
-			}
-		
-		 }
-		 vertex_program_ref GameTools/CubeMap/VertexPrograms/LocalizedVS
-         {       
-            param_named_auto worldViewProj worldviewproj_matrix 
-    	    param_named_auto world world_matrix
-	    
-         } 
-		 fragment_program_ref 	GameTools/CubeMap/FragmentPrograms/LocalizedMetalPS
-         { 
-			param_named_auto cameraPos camera_position
-			//param_named n float3 0.21 0.96 1.17
-			//param_named k float3 4.16 2.57 2.32
-			param_named F0 float3 0.95 0.63 0.54
-			param_named_auto lightPosition light_position 0 
-			
-		} 
-		
-		//Cube map for reflections and refractions	
-		texture_unit
-		{
-			cubic_texture cubemap.jpg combinedUVW
-			tex_address_mode clamp
-			colour_op replace
-		}
-
-		//Cube map of distances
-		texture_unit
-		{
-			cubic_texture cubemap.jpg combinedUVW
-			tex_address_mode clamp
-			colour_op replace
-		}
-	  }
-    }
-}
-
-
-material EnvMetals/Gold 
-{ 
-
-   technique 
-   { 
-      pass 
-      { 
-      
-      IllumTechniques
-		{
-			RenderTechnique ColorCubeMap
-			{
-				update_interval		0
-				distance_calc true 1.5
-				face_angle_calc true 1.5		
-			}
-			RenderTechnique DistanceCubeMap
-			{
-				update_interval		0
-				distance_calc true 1.5
-				face_angle_calc true 1.5		
-			}
-			
-		 }
-	 vertex_program_ref GameTools/CubeMap/VertexPrograms/LocalizedVS
-         {       
-            param_named_auto worldViewProj worldviewproj_matrix 
-    	    param_named_auto world world_matrix
-	    
-         } 
-	 fragment_program_ref 	GameTools/CubeMap/FragmentPrograms/LocalizedMetalPS
-         { 
-	    param_named_auto cameraPos camera_position
-	    //param_named n float3 0.16 0.35 1.6
-	    //param_named k float3 3.98 2.71 1.92
-	    param_named F0 float3 0.96 0.85 0.39
-	    param_named_auto lightPosition light_position 0 
-			
-	 } 
-		
-	 //Cube map for reflections and refractions	
-	 texture_unit
-	 {
-	   cubic_texture cubemap.jpg combinedUVW
-	   tex_address_mode clamp
-	   colour_op replace
-	 }
-
-	//Cube map of distances
-	 texture_unit
-	 {
-	   cubic_texture cubemap.jpg combinedUVW
-	   tex_address_mode clamp
-	   colour_op replace
-	 }
-
-
-	}
-    }
-}
-
-
-material EnvMetals/Silver
-{ 
-
-   technique 
-   { 
-      pass 
-      { 
-      
-      IllumTechniques
-		{
-			RenderTechnique ColorCubeMap
-			{
-				update_interval		0
-				distance_calc true 1.5
-				face_angle_calc true 1.5		
-			}
-			RenderTechnique DistanceCubeMap
-			{
-				update_interval		0
-				distance_calc true 1.5
-				face_angle_calc true 1.5		
-			}
-			
-		 }
-	 vertex_program_ref GameTools/CubeMap/VertexPrograms/LocalizedVS
-         {       
-            param_named_auto worldViewProj worldviewproj_matrix 
-    	    param_named_auto world world_matrix
-	    
-         } 
-	 fragment_program_ref 	GameTools/CubeMap/FragmentPrograms/LocalizedMetalPS
-         { 
-	    param_named_auto cameraPos camera_position
-	    //param_named n float3 0.142 0.124 0.158
-	    //param_named k float3 4.52  3.33 2.32
-	    param_named F0 float3 0.97 0.95 0.9
-	    param_named_auto lightPosition light_position 0 
-			
-	 } 
-		
-	 //Cube map for reflections and refractions	
-	 texture_unit
-	 {
-	   cubic_texture cubemap.jpg combinedUVW
-	   tex_address_mode clamp
-	   colour_op replace
-	 }
-
-	//Cube map of distances
-	 texture_unit
-	 {
-	   cubic_texture cubemap.jpg combinedUVW
-	   tex_address_mode clamp
-	   colour_op replace
-	 }
-
-
-	}
-    }
-}
-
-
-material EnvMetals/Alu
-{ 
-
-   technique 
-   { 
-      pass 
-      { 
-      
-		IllumTechniques
-		{
-			RenderTechnique ColorCubeMap
-			{
-				update_interval		0
-				distance_calc true 1.5
-				face_angle_calc true 3.5		
-			}
-			RenderTechnique DistanceCubeMap
-			{
-				update_interval		0
-				distance_calc true 1.5
-				face_angle_calc true 3.5		
-			}
-			
-		 }
-	
-	 vertex_program_ref GameTools/CubeMap/VertexPrograms/LocalizedVS
-         {       
-            param_named_auto worldViewProj worldviewproj_matrix 
-    	    param_named_auto world world_matrix
-	    
-         } 
-	 fragment_program_ref 	GameTools/CubeMap/FragmentPrograms/LocalizedMetalPS
-         { 
-	    param_named_auto cameraPos camera_position
-	    //param_named n float3 1.83 0.96 0.577
-	    //param_named k float3 8.31 6.69 5.288
-	    param_named F0 float3 0.9 0.92 0.92
-	    param_named_auto lightPosition light_position 0 
-			
-	 } 
-		
-	 //Cube map for reflections and refractions	
-	 texture_unit
-	 {
-	   cubic_texture cubemap.jpg combinedUVW
-	   tex_address_mode clamp
-	   colour_op replace
-	 }
-
-	//Cube map of distances
-	 texture_unit
-	 {
-	   cubic_texture cubemap.jpg combinedUVW
-	   tex_address_mode clamp
-	   colour_op replace
-	 }
-
-
-	}
-    }
-}
Index: GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPBasic/GTPBasic_PS.hlsl
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPBasic/GTPBasic_PS.hlsl	(revision 2188)
+++ GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPBasic/GTPBasic_PS.hlsl	(revision 2266)
@@ -23,4 +23,11 @@
  float4 CPos : TEXCOORD0;
 };
+
+struct LightVPos_OUT
+{
+ float4 VPos : POSITION;
+ float4 LightVPos : TEXCOORD0;
+};
+
 
 
@@ -71,2 +78,7 @@
  return IN.color * tex3D(Texture, IN.texCoord.xyz);
 }
+
+float4 LightVPosPS(LightVPos_OUT IN):COLOR
+{
+ return float4(IN.LightVPos.xyz / IN.LightVPos.w, 1);
+}
Index: GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPBasic/GTPBasic.program
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPBasic/GTPBasic.program	(revision 2246)
+++ GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPBasic/GTPBasic.program	(revision 2266)
@@ -151,4 +151,11 @@
    source GTPBasic_PS.hlsl
    entry_point PlainTex3D
+   target ps_2_0
+}
+
+fragment_program GTP/Basic/LightVPos_PS hlsl
+{
+   source GTPBasic_PS.hlsl
+   entry_point LightVPosPS
    target ps_2_0
 }
Index: GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPBasic/GTPBasic.material
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPBasic/GTPBasic.material	(revision 2188)
+++ GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPBasic/GTPBasic.material	(revision 2266)
@@ -166,5 +166,25 @@
 }
 
-material GTP/Basic/ShadowReciever/Depth
+material GTP/Basic/Focusing
+{
+ technique
+ {
+  pass
+  {
+	vertex_program_ref GTP/Basic/LightVPos_VS
+        {       
+	    param_named_auto 	World		world_matrix
+            param_named_auto 	WorldViewProj	worldviewproj_matrix
+	    param_named 	LightViewProj	matrix4x4	 
+        } 
+	fragment_program_ref  GTP/Basic/LightVPos_PS
+        { 
+	   
+        }
+  }
+ }		
+}
+
+material GTP/Basic/ShadowReciever/Depth_VSM
 {
  technique
@@ -176,14 +196,14 @@
      {
         RenderTechnique DepthShadowReciever
-		{
-			max_light_count 1
-			vertex_program_name GTP/Basic/LightVPos_VS
-			fragment_program_name GTP/Basic/SM/Depth_VSM_PS
-			set_light_view false
-			set_light_farplane false
-			world_view_proj_param_name WorldViewProj
-			world_param_name World
-			light_viewproj_param_name LightViewProj			
-		}	
+	{
+		max_light_count 1
+		vertex_program_name GTP/Basic/LightVPos_VS
+		fragment_program_name GTP/Basic/SM/Depth_VSM_PS
+		set_light_view false
+		set_light_farplane false
+		world_view_proj_param_name WorldViewProj
+		world_param_name World
+		light_viewproj_param_name LightViewProj			
+	}	
      }
    }
@@ -191,4 +211,31 @@
 }
 
+material GTP/Basic/ShadowReciever/Distance_VSM
+{
+ technique
+ {
+   pass
+   {
+     lighting off
+     IllumTechniques
+     {
+        RenderTechnique DepthShadowReciever
+	{
+		max_light_count 1
+		vertex_program_name GTP/Basic/LightCPos_VS
+		fragment_program_name GTP/Basic/SM/Dist_VSM_PS
+		world_view_proj_param_name WorldViewProj
+		world_param_name World
+		light_viewproj_param_name LightViewProj
+		set_light_view true
+		set_light_farplane true		
+		light_view_param_name LightView
+		light_farplane_param_name lightFarPlane
+	}	
+     }
+   }
+ }
+}
+
 material GTP/Basic/ShadowReciever/ShadowAccum
 {
@@ -197,10 +244,5 @@
    pass
    {
-    lighting off
-     ambient 1 1 1 1
-	diffuse 1 1 1 1
-	specular 1 1 1 1
-	emissive 0 0 0
-
+     lighting off   
      IllumTechniques
      {
Index: GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPBasic/GTPBasicShading.hlsl
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPBasic/GTPBasicShading.hlsl	(revision 2266)
+++ GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPBasic/GTPBasicShading.hlsl	(revision 2266)
@@ -0,0 +1,33 @@
+struct ShadedTex_OUT
+{
+ float4 vPos : POSITION;
+ float4 texCoord : TEXCOORD0;
+ float4 wNormal : TEXCOORD1;
+ float4 wPos    : TEXCOORD2;  
+};
+#define SAMPLECUTDIST2 0.01
+float4 TexturedShadedOneLight_PS(ShadedTex_OUT IN,
+						uniform float3 lightPos,
+						uniform float3 lightDir,
+						uniform float3 lightColor,						
+						uniform float  lightPower,
+						uniform sampler2D colorTex : register(s0)):COLOR0
+{
+	float4 color = 1;
+	
+	lightDir = normalize(lightDir);
+	IN.wNormal.xyz = normalize(IN.wNormal.xyz);
+	
+	float3 diff = lightPos - IN.wPos;
+	float dist2 = dot(diff, diff);
+	if(dist2 < SAMPLECUTDIST2)
+		dist2 = SAMPLECUTDIST2;	
+	diff = normalize(diff);
+	float cosa = max(dot(lightDir, -diff), 0);
+	float cosb = max(dot(IN.wNormal.xyz, diff), 0);
+	
+	color.rgb = pow(cosa, 9) * cosb / dist2 * lightPower;
+	//color.rgb *= lightPower;
+	//return 0;
+	return color * tex2D(colorTex, IN.texCoord);
+}
