//
// Generated by Microsoft (R) D3DX9 Shader Compiler 9.08.299.0000
//
// Parameters:

row_major float4x4 ModelViewProj : register(c0);
float3 LightDirection[3] : register(c13);
float4 FogParam : register(c23);
float3 FogColor : register(c24);
float4 WindMatrices[16] : register(c38);
row_major float4x4 TESR_ShadowCameraToLightTransform[2] : register(c54);

// Registers:
//
//   Name           Reg   Size
//   -------------- ----- ----
//   ModelViewProj[0]  const_0        1
//   ModelViewProj[1]  const_1        1
//   ModelViewProj[2]  const_2        1
//   ModelViewProj[3]  const_3        1
//   LightDirection[0] const_13       1
//   FogParam       const_23      1
//   FogColor       const_24      1
//   WindMatrices[0]   const_38      4
//   WindMatrices[1]   const_39      4
//   WindMatrices[2]   const_40      4
//   WindMatrices[3]   const_41      4
//


// Structures:

struct VS_INPUT {
    float4 LPOSITION : POSITION;
    float3 LTANGENT : TANGENT;
    float3 LBINORMAL : BINORMAL;
    float3 LNORMAL : NORMAL;
    float4 LTEXCOORD_0 : TEXCOORD0;
    float4 LBLENDINDICES : BLENDINDICES;
};

struct VS_OUTPUT {
    float4 color_0 : COLOR0;
    float4 color_1 : COLOR1;
    float4 position : POSITION;
    float2 texcoord_0 : TEXCOORD0;
    float3 texcoord_1 : TEXCOORD1;
	float4 texcoord_6 : TEXCOORD6;
    float4 texcoord_7 : TEXCOORD7;
};

// Code:

VS_OUTPUT main(VS_INPUT IN) {
    VS_OUTPUT OUT;

    const int4 const_4 = {1, 0, 0, 0};

    float4 r0;
    float1 q0;
    float3 q11;
    float4 q2;
    float4 q3;

    q11.xyz = mul(float3x3(IN.LTANGENT.xyz, IN.LBINORMAL.xyz, IN.LNORMAL.xyz), LightDirection[0].xyz);
    q0.x = IN.LBLENDINDICES.y;
    q2.xyzw = mul(float4x4(WindMatrices[0 + q0.x].xyzw, WindMatrices[1 + q0.x].xyzw, WindMatrices[2 + q0.x].xyzw, WindMatrices[3 + q0.x].xyzw), IN.LPOSITION.xyzw);
	q3.xyzw = (IN.LBLENDINDICES.x * (q2.xyzw - IN.LPOSITION.xyzw)) + IN.LPOSITION.xyzw;
	r0.xyzw = mul(ModelViewProj, q3.xyzw);
    OUT.color_0.rgba = (IN.LBLENDINDICES.z * const_4.xxxy) + const_4.yyyx;
    OUT.color_1.a = 1 - saturate((FogParam.x - length(r0.xyz)) / FogParam.y);
    OUT.color_1.rgb = FogColor.rgb;
    OUT.position.xyzw = r0.xyzw;
    OUT.texcoord_0.xy = IN.LTEXCOORD_0.xy;
    OUT.texcoord_1.xyz = normalize(q11.xyz);
    OUT.texcoord_6 = mul(r0.xyzw, TESR_ShadowCameraToLightTransform[0]);
	OUT.texcoord_7 = mul(r0.xyzw, TESR_ShadowCameraToLightTransform[1]);
    return OUT;
	
};

// approximately 34 instruction slots used