Index: GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPPostProc/GTPPostProc.material
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPPostProc/GTPPostProc.material	(revision 2414)
+++ GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPPostProc/GTPPostProc.material	(revision 2458)
@@ -57,5 +57,5 @@
 			param_named_auto width viewport_width 	
 	        param_named_auto height viewport_height 
-	        param_named_auto alpha frame_time 9.0
+	        param_named_auto alpha frame_time 1.0
 	        
         }
Index: GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/FireBall.particle
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/FireBall.particle	(revision 2458)
+++ GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/FireBall.particle	(revision 2458)
@@ -0,0 +1,68 @@
+Moria/FireBall
+{
+	renderer sprite
+	material        Fire
+    particle_width  0.17
+    particle_height 0.17
+    cull_each       false
+    quota           1000
+    //quota           1
+    billboard_type  point
+    //local_space	true
+    
+    emitter Point
+    {
+        colour_range_start 1 1 1 0.0
+		colour_range_end 0.8 1 0.5 0
+
+        emission_rate   100
+        time_to_live_min	0.3
+	    time_to_live_max	0.4
+	   //time_to_live 0
+        direction       0 1 0
+        angle           180
+        velocity_min   	0.08
+        velocity_max   	0.15              
+    } 
+        
+    affector ColourFader2
+    {
+       alpha1 +6.0
+       alpha2 -6.0
+       state_change 0.15
+    }    
+}
+
+Moria/Explosion
+{
+	renderer sprite
+	material        Fire
+    particle_width  0.2
+    particle_height 0.2
+    cull_each       false
+    quota           1000
+    billboard_type  point
+    //local_space	true    
+    
+    emitter Point
+    {
+        colour_range_start 1 1 1 0.2
+		colour_range_end 0.8 1 0.5 0
+
+        emission_rate   0
+        time_to_live    0.8
+        direction       0 1 0
+        angle           80
+        velocity    	3.0       
+    } 
+
+    
+    affector ColourFader2
+    {
+       alpha1 +6.0
+       alpha2 -6.0
+       state_change 0.4
+    }    
+}
+
+
Index: GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/FireHeat.compositor
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/FireHeat.compositor	(revision 2458)
+++ GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/FireHeat.compositor	(revision 2458)
@@ -0,0 +1,25 @@
+compositor FireHeatCompositor
+{
+    technique
+    {
+        texture scene target_width target_height PF_FLOAT16_RGBA
+	
+   		
+        target scene
+        {
+            // Render output from previous compositor (or original scene)
+            input previous
+        }     
+      
+        target_output
+        {
+            input none
+          
+            pass render_quad
+            {
+               material FireHeatCompositor
+               input 0 scene               
+            }
+        }
+    }
+}
Index: GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/troll.material
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/troll.material	(revision 2417)
+++ GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/troll.material	(revision 2458)
@@ -19,5 +19,5 @@
    source trollps.hlsl
    entry_point Troll_PS
-   target ps_2_0
+   target ps_3_0
 }
 
@@ -81,12 +81,16 @@
 				param_named_auto worldMatrix3x4Array[0] world_matrix_array_3x4
 				param_named_auto viewProjectionMatrix viewproj_matrix
-				param_named_auto lightPos light_position 0
+				param_named_auto lightPos1 light_position 0
+				param_named_auto lightPos2 light_position 1
 				param_named_auto cameraPos camera_position		
 			}
 			fragment_program_ref TrollPS
 			{
-				param_named_auto lightRange light_attenuation 0
-   			    param_named_auto lightPower light_power 0
-   			    param_named_auto lightColor light_diffuse_colour 0
+				param_named_auto lightRange1 light_attenuation 0
+   			    param_named_auto lightPower1 light_power 0
+   			    param_named_auto lightColor1 light_diffuse_colour 0
+   			    param_named_auto lightRange2 light_attenuation 1
+   			    param_named_auto lightPower2 light_power 1
+   			    param_named_auto lightColor2 light_diffuse_colour 1
    			    param_named specularity float 200
    			    param_named albedo float 0.1
@@ -150,2 +154,50 @@
 }
 
