//
// Generated by Microsoft (R) D3DX9 Shader Compiler 9.08.299.0000
//
//   vsa shaderdump19/SLS2001.vso /Fcshaderdump19/SLS2001.vso.dis
//
//
// Parameters:
//
float3 FogColor : register(c24);
float4 FogParam : register(c23);
float4 HighDetailRange : register(c12);
float4 LODLandFlags : register(c47);
float3 LightDirection[3] : register(c13);
row_major float4x4 ModelViewProj : register(c0);
row_major float4x4 ObjToCubeSpace : register(c8);
//
//
// Registers:
//
//   Name            Reg   Size
//   --------------- ----- ----
//   ModelViewProj[0]   const_0        1
//   ModelViewProj[1]   const_1        1
//   ModelViewProj[2]   const_2        1
//   ModelViewProj[3]   const_3        1
//   ObjToCubeSpace[0]  const_8        1
//   ObjToCubeSpace[1]  const_9        1
//   HighDetailRange const_12      1
//   LightDirection[0]  const_13       1
//   FogParam        const_23      1
//   FogColor        const_24      1
//   LODLandFlags    const_47      1
//


// Structures:

struct VS_INPUT {
    float4 position : POSITION;
    float4 texcoord_0 : TEXCOORD0;
};

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

// Code:

VS_OUTPUT main(VS_INPUT IN) {
    VS_OUTPUT OUT;

#define	weight(v)		dot(v, 1)
#define	sqr(v)			((v) * (v))

    const float4 const_4 = {-1, -2048, 0.6, 0};

    float3 mdl24;
    float1 q0;
    float1 q1;
    float1 q2;
    float1 q3;
    float4 r0;
    float4 r1;
    float2 r2;

    r1.xzw = const_4.xzw;
    q2.x = r1.x + LODLandFlags.y;
    r2.xy = r1.z * HighDetailRange.zw;
    q1.x = abs(dot(ObjToCubeSpace[1].xyzw, IN.position.xyzw) - HighDetailRange.y);
    q0.x = abs(dot(ObjToCubeSpace[0].xyzw, IN.position.xyzw) - HighDetailRange.x);
    r0.xyw = IN.position.xyw;
    q3.x = (q0.x < HighDetailRange.z ? (q1.x < HighDetailRange.w ? 1.0 : 0.0) : 0) * (sqr(q2.x) == 0 ? 1.0 : 0.0);
    r0.z = IN.position.z - (q3.x * 2048);
    mdl24.xyz = mul(float3x4(ModelViewProj[0].xyzw, ModelViewProj[1].xyzw, ModelViewProj[2].xyzw), r0.xyzw);
    OUT.color_1.rgb = FogColor.rgb;
    OUT.color_1.a = 1 - saturate((FogParam.x - length(mdl24.xyz)) / FogParam.y);
    OUT.position.w = dot(ModelViewProj[3].xyzw, r0.xyzw);
    OUT.position.xyz = mdl24.xyz;
    OUT.texcoord_0.xy = IN.texcoord_0.xy;
    OUT.texcoord_1.xyz = LightDirection[0].xyz;
    OUT.texcoord_7.x = (r1.w < LODLandFlags.x ? (q0.x < r2.x ? (q1.x < r2.y ? 1.0 : 0.0) : 0) : 0);
    OUT.texcoord_7.y = 0;

    return OUT;
};

// approximately 40 instruction slots used
