Index: GTP/trunk/App/Games/CarDriving_BME/Media/materials/programs/GameTools_Localized_EnvMap.hlsl
===================================================================
--- GTP/trunk/App/Games/CarDriving_BME/Media/materials/programs/GameTools_Localized_EnvMap.hlsl	(revision 1049)
+++ GTP/trunk/App/Games/CarDriving_BME/Media/materials/programs/GameTools_Localized_EnvMap.hlsl	(revision 2451)
@@ -1,2 +1,5 @@
+//#define EFFECTS
+//#define LOCALIZATION
+
 //metal:
 float3 n, k;	// R 700 nm, G 550 nm, B 435 nm 
@@ -160,11 +163,17 @@
 	float3 mPos = wPos - lastCenter;
 	float3 V = normalize(wPos - cameraPos);
+
 	float3 R = normalize(reflect( V, mNormal));
 		
+#ifdef EFFECTS
 	newTexCoord = R;	
-	
+#ifdef LOCALIZATION
 	newTexCoord = Hit(mPos, R, DistanceMap);
+#endif
 	Color = readCubeMap(CubeMap, newTexCoord );
-	
+#else
+	Color = 1;	
+#endif
+
 	//Color = float4(mNormal + lastCenter.x*0.0000001, 1);	
 	
@@ -185,6 +194,5 @@
 	}	
 	
-	Color = Color * float4(F,1);
-	
+	Color = Color * float4(F,1);	
 	//Color = length(lastCenter.xyz) * 0.1;
 }
Index: GTP/trunk/App/Games/CarDriving_BME/Media/materials/programs/bottle.hlsl
===================================================================
--- GTP/trunk/App/Games/CarDriving_BME/Media/materials/programs/bottle.hlsl	(revision 1049)
+++ GTP/trunk/App/Games/CarDriving_BME/Media/materials/programs/bottle.hlsl	(revision 2451)
@@ -1,2 +1,5 @@
+//#define EFFECT
+//#define LOCALIZATION
+
 float4 readCubeMap(samplerCUBE cm, float3 coord)		
 {
@@ -50,10 +53,10 @@
 		uniform float4x4 worldViewProj,
 		uniform float4x4 world,
-		uniform float4x4 worldIT)
+		uniform float4x4 worldI)
 {
  
   hPos = mul(worldViewProj, position);
   wPos = mul(world, position).xyz;  
-  mNormal = mul(normal, worldIT);
+  mNormal = mul(normal, worldI);
  // mNormal = normal;
   otexCoord = texCoord;
@@ -81,5 +84,7 @@
 	float3 mPos = wPos - lastCenter;
 	float3 V = normalize(wPos - cameraPos);
-	float3 R = normalize(reflect( V, mNormal));
+
+#ifdef EFFECT
+		float3 R = normalize(reflect( V, mNormal));
 	
 	float3 T =  normalize(refract(V, mNormal, 0.9));
@@ -87,6 +92,8 @@
 	RR = R;	TT = T;	
 	
+	#ifdef LOCALIZATION
 	RR = Hit(mPos, R, DistanceMap);
 	TT = Hit(mPos, T, DistanceMap);
+	#endif
 	
 	float4 reflectcolor = readCubeMap(CubeMap, RR );		
@@ -98,5 +105,7 @@
 
 	Color = (F * reflectcolor + (1-F) * refractcolor * float4(color,1)) ;
-	
+#else
+	Color = float4(color, 1);
+#endif
 	half3 light = lightPosition; 
 	V = -V;
Index: GTP/trunk/App/Games/CarDriving_BME/Media/materials/programs/CarReflections.hlsl
===================================================================
--- GTP/trunk/App/Games/CarDriving_BME/Media/materials/programs/CarReflections.hlsl	(revision 1049)
+++ GTP/trunk/App/Games/CarDriving_BME/Media/materials/programs/CarReflections.hlsl	(revision 2451)
@@ -1,2 +1,5 @@
+//#define EFFECTS
+//#define LOCALIZATION
+
 float3 F0;
 
@@ -52,10 +55,10 @@
 		uniform float4x4 worldViewProj,
 		uniform float4x4 world,
-		uniform float4x4 worldIT)
+		uniform float4x4 worldI)
 {
  
   hPos = mul(worldViewProj, position);
   wPos = mul(world, position).xyz;  
-  mNormal = mul(normal, worldIT);
+  mNormal = mul(normal, worldI);
   //mNormal *=-1;
  //mNormal = normal;  
@@ -84,9 +87,12 @@
 	float3 mPos = wPos - lastCenter;
 	float3 V = normalize(wPos - cameraPos);
+
+#ifdef EFFECTS
 	float3 R = normalize(reflect( V, mNormal));
 		
 	newTexCoord = R;	
-	
+#ifdef LOCALIZATION	
 	newTexCoord = Hit(mPos, R, DistanceMap);
+#endif
 	Color = readCubeMap(CubeMap, newTexCoord );	
 	
@@ -107,5 +113,5 @@
 	Color = Color * float4(F,1);
 	
-	
+#endif	
 //phong
 	
@@ -135,4 +141,5 @@
 	Color = float4(1,1,1,1);
 
+#ifdef EFFECTS
 	//metallic reflection	
 	mNormal = normalize(mNormal);
@@ -144,7 +151,9 @@
 		
 	newTexCoord = R;	
-	
+#ifdef LOCALIZATION	
 	newTexCoord = Hit(mPos, R, DistanceMap);
+#endif
 	Color = readCubeMap(CubeMap, newTexCoord );		
+#endif
 	
 }