+vertex_program GTP/Troll/Mace_VS hlsl
+{
+   source sword.hlsl
+   entry_point Sword_VS
+   target vs_2_0
+}
+fragment_program GTP/Troll/Mace_PS hlsl
+{
+   source sword.hlsl
+   entry_point Sword_Handle_PS
+   target ps_3_0
+}
+
+material TrollMace
+{
+	technique
+	{
+		pass
+		{
+			vertex_program_ref GTP/Troll/Mace_VS
+   			{
+   			  param_named_auto WorldViewProj worldviewproj_matrix  
+   			  param_named_auto World world_matrix
+   			  param_named_auto WorldI inverse_world_matrix
+   			  param_named_auto wCamPos camera_position
+   			}
+  			fragment_program_ref GTP/Troll/Mace_PS
+  			{ 
+	  		  param_named_auto wLightPos1 light_position 0
+   			 // param_named_auto wLightPos2 light_position 1   			  
+	  		  param_named_auto lightRange1 light_attenuation 0
+  			 // param_named_auto lightRange2 light_attenuation 1
+   			  param_named_auto lightPower1 light_power 0
+   			 // param_named_auto lightPower2 light_power 1
+   			  param_named_auto lightColor1 light_diffuse_colour 0
+   			 // param_named_auto lightColor2 light_diffuse_colour 1
+   			  param_named specularity float 100
+   			  param_named specularColor float4 0.05 0.05 0.05 0.05   			  
+   			}
+			texture_unit
+			{
+			  texture trollmace.jpg
+			}						
+		}
+	}
+}
+
+
Index: GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/trollps.hlsl
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/trollps.hlsl	(revision 2417)
+++ GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/trollps.hlsl	(revision 2458)
@@ -10,7 +10,11 @@
 uniform sampler2D bumpMap : register(s1);
 
-uniform float4 lightRange;
-uniform float lightPower;
-uniform float4 lightColor;
+uniform float4 lightRange1;
+uniform float lightPower1;
+uniform float4 lightColor1;
+
+uniform float4 lightRange2;
+uniform float lightPower2;
+uniform float4 lightColor2;
 
 uniform float specularity;
@@ -27,5 +31,6 @@
 	float3 normal:TEXCOORD3;
 	float3 V: TEXCOORD4;
-	float3 L: TEXCOORD5;
+	float3 L1: TEXCOORD5;
+	float3 L2: TEXCOORD6;
 };
 
@@ -36,9 +41,12 @@
 	float dist = length(IN.V);
 	float3 V = IN.V /dist;
-	float3 L = IN.L;
+	float3 L1 = IN.L1;
+	float3 L2 = IN.L2;
 	
 	float4 diffuseColor = albedo * tex2D(colorTexture, IN.texCoord);
-	
-	Color = Illumination(N, L, V, lightColor * lightPower, lightRange, diffuseColor, specularity, specularColor);
+	if(lightPower1 != 0)
+	Color += Illumination(N, L1, V, lightColor1 * lightPower1, lightRange1, diffuseColor, specularity, specularColor);
+	if(lightPower2 != 0)
+	Color += Illumination(N, L2, V, lightColor2 * lightPower2, lightRange2, diffuseColor, specularity, specularColor);
 	
 	float4 ret =  Color;
Index: GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/moria.material
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/moria.material	(revision 2442)
+++ GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/moria.material	(revision 2458)
@@ -24,5 +24,5 @@
 			 	//{
 					//pass_blending one one
-			    	//	new_passes false
+			    //	new_passes false
 				//	start_tex_id 3
 			  	//}	
