Index: /GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPEnvMap/GTPEnvMap.hlsl
===================================================================
--- /GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPEnvMap/GTPEnvMap.hlsl	(revision 2404)
+++ /GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPEnvMap/GTPEnvMap.hlsl	(revision 2409)
@@ -128,5 +128,5 @@
 	RR = R;	
 	RR = Hit(cubePos, R, DistanceMap);
-	Color = readCubeMap(CubeMap, R);
+	Color = readCubeMap(CubeMap, RR);
 	//Color = readDistanceCubeMap(DistanceMap, cubePos)/300.0;
 	//return Color;
Index: /GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPPathMap/PathMapWeightCompute.hlsl
===================================================================
--- /GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPPathMap/PathMapWeightCompute.hlsl	(revision 2403)
+++ /GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPPathMap/PathMapWeightCompute.hlsl	(revision 2409)
@@ -34,5 +34,6 @@
     output.tex = (input.pos + 1.0) / 2.0;
     //output.tex = input.tex;
-    output.tex.y = 1.0 - output.tex.y;
+   // output.tex.y = 1.0 - output.tex.y;
+    input.pos.y *= -1;
    
     return output;
@@ -44,9 +45,11 @@
 {
 	float dataColumnWidth = 1.0 / (float)nRadionColumns;
-	int bushIndex = input.tex.x * 4096 + input.tex.y * nRadionColumns * 4096;
+	/*int bushIndex = input.tex.x * 4096 + input.tex.y * nRadionColumns * 4096;
 	int werx = bushIndex % nRadionColumns;
 	int wery = bushIndex / nRadionColumns;
 	float3 pos = tex2D(radionSampler, float2((werx + 0.25) * dataColumnWidth, (wery  + 0.5) / 4096.0) ).xyz;
-	float3 dir = tex2D(radionSampler, float2((werx + 0.75) * dataColumnWidth, (wery  + 0.5) / 4096.0) ).xyz;
+	float3 dir = tex2D(radionSampler, float2((werx + 0.75) * dataColumnWidth, (wery  + 0.5) / 4096.0) ).xyz;*/
+	float3 pos = tex2D(radionSampler, float2(input.tex.x + 0.25 * dataColumnWidth, input.tex.y  + 0.5 / 4096.0) ).xyz;
+	float3 dir = tex2D(radionSampler, float2(input.tex.x + 0.75 * dataColumnWidth, input.tex.y  + 0.5 / 4096.0) ).xyz;
 	dir = normalize(dir);
 	
@@ -60,10 +63,10 @@
 	float4 lightVPos = mul(lightViewProj, float4(pos,1));
 		
-  	//if( lightVPos.z  > 0.0)
-  	//{	
+  	if( lightVPos.z  > 0.0)
+  	{	
     	lightVPos /= lightVPos.w;
-  		//float d = length(lightVPos.xy);
+  		float d = length(lightVPos.xy);
    		
-  		//if(d <= 1.0)
+  		if(d <= 1.0)
     	{
 			float dist = dist / lightFarPlane;
@@ -73,15 +76,15 @@
 			visibility = dist < storedDist + DIST_BIAS;
 		}
-   // }
+    }
     //visibility = 1.0 - visibility;
-    visibility = 1.0 + 0.00001 * visibility;
-	float spotFalloff = (dot(-diff, normalize(lightDir)) - lightAngleCos) / (1.0 - lightAngleCos);
-	//spotFalloff = saturate(dot(normalize(pos - lightPos), normalize(lightDir))) + 0.0000000001 * lightAngleCos;
-	spotFalloff = 1.0 + spotFalloff * 0.000000001;
+    //visibility = 1.0 + 0.00001 * visibility;
+	//float spotFalloff = (dot(-diff, lightDir) - lightAngleCos) / (1.0 - lightAngleCos);
+	float spotFalloff = max( dot(-diff, lightDir), 0) + 0.0000000001 * lightAngleCos;
+	//spotFalloff = 1.0 + spotFalloff * 0.000000001;
 	spotFalloff = pow(saturate(spotFalloff), spotLightFalloff);
 		
 	visibility *= spotFalloff / (lightAttenuation.y + dist * lightAttenuation.z + dist2 * lightAttenuation.w);
 	
-	float4 ret = visibility * cosb * lightPower * lightColor;
+	float4 ret = visibility * cosb  *  lightPower * lightColor;
 	return ret;
 }
@@ -113,5 +116,5 @@
 	visibility = (distNorm <= storedDist);
 	  
-	//visibility = 1.0 + 0.00001 * visibility;		
+	visibility = 1.0 + 0.00001 * visibility;		
 	visibility *=  1.0 / (lightAttenuation.y + dist * lightAttenuation.z + dist * dist * lightAttenuation.w);
 	
Index: /GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPPathMap/PathMap.hlsl
===================================================================
--- /GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPPathMap/PathMap.hlsl	(revision 2403)
+++ /GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPPathMap/PathMap.hlsl	(revision 2409)
@@ -44,5 +44,5 @@
 		float2 prmTexPos = float2(
 			(texAtlas.x + (iCluster % prmAtlasTiles.x)) / prmAtlasTiles.x,
-			1.0 - (texAtlas.y + (iCluster / prmAtlasTiles.x)) / prmAtlasTiles.y);// + atlasHalfPixel;
+			1.0 - (texAtlas.y + (iCluster / prmAtlasTiles.x)) / prmAtlasTiles.y) + atlasHalfPixel;
 
 		float weightIndex = tex2D(clusterWeightIndexSampler, float2(((float)iCluster + 0.5) / clusterCount, 0.5)).r;
Index: /GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPBasic/GTPBasicShading.hlsl
===================================================================
--- /GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPBasic/GTPBasicShading.hlsl	(revision 2404)
+++ /GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPBasic/GTPBasicShading.hlsl	(revision 2409)
@@ -59,6 +59,6 @@
 	float cosb = max(dot(IN.wNormal.xyz, diff), 0);
 	
-	//color.rgb += pow(cosa, 9) * cosb / dist2 * lightPower1 * lightColor1;
-	color.rgb += cosb / dist2 * lightPower1 * lightColor1;
+	color.rgb += pow(cosa, 9) * cosb / dist2 * lightPower1 * lightColor1;
+	//color.rgb += cosb / dist2 * lightPower1 * lightColor1;
 	
 	}
Index: /GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/trollvs.cg
===================================================================
--- /GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/trollvs.cg	(revision 2404)
+++ /GTP/trunk/App/Demos/Illum/Ogre/Media/MORIA/trollvs.cg	(revision 2409)
@@ -27,5 +27,6 @@
 	oPosition = mul(viewProjectionMatrix, blendPos);
 	// transform normal
-	//oNormal = mul((float3x3)worldMatrix3x4Array[blendIdx], normal);
+	oNormal = mul((float3x3)worldMatrix3x4Array[blendIdx[0]], normal) * blendWgt[0];
+	oNormal += mul((float3x3)worldMatrix3x4Array[blendIdx[1]], normal) * blendWgt[1];
 	//oTangent = mul((float3x3)worldMatrix3x4Array[blendIdx], tangent);
 	oNormal = normalize(oNormal);
