Index: GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/GameTools.material
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/GameTools.material	(revision 2139)
+++ GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/GameTools.material	(revision 2152)
@@ -34,5 +34,5 @@
 			texture_unit
 			{
-				cubic_texture stormy.jpg separateUV
+				cubic_texture morning.jpg separateUV
 				tex_address_mode clamp
 			}
Index: GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/hangar.material
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/hangar.material	(revision 2139)
+++ GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/hangar.material	(revision 2152)
@@ -5,23 +5,5 @@
 		pass
 		{
-			IllumTechniques
-		    {
-			
-			 RenderTechnique CausticReciever
-			 {
-				max_caster_count	1					
-			 }
-			 RenderTechnique DepthShadowReciever
-			 {
-					max_light_count 3
-					vertex_program_name GameTools/ShadowMap/ShadowDistVS
-					fragment_program_name GameTools/ShadowMap/ShadowDistPS
-					set_light_view true
-					set_light_farplane true
-			 }					
-		    }	
-			iteration once_per_light spot
-			//iteration once_per_light point
-
+		
 			ambient 1.0 1.0 1.0 1
 			diffuse 1.0 1.0 1.0 1
Index: GTP/trunk/App/Demos/Illum/Ogre/Media/Demo/bump.hlsl
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/Media/Demo/bump.hlsl	(revision 2152)
+++ GTP/trunk/App/Demos/Illum/Ogre/Media/Demo/bump.hlsl	(revision 2152)
@@ -0,0 +1,111 @@
+uniform float textureRepeat = 6;
+uniform sampler2D ColorMapSampler : register(s0);
+uniform sampler2D DetailMapSampler   : register(s1);
+uniform sampler2D BumpMapSampler  : register(s2);
+uniform float4x4 WorldViewProj;
+uniform float4x4 World;
+uniform float4x4 WorldI;
+uniform float4 wLightPos;
+uniform float3 wCamPos;
+
+
+float3x3 TransfModelToTangent( in  float3 Tangent, in float3 Binormal, in float3 Normal ) {
+	float T2 = dot(Tangent, Tangent);
+	float B2 = dot(Binormal, Binormal);
+	float N2 = dot(Normal, Normal);
+	float BT = dot(Binormal, Tangent);
+	float det = B2 * T2 - BT * BT;
+
+	return float3x3( (B2 * Tangent - BT * Binormal)/det, 
+	                 (T2 * Binormal - BT * Tangent)/det, 
+	                 Normal/N2 );
+/*		                               		
+	// simplified solution
+	return float3x3(Tangent/T2, Binormal/B2, Normal/N2); 
+*/
+}
+
+float4 Illumination(float3 Light, float3 Normal, float3 View, float2 TexCoord, float2 TexCoord2)
+{
+	// Blinn lighting
+	float3 Half = normalize(Light + View);
+	float Diffuse = dot(Normal, Light);
+	float Specular = dot(Normal, Half);
+	float4 Lighting = lit(Diffuse, Specular, 16);
+	float4 Color= tex2D(ColorMapSampler, TexCoord) * tex2D(DetailMapSampler, TexCoord2);
+
+	return (Lighting.y + 0.1) * Color;
+}
+
+struct VS_INPUT {
+    float4 Position  : POSITION;     // point in modeling space
+    float2 TexCoord  : TEXCOORD0;    // texture coordinates
+    float2 TexCoord2 : TEXCOORD1;    // texture coordinates
+    float3 Tangent   : TEXCOORD2;  	 // model space tangent vector
+    float3 Normal    : NORMAL;		 // model space triangle normal vector
+};
+
+struct VS_OUTPUT {
+    float4 hPosition : POSITION;     // point in normalized device space before homogeneous division
+    float2 TexCoord  : TEXCOORD0;    // texture coordinates
+    float2 TexCoord2  : TEXCOORD6;    // texture coordinates
+    float3 mView     : TEXCOORD1;    // model space view vector
+    float3 mLight    : TEXCOORD2;    // model space light vector
+    float3 wTangent   : TEXCOORD3;	 // model space tangent vector
+    float3 wBinormal  : TEXCOORD4;	 // model space binormal vector
+    float3 wNormal    : TEXCOORD5;	 // model space triangle normal vector
+};
+
+
+
+
+//------------------------------------------------------------------------------------
+//
+// Base vertex shader: vertex shader for all methods: calculates tangent-space
+//		tLight, tView, hPosition vectors
+//
+//------------------------------------------------------------------------------------
+VS_OUTPUT BaseVS(VS_INPUT IN)
+{
+        VS_OUTPUT OUT;
+
+        float3 wPos = mul(World, IN.Position);
+		// world-space view vector        
+		OUT.mView = wCamPos - wPos;
+		// world-space light vector
+		OUT.mLight = wLightPos.xyz - wPos * wLightPos.w;
+
+		OUT.wTangent = normalize(mul(WorldI,float4(IN.Tangent, 1)));
+		OUT.wNormal = normalize(mul(WorldI,float4(IN.Normal, 1)));		
+		OUT.wBinormal = cross(OUT.wTangent, OUT.wNormal);		
+		
+        // vertex position before homogenious division
+        OUT.hPosition = mul(WorldViewProj, IN.Position);
+		// tex coordinates passed to pixel shader
+        OUT.TexCoord = textureRepeat * IN.TexCoord;
+        OUT.TexCoord2 = IN.TexCoord2;
+
+		return OUT;
+}
+
+float4 BumpPS(VS_OUTPUT IN) : COLOR
+{
+	//return tex2D(BumpMapSampler,IN.TexCoord).a;
+	IN.wTangent = normalize(IN.wTangent);
+	IN.wBinormal = normalize(IN.wBinormal);
+	IN.wNormal = normalize(IN.wNormal);
+	// needs normalization because of linear interpolation    
+    float3 mLight = normalize( IN.mLight );
+    float3 mView = normalize( IN.mView );
+ 
+    // get model space normal vector
+	float3x3 ModelToTangent = TransfModelToTangent(IN.wTangent, IN.wBinormal, IN.wNormal );
+    // get model space normal vector
+    float3 tNormal = tex2D(BumpMapSampler, IN.TexCoord).rgb;
+	// Normal vector should be transformed with the inverse transpose of TangentToModel
+	// which is the transpose of ModelToTangent
+    float3 mNormal = normalize( mul( tNormal, ModelToTangent ) ); 
+	// illumination calculation
+    return Illumination(mLight, mNormal, mView, IN.TexCoord, IN.TexCoord2);
+    
+}
Index: GTP/trunk/App/Demos/Illum/Ogre/Media/Demo/parallax.hlsl
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/Media/Demo/parallax.hlsl	(revision 2152)
+++ GTP/trunk/App/Demos/Illum/Ogre/Media/Demo/parallax.hlsl	(revision 2152)
@@ -0,0 +1,94 @@
+uniform float textureRepeat;
+uniform sampler2D ColorMapSampler : register(s0);
+uniform sampler2D DetailMapSampler   : register(s1);
+uniform sampler2D BumpMapSampler  : register(s2);
+#define PARALLAX_ITERATION 4
+uniform float HEIGHT_SCALE;
+uniform float HEIGHT_BIAS;
+
+float3x3 TransfModelToTangent( in  float3 Tangent, in float3 Binormal, in float3 Normal ) {
+	float T2 = dot(Tangent, Tangent);
+	float B2 = dot(Binormal, Binormal);
+	float N2 = dot(Normal, Normal);
+	float BT = dot(Binormal, Tangent);
+	float det = B2 * T2 - BT * BT;
+
+	return float3x3( (B2 * Tangent - BT * Binormal)/det, 
+	                 (T2 * Binormal - BT * Tangent)/det, 
+	                 Normal/N2 );
+/*		                               		
+	// simplified solution
+	return float3x3(Tangent/T2, Binormal/B2, Normal/N2); 
+*/
+}
+
+float4 Illumination(float3 Light, float3 Normal, float3 View, float2 TexCoord, float2 TexCoord2)
+{
+	// Blinn lighting
+	float3 Half = normalize(Light + View);
+	float Diffuse = dot(Normal, Light);
+	float Specular = dot(Normal, Half);
+	float4 Lighting = lit(Diffuse, Specular, 16);
+	float4 Color= tex2D(ColorMapSampler, TexCoord) * tex2D(DetailMapSampler, TexCoord2);
+
+	return (Lighting.y + 0.1) * Color;
+}
+
+struct VS_OUTPUT {
+    float4 hPosition : POSITION;     // point in normalized device space before homogeneous division
+    float2 TexCoord  : TEXCOORD0;    // texture coordinates
+    float2 TexCoord2  : TEXCOORD6;    // texture coordinates
+    float3 mView     : TEXCOORD1;    // model space view vector
+    float3 mLight    : TEXCOORD2;    // model space light vector
+    float3 wTangent   : TEXCOORD3;	 // model space tangent vector
+    float3 wBinormal  : TEXCOORD4;	 // model space binormal vector
+    float3 wNormal    : TEXCOORD5;	 // model space triangle normal vector
+};
+
+void DISCARD_BY_TEX(float2 Tex)
+{
+	if (Tex.x > textureRepeat || Tex.x < 0 || Tex.y > textureRepeat || Tex.y < 0)
+		discard;
+}
+
+float2 PARALLAX_MAPPING_ITER(sampler2D heightMap, float3 TexCoord, float3 View)
+{
+    for(int i = 0; i < PARALLAX_ITERATION; i++) {
+		float4 Normal = tex2D(heightMap, TexCoord);
+		float h = Normal.a * HEIGHT_SCALE + HEIGHT_BIAS;
+		TexCoord += (h - TexCoord.z) * Normal.z * View;
+	}
+	return TexCoord.xy;
+}
+
+//------------------------------------------------------------------------------------
+//
+// ParallaxSlopeIterationPS: Iterative Parallax Mapping with Slope pixel shader
+//
+//------------------------------------------------------------------------------------
+float4 ParallaxSlopeIterationPS(VS_OUTPUT IN) : COLOR
+{
+	//return tex2D(BumpMapSampler,IN.TexCoord).a;
+	IN.wTangent = normalize(IN.wTangent);
+	IN.wBinormal = normalize(IN.wBinormal);
+	IN.wNormal = normalize(IN.wNormal);
+	// get model space normal vector
+	float3x3 ModelToTangent = TransfModelToTangent(IN.wTangent, IN.wBinormal, IN.wNormal );
+	// needs normalization because of linear interpolation    
+    float3 mLight = normalize( IN.mLight );
+    float3 mView = normalize( IN.mView );
+ 	float3 tView = normalize( mul(ModelToTangent, IN.mView ) );
+     
+    // performing parallax mapping
+    float2 ParallaxTex = PARALLAX_MAPPING_ITER(BumpMapSampler, float3(IN.TexCoord, 0), tView);
+	DISCARD_BY_TEX(ParallaxTex);
+	
+    // get model space normal vector
+    float3 tNormal = tex2D(BumpMapSampler, ParallaxTex).rgb;
+	// Normal vector should be transformed with the inverse transpose of TangentToModel
+	// which is the transpose of ModelToTangent
+    float3 mNormal = normalize( mul( tNormal, ModelToTangent ) ); 
+	//mNormal = normalize(IN.wNormal);
+    // illumination calculation
+    return Illumination(mLight, mNormal, mView, ParallaxTex, IN.TexCoord2);
+}
Index: GTP/trunk/App/Demos/Illum/Ogre/Media/Demo/tower.material
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/Media/Demo/tower.material	(revision 2152)
+++ GTP/trunk/App/Demos/Illum/Ogre/Media/Demo/tower.material	(revision 2152)
@@ -0,0 +1,70 @@
+vertex_program GTP/Demo/BumpMapped_VS hlsl
+{
+   source bump.hlsl
+   entry_point BaseVS
+   target vs_2_0
+}
+
+fragment_program GTP/Demo/BumpMapped_PS hlsl
+{
+   source bump.hlsl
+   entry_point BumpPS
+   target ps_2_0
+}
+
+fragment_program GTP/Demo/ParallaxMapped_PS hlsl
+{
+   source parallax.hlsl
+   entry_point ParallaxSlopeIterationPS
+   target ps_3_0
+}
+
+material towermaterial
+{
+	technique
+	{
+	    pass
+		{
+			lighing off
+			ambient 1 1 1 1
+			diffuse 1 1 1 1
+			specular 0 0 0 0
+			emissive 0 0 0
+			
+			vertex_program_ref GTP/Demo/BumpMapped_VS
+   			{
+   			  param_named_auto WorldViewProj worldviewproj_matrix  
+   			  param_named_auto World world_matrix
+   			  param_named_auto WorldI inverse_world_matrix
+   			  param_named_auto wLightPos light_position 0
+   			  param_named_auto wCamPos camera_position
+   			  param_named textureRepeat float 6
+  			} 
+  			fragment_program_ref GTP/Demo/ParallaxMapped_PS
+  			{
+  			 param_named HEIGHT_SCALE float 0.16
+  			 param_named HEIGHT_BIAS float -0.04
+  			 param_named textureRepeat float 6
+   			}
+			texture_unit
+			{
+			 texture stone.bmp
+			 tex_coord_set 0
+			 colour_op replace
+			}
+			texture_unit
+			{
+			 texture towerwall.bmp
+			 tex_coord_set 1
+			 colour_op modulate
+			}
+			texture_unit
+			{
+			 texture stoneNormal.dds
+			 tex_coord_set 0
+			}
+			
+		}
+	
+	}
+}