@@ -33,5 +33,5 @@
 			 	RenderTechnique DepthShadowReceiver
 				{
-					max_light_count 1
+					max_light_count 2
 					set_light_viewproj false
 					set_light_view true
@@ -272,2 +272,135 @@
 }
 
+material GTP/Moria/Crosshair
+{
+	technique
+	{
+	 pass
+	 {
+	  scene_blend one one_minus_src_colour
+	  cull_hardware none
+	  depth_test off
+	  depth_write off
+	  lighting off
+	  texture_unit
+	  {
+	    texture crosshair.jpg
+	    colour_op replace
+	  }
+	 }
+	}
+}
+
+material GTP/Moria/Border
+{
+	technique
+	{
+	 pass
+	 {
+	 scene_blend one one_minus_src_colour
+	  cull_hardware none
+	  depth_test off
+	  depth_write off
+	  lighting off
+	  texture_unit
+	  {
+	    texture border.jpg
+	    colour_op replace
+	  }
+	 }
+	}
+}
+
+material GTP/Moria/HUD/Column
+{
+	technique t1
+	{
+	 pass p1
+	 {
+//	  scene_blend one one_minus_src_colour
+	  cull_hardware none
+	  depth_test off
+	  depth_write off
+	  lighting off
+	  
+	 }
+	}
+}
+
+material GTP/Moria/HUD/BlueColumn : GTP/Moria/HUD/Column
+{
+	technique t1
+	{
+	 pass p1
+	 {
+	  texture_unit
+	  {
+	    texture blue.jpg
+	    colour_op replace
+	  }
+	 }
+	}
+}
+
+material GTP/Moria/HUD/RedColumn : GTP/Moria/HUD/Column
+{
+	technique t1
+	{
+	 pass p1
+	 {
+	  texture_unit
+	  {
+	    texture red.jpg
+	    colour_op replace
+	  }
+	 }
+	}
+}
+
+material GTP/Moria/HUD/YellowColumn : GTP/Moria/HUD/Column
+{
+	technique t1
+	{
+	 pass p1
+	 {
+	  texture_unit
+	  {
+	    texture yellow.jpg
+	    colour_op replace
+	    tex_address_mode clamp
+	  }
+	 }
+	}
+}
+
+material GTP/Moria/HUD/SwordIcon : GTP/Moria/HUD/Column
+{
+	technique t1
+	{
+	 pass p1
+	 {
+	  texture_unit
+	  {
+	    texture swordicon.jpg
+	    colour_op replace
+	    tex_address_mode clamp
+	  }
+	 }
+	}
+}
+
+material GTP/Moria/HUD/FireBallIcon : GTP/Moria/HUD/Column
+{
+	technique t1
+	{
+	 pass p1
+	 {
+	  texture_unit
+	  {
+	    texture fireballicon.jpg
+	    colour_op replace
+	    tex_address_mode clamp
+	  }
+	 }
+	}
+}
Index: GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/MoriaHallBase.hlsl
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/MoriaHallBase.hlsl	(revision 2442)
+++ GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/MoriaHallBase.hlsl	(revision 2458)
@@ -28,5 +28,5 @@
 uniform float lightPower2;
 uniform float4 lightColor1;
-uniform float4 lightColor2;
+float4 lightColor2 = 0;
 						
 uniform float4x4 LightView1;
@@ -100,6 +100,6 @@
 float shadow;
 
-//if(dot(lightColor1, lightColor1) != 0)
-//{
+if( dot(lightRange1, lightRange1) != 0)
+{
 	L = wLightPos1.xyz - IN.wPos * wLightPos1.w;
 	//illumination
@@ -112,9 +112,9 @@
 	
 	//Color = col;
-//}
+}
 
 //----------------------------------------------------------------------------------------------------------------
 //light2			
-/*if(dot(lightColor2, lightColor2) != 0)
+if( dot(lightRange2, lightRange2) != 0 )
 {
 	//light dir
@@ -126,5 +126,5 @@
 	shadow = shadowPoint(ShadowMap2Point, lightCPos, lightFarPlane2);
 	Color += col * shadow;	
-}*/
+}
 	
 	//do Path Map to gather indirect illumination