@@ -163,4 +172,5 @@
 	Color = float4(1,1,1,1);
 
+#ifdef EFFECTS
 	//metallic reflection	
 	mNormal = normalize(mNormal);
@@ -172,8 +182,10 @@
 		
 	newTexCoord = R;	
-	
+#ifdef LOCALIZATION
 	newTexCoord = Hit(mPos, R, DistanceMap);
+#endif
 	Color = readCubeMap(CubeMap, newTexCoord );
 	Color.a = 1;
+#endif
 	Color *= glasColor;		
 	
Index: GTP/trunk/App/Games/CarDriving_BME/Media/materials/programs/DiffuseBump.hlsl
===================================================================
--- GTP/trunk/App/Games/CarDriving_BME/Media/materials/programs/DiffuseBump.hlsl	(revision 1049)
+++ GTP/trunk/App/Games/CarDriving_BME/Media/materials/programs/DiffuseBump.hlsl	(revision 2451)
@@ -1,3 +1,5 @@
-float4x4 world_IT;
+//#define EFFECTS
+
+float4x4 world_I;
 int REDUCED_CUBEMAP_SIZE = 8;
 
@@ -105,8 +107,7 @@
   hPos = mul(worldViewProj, position);
   wPos = mul(world, position).xyz;  
-  //mNormal = mul(normal, world_IT);
-  mNormal = normal;
+  mNormal = normalize(mul(normal, world_I));
   otexCoord = texCoord;
-  Tangent = tangent;  
+  Tangent = normalize(mul(tangent, world_I));  
   Binormal = cross(tangent, normal); 
 }
@@ -119,5 +120,5 @@
            uniform float3 cameraPos,
            uniform float3 lastCenter,
-           uniform half3 lightPosition,				
+           uniform half4 lightPosition,				
            uniform samplerCUBE SmallEnvMapSampler : register(s0),
            uniform samplerCUBE DistanceEnvMapSampler : register(s1),
@@ -128,4 +129,7 @@
     REDUCED_CUBEMAP_SIZE = 4;
 	
+    Tangent = normalize(Tangent);
+    N = normalize(N);
+    Binormal = normalize(Binormal);
     //V = /*-*/normalize( V );
     float3 V = normalize(pos - cameraPos);	// 
@@ -134,7 +138,5 @@
 	half3 tNormal = tex2D(NormalMap, Tex).rgb;     	
       
-    N =mul(tNormal, ModelToTangent );
-    N = mul( N, world_IT );
-    N = normalize(N);
+    N = normalize(mul(tNormal, ModelToTangent ));
     
     float3 R = reflect(V, N);
@@ -143,5 +145,5 @@
     float4 intens = 0;
     
-	
+#ifdef EFFECTS	
 	for (int x = 0; x < REDUCED_CUBEMAP_SIZE; x++)			// az envmap minden texelére
 	 for (int y = 0; y < REDUCED_CUBEMAP_SIZE; y++)
@@ -178,16 +180,23 @@
 		intens += GetContibution( L, pos, N, V, SmallEnvMapSampler, DistanceEnvMapSampler);
 	}
-	
-	half3 light = lightPosition;
+
+#endif	
+	half3 light = lightPosition.xyz;
 	half3 L = normalize(light);
-	half3 H = normalize(L + V);
+	half3 H = normalize(L - V);
 	half4 lighting = lit(dot(N, L),dot(N, H), 20);
 
 	float4 retColor = intens;
 	float4 texColor = tex2D(ColorTexture, Tex);
-	retColor = intens * texColor * 1.5
+#ifdef EFFECTS	
+	
+		retColor = intens * texColor * 1.5
 			  + lighting.y * texColor * 0.15 
 			  + lighting.z * 0.15			
 			 ;
+#else
+retColor =lighting.y * texColor
+			  + lighting.z;
+#endif
 	return retColor;
 }
