//
// Bump road fragment shader
//

float3 expand(float3 v) { return (v-0.5)*2; }

void main(float2 normalMapTexCoord : TEXCOORD0,
          float3 lightDir          : TEXCOORD1,
		  float3 tangent           : COLOR,
          uniform sampler2D normalMap : TEXUNIT0,

             out float4 outColor : COLOR

//              uniform sampler2D   normalMap : TEXUNIT0,
//            uniform samplerCUBE normalizeCube)
              )
{
  // Normalizes light vector with normalization cube map
//  float3 lightTex = texCUBE(normalizeCube, lightDir).xyz;
//  float3 light = expand(lightTex);
  // Normalize using function
  float3 light = normalize(lightDir);
  // Sample and expand the normal map texture	
  float3 normalTex = tex2D(normalMap, normalMapTexCoord).xyz;
  float3 normal = expand(normalTex);
  // Diffuse lighting
  float brightNess=dot(normal,light);
//  color = dot(normal,light);
//  color=brightNess;
//  color.rgb=normal.xyz;
//  color.rgb=light.xyz;
  outColor=float4(tangent.xyz,1);
}