Index: GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/FPSArm_PS.hlsl
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/FPSArm_PS.hlsl	(revision 2417)
+++ GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/FPSArm_PS.hlsl	(revision 2458)
@@ -10,7 +10,11 @@
 uniform sampler2D bumpMap : register(s1);
 
-uniform float4 lightRange;
-uniform float lightPower;
-uniform float4 lightColor;
+uniform float4 lightRange1;
+uniform float lightPower1;
+uniform float4 lightColor1;
+
+uniform float4 lightRange2;
+uniform float lightPower2;
+uniform float4 lightColor2;
 
 uniform float specularity;
@@ -27,5 +31,6 @@
 	float3 normal:TEXCOORD3;
 	float3 V: TEXCOORD4;
-	float3 L: TEXCOORD5;
+	float3 L1: TEXCOORD5;
+	float3 L2: TEXCOORD6;
 };
 
@@ -36,9 +41,14 @@
 	float dist = length(IN.V);
 	float3 V = IN.V /dist;
-	float3 L = IN.L;
+	float3 L1 = IN.L1;
+	float3 L2 = IN.L2;
 	
 	float4 diffuseColor = albedo * tex2D(colorTexture, IN.texCoord);
 	
-	Color = Illumination(N, L, V, lightColor * lightPower, lightRange, diffuseColor, specularity, specularColor);
+	if(lightPower1 !=0)
+	Color = Illumination(N, L1, V, lightColor1 * lightPower1, lightRange1, diffuseColor, specularity, specularColor);
+	
+	if(lightPower2 !=0)
+	Color = Illumination(N, L2, V, lightColor2 * lightPower2, lightRange2, diffuseColor, specularity, specularColor);
 	
 	float4 ret = Color;
Index: GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/main.overlay
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/main.overlay	(revision 2458)
+++ GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/main.overlay	(revision 2458)
@@ -0,0 +1,123 @@
+MORIA/MainOverlay
+{
+	zorder 500
+	container Panel(MainContainer)
+	{
+	 transparent true
+	 left 0
+	 top 0
+	 width 1
+	 height 1
+
+	 element TextArea(Level)
+	 {
+	   left 0.01
+	   top 0.01
+	   width 0.2
+	   height 0.04
+	   char_height 0.04
+           colour 1 1 1
+	   font_name TrebuchetMSBold
+  	   caption Kills	   
+	 }
+	 element TextArea(Deaths)
+	 {
+	   left 0.01
+	   top 0.06
+	   width 0.2
+	   height 0.04
+	   char_height 0.04
+           colour 1 1 1
+	   font_name TrebuchetMSBold
+  	   caption Deaths	   
+	 }	 
+	 element Panel(Cross)
+	 {
+	   left 0.4998125
+	   top 0.475
+	   width 0.0375
+	   height 0.05
+	   material GTP/Moria/Crosshair
+	   transparent false
+	   uv_coords 0 0 1 1
+	 }
+	 element Panel(Sword)
+	 {
+	   left 0.1
+	   top 0.89
+	   width 0.1
+	   height 0.1
+	   material GTP/Moria/HUD/SwordIcon
+	   transparent false
+	   uv_coords 0 0 1 1
+	 }
+	 element Panel(FireBall)
+	 {
+	   left 0.22
+	   top 0.92
+	   width 0.04
+	   height 0.04
+	   material GTP/Moria/HUD/FireBallIcon
+	   transparent false
+	   uv_coords 0 0 1 1
+	 }
+	 container Panel(Strength)
+	 {
+	   material GTP/Moria/Border
+	   width 0.02
+	   height 0.3
+	   transparent false
+	   uv_coords 0 0 1 1
+	   left 0.02
+	   top 0.6
+	   
+	   container Panel(StrengthColumn)
+	   {
+	     material GTP/Moria/HUD/YellowColumn
+	     uv_coords 0 0 1 1 
+	     width 0.0133
+	     height 0.29
+	     left 0.0033
+	     top 0.005   
+	   }
+	 }
+	 container Panel(Manna)
+	 {
+	   material GTP/Moria/Border
+	   width 0.03
+	   height 0.3
+	   transparent false
+	   uv_coords 0 0 1 1
+	   left 0.92
+	   top 0.6
+	   container Panel(MannaColumn)
+	   {
+	     material GTP/Moria/HUD/BlueColumn
+	     uv_coords 0 0 1 1 
+	     width 0.01995
+	     height 0.29
+	     left 0.00495
+	     top 0.005   
+	   }	
+	 }
+	 container Panel(Health)
+	 {
+	   material GTP/Moria/Border
+	   width 0.03
+	   height 0.3
+	   transparent false
+	   uv_coords 0 0 1 1
+	   left 0.955
+	   top 0.6
+	   container Panel(HealthColumn)
+	   {
+	     material GTP/Moria/HUD/RedColumn
+	     uv_coords 0 0 1 1 
+	     width 0.01995
+	     height 0.29
+	     left 0.00495
+	     top 0.005   
+	   }			
+	 }
+	}
+}
Index: GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/SkinningVS.cg
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/SkinningVS.cg	(revision 2422)
+++ GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/SkinningVS.cg	(revision 2458)
@@ -13,8 +13,10 @@
 	out float3 oNormal   : TEXCOORD3,
 	out float3 V: TEXCOORD4,
-	out float3 L: TEXCOORD5,
+	out float3 L1: TEXCOORD5,
+	out float3 L2: TEXCOORD6,
 	uniform float3x4   worldMatrix3x4Array[69],
 	uniform float4x4 viewProjectionMatrix,
-	uniform float4   lightPos,
+	uniform float4   lightPos1,
+	uniform float4   lightPos2,
 	uniform float4   cameraPos)
 {
@@ -34,5 +36,6 @@
 //	oBinormal = cross(oTangent, oNormal);
 	// Lighting - support point and directional
-	L =  lightPos.xyz - blendPos.xyz * lightPos.w;
+	L1 =  lightPos1.xyz - blendPos.xyz * lightPos1.w;
+	L2 =  lightPos2.xyz - blendPos.xyz * lightPos2.w;
 	V =  cameraPos.xyz - blendPos.xyz;
 	
@@ -69,5 +72,6 @@
 	float3 normal:TEXCOORD3;
 	float3 V: TEXCOORD4;
-	float3 L: TEXCOORD5;
+	float3 L1: TEXCOORD5;
+	float3 L2: TEXCOORD6;
 };
 
@@ -81,5 +85,6 @@
 			uniform float4x4 viewMatrix,
 			uniform float4x4 viewProjectionMatrix,
-			uniform float4   lightPos,
+			uniform float4   lightPos1,
+			uniform float4   lightPos2,
 			uniform float4   cameraPos)
 {
@@ -101,5 +106,6 @@
 	OUT.binormal = cross(OUT.tangent, OUT.normal);
 	// Lighting - support point and directional
-	OUT.L =  lightPos.xyz - blendPos.xyz * lightPos.w;
+	OUT.L1 =  lightPos1.xyz - blendPos.xyz * lightPos1.w;
+	OUT.L2 =  lightPos2.xyz - blendPos.xyz * lightPos2.w;
 	OUT.V =  cameraPos.xyz - blendPos.xyz;
 	
Index: GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/Fire.material
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/Fire.material	(revision 2458)
+++ GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/Fire.material	(revision 2458)
@@ -0,0 +1,79 @@
+vertex_program FireVS hlsl
+{
+	source Fire.hlsl
+	entry_point FireVS
+	target vs_2_0 
+} 
+
+fragment_program FirePS hlsl
+{
+	source Fire.hlsl
+	entry_point FirePS
+	target ps_3_0
+}
+
+material Fire
+{ 
+
+   technique 
+   { 
+   	pass 
+      { 
+			IllumTechniques
+			{
+				RenderTechnique Fire
+				{
+					texture_unit_id	1
+				}
+			}
+			
+			lighting off
+			
+			scene_blend src_alpha one
+			scene_blend_alpha zero one
+			//scene_blend src_alpha one_minus_src_alpha
+			depth_write off
+			depth_check off
+			
+			vertex_program_ref FireVS
+			{       
+				param_named_auto worldViewProj worldviewproj_matrix 
+				param_named_auto worldView worldview_matrix
+				param_named_auto Proj projection_matrix
+				param_named_auto width viewport_width 	
+				param_named_auto height viewport_height 			    
+			} 
+			fragment_program_ref  FirePS
+			{ 
+				param_named_auto farplane far_clip_distance	  
+				param_named_auto nearplane near_clip_distance
+				param_named_auto frametime frame_time 1.0		   	  
+			}
+
+			texture_unit
+			{
+				anim_texture smokealpha.tga 32 2.0
+				//texture flare.png
+			}
+
+			texture_unit
+			{
+				filtering none
+			}
+			
+			texture_unit
+			{
+				texture planck.tga
+			}
+			texture_unit
+			{
+				texture heatnoise2.tga
+			}
+			texture_unit
+			{
+				texture noise.tga
+			}
+
+       }
+    }
+}
Index: GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/Fire.hlsl
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/Fire.hlsl	(revision 2458)
+++ GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/Fire.hlsl	(revision 2458)
@@ -0,0 +1,154 @@
+
+float farplane = 1000.0; //far plane
+float nearplane = 0.1; //far plane
+float width = 800;
+float height = 600;
+
+struct SBB_VS_OUT
+{
+	float4 hPosition	: POSITION;
+	float4 texCoord		: TEXCOORD0;
+	float3 P		: TEXCOORD1;
+	float3 Q		: TEXCOORD2;
+	float r			: TEXCOORD3;
+	float2 screenCoord	: TEXCOORD4;	
+	float4 color		: COLOR0;
+};
+
+SBB_VS_OUT FireVS (float4 position : POSITION,	
+		float4 texCoord : TEXCOORD0,
+		float4 color 	: COLOR,
+		uniform float4x4 worldView,
+		uniform float4x4 Proj,
+		uniform float4x4 worldViewProj)
+{
+	SBB_VS_OUT OUT;
+  
+	float2 offset = texCoord.zw;
+	float4 cPosition;   
+	float4 wPosition = position;    
+	cPosition = mul(worldView, wPosition);	
+	OUT.P = cPosition.xyz;
+	OUT.P.z = - 1 * OUT.P.z;
+	cPosition.xy += offset;				
+	OUT.Q = cPosition.xyz;	
+	OUT.Q.z = OUT.P.z;
+	OUT.r = abs(texCoord.z);		
+
+   /*texCoord.y = 1.0 - texCoord.y;
+   float2 offset = texCoord.xy * 2.0 - 1.0;
+   float4 cPosition = mul(worldView, position);
+   OUT.P = cPosition.xyz;
+   OUT.P.z = - 1 * OUT.P.z; // - texCoord.w;
+   cPosition.xy += offset * texCoord.w;
+   OUT.Q = cPosition.xyz;
+   OUT.Q.z = OUT.P.z;
+   OUT.r = texCoord.w;*/
+  
+   OUT.hPosition = mul( Proj, cPosition );
+   OUT.screenCoord =  (OUT.hPosition.xy / OUT.hPosition.w + 1.0) / 2.0;
+   OUT.screenCoord.y = 1.0 - OUT.screenCoord.y;
+   OUT.screenCoord += float2(0.5/width, 0.5/height);   
+   
+   OUT.texCoord = texCoord;
+   OUT.color = color;
+
+
+  return OUT;
+} 
+
+
+void FirePS(SBB_VS_OUT IN ,
+	//	in screenCoord : VPOS,
+		uniform sampler2D colorTexture : register(s0),
+		uniform sampler2D DepthMap : register(s1)
+		,uniform sampler2D PlanckMap : register(s2),
+		uniform sampler2D gradTex : register(s3),
+		uniform sampler2D heatTex : register(s4),
+		uniform float frametime,
+		out float4 Color : COLOR0,
+		out float4 Heat: COLOR1)
+{
+	Color = IN.color;
+	float alpha = 0;
+	
+	
+	float d = length( IN.Q - IN.P );
+	float Zs;
+	
+	Heat = float4(0,0,0,0.8);	
+	
+	if( d < IN.r )
+	{	 
+		float w = sqrt( IN.r * IN.r - d * d );
+		alpha = w / IN.r;
+		float alpha2 = alpha * alpha;
+		alpha = pow( alpha, 4);
+	
+		float F = IN.Q.z - w;
+		float B = IN.Q.z + w;	 
+
+		Zs = tex2D( DepthMap, IN.screenCoord ).r;
+		if(Zs == 0) Zs = farplane;
+		float ds = min( Zs, B ) - max( nearplane, F );	 
+		
+		alpha *=  ds / w * 0.5;	
+		//alpha2 *=  ds / w * 0.5;
+		
+		Heat.rg = alpha2;	
+	}
+	if(alpha == 0)
+		discard;
+	
+	alpha = saturate(alpha);
+	Color.a = alpha * tex2D( colorTexture, IN.texCoord.xy).r ;
+	Color.a *= IN.color.a;
+	Color.rgb *= tex2D( PlanckMap, float2(Color.a, frametime)).rgb;
+	float grad = tex2D(gradTex, IN.texCoord.xy).r;
+	//Color.a *= grad;
+
+	//Heat.rg *= (tex2D(heatTex, IN.texCoord.xy + frametime).rg * 2.0 - 1.0) * IN.color.a;
+	Heat.rg *= grad * (tex2D(heatTex, IN.texCoord.xy + frametime).rg * 2.0 - 1.0) * IN.color.a;
+	
+	Color.a *= 10.0;
+	//Color = 1;
+	//Heat = 1;
+}
+
+struct VS_OUT
+{
+	float4 hPosition	: POSITION;
+	float2 texCoord		: TEXCOORD0;	
+};
+
+
+float4 FireHeatCompositorPS(VS_OUT IN,
+		uniform float width,
+		uniform float height,
+		uniform sampler2D Scene: register(s0)
+		,uniform sampler2D FireColor: register(s1)
+		,uniform sampler2D FireHeatNoise: register(s2)
+		 ):COLOR
+{	
+	float maxOffset = 0.035;
+	float4 Color = 1;
+	float2 halfpixel = float2(1.0 / width, 1.0 / height);
+	float2 halfpixel2 = 2*halfpixel;
+
+	float2 offset = tex2D(FireHeatNoise,IN.texCoord ).rg;
+		
+	offset *= maxOffset;
+	float2 newTex = IN.texCoord + offset;
+	float2 newTex2 = newTex + halfpixel2;
+	newTex = newTex + halfpixel;
+
+	newTex = saturate(newTex);
+	float4 SceneSample = tex2D(Scene, newTex );
+	float4 FireSample  = tex2D(FireColor, newTex2 );
+	
+	Color = SceneSample + FireSample;// + float4(offset,1,1);	
+	Color.a = SceneSample.a;
+	return Color;
+	return float4(offset,0,1);
+}
+
Index: GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/FireHeatCompositor.material
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/FireHeatCompositor.material	(revision 2458)
+++ GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/FireHeatCompositor.material	(revision 2458)
@@ -0,0 +1,39 @@
+fragment_program FireHeatCompositorFP hlsl
+{
+	source Fire.hlsl
+	entry_point FireHeatCompositorPS
+	target ps_3_0
+}
+
+material FireHeatCompositor
+{
+   technique 
+   { 
+      pass 
+      {
+	 vertex_program_ref GTP/PostProc/PostProc_VS
+         {
+       
+         } 
+	 fragment_program_ref FireHeatCompositorFP
+         { 
+			param_named_auto width viewport_width 	
+			param_named_auto height viewport_height 
+		 }
+         texture_unit //scene
+		{
+			//filtering none	
+		}
+		texture_unit
+		{
+			texture ILLUM_FIRE_COLOR_TEXTURE
+		}	
+		texture_unit
+		{
+			texture ILLUM_FIRE_HEAT_TEXTURE
+		}
+		
+      }
+   }
+}
+
Index: GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/GTPMoriaPostProc.material
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/GTPMoriaPostProc.material	(revision 2442)
+++ GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/GTPMoriaPostProc.material	(revision 2458)
@@ -81,5 +81,5 @@
 			param_named focalDist  float 2.0 
 			param_named focalRange float 0.02
-			param_named maxCoC     float 15
+			param_named maxCoC     float 10
 	        
         }
Index: GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/moria.level
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/moria.level	(revision 2389)
+++ GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/moria.level	(revision 2458)
@@ -88,6 +88,8 @@
 	pathmapresolution 16
 	divide 1
-	physXShape cube 2 10 2
+	physXShape cube 3 12 3
 	physXStatic true
+	//physXMass 10000
+	//physXKinematic true
 }
 mesh MoriaWallShape
Index: GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/illum.hlsl
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/illum.hlsl	(revision 2442)
+++ GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/illum.hlsl	(revision 2458)
@@ -1,7 +1,7 @@
 #define SPOT_ANGLE 2.093
 #define SPOT_FALLOFF 1
-#define SHADOW_COLOR float4(0.0,0.0,0.0,1.0)
-#define SHADOW_BIAS_POINT 0.0001
-#define SHADOW_EPSILON_POINT 0.0001
+#define SHADOW_COLOR float4(0.2,0.2,0.2,1.0)
+#define SHADOW_BIAS_POINT 0.001
+#define SHADOW_EPSILON_POINT 0.0000005
 
 float4 Illumination(float3 N, float3 L, float3 V, float4 lightColor, float4 lightRange, float4 diffuseColor, float specularity, float4 specularColor)
Index: GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/FPSarm.material
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/FPSarm.material	(revision 2422)
+++ GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/FPSarm.material	(revision 2458)
@@ -19,5 +19,5 @@
    source FPSArm_PS.hlsl
    entry_point FPSArm_PS
-   target ps_2_0
+   target ps_3_0
 }
 
@@ -81,12 +81,16 @@
 			    param_named_auto worldMatrix3x4Array[0] world_matrix_array_3x4
 			    param_named_auto viewProjectionMatrix viewproj_matrix
-			    param_named_auto lightPos light_position 0
+			    param_named_auto lightPos1 light_position 0
+			    param_named_auto lightPos2 light_position 1
 			    param_named_auto cameraPos camera_position		
 			}
 			fragment_program_ref FPSArm_PS 
 			{
-			    param_named_auto lightRange light_attenuation 0
-   			    param_named_auto lightPower light_power 0
-   			    param_named_auto lightColor light_diffuse_colour 0
+			    param_named_auto lightRange1 light_attenuation 0
+   			    param_named_auto lightPower1 light_power 0
+   			    param_named_auto lightColor1 light_diffuse_colour 0
+   			     param_named_auto lightRange2 light_attenuation 1
+   			    param_named_auto lightPower2 light_power 1
+   			    param_named_auto lightColor2 light_diffuse_colour 1
    			    param_named specularity float 100
    			    param_named albedo float 0.1
