//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
//   using 3Dmigoto v1.2.67 on Mon Jan 01 13:11:46 2018
//
//
// Buffer Definitions: 
//
// cbuffer $Globals
// {
//
//   float4 g_vSkyColor;                // Offset:    0 Size:    16 [unused]
//   float4 g_vFogK;                    // Offset:   16 Size:    16 [unused]
//   float4 Ambient;                    // Offset:   32 Size:    16 [unused]
//   float4 LightColor;                 // Offset:   48 Size:    16 [unused]
//   float3 LightDir;                   // Offset:   64 Size:    12
//   float4 ZNormalsCorrection;         // Offset:   80 Size:    16
//   
//   struct
//   {
//       
//       float4 vDesc;                  // Offset:   96
//       float4 vFogLayerPlane;         // Offset:  112
//       float4 vFogLayerColor;         // Offset:  128
//       float4 vFogLayerSettings;      // Offset:  144
//       float4 vFogColor;              // Offset:  160
//       float4 vFogDistance;           // Offset:  176
//
//   } g_FogDesc;                       // Offset:   96 Size:    96 [unused]
//   float4x4 ViewProj;                 // Offset:  192 Size:    64
//   float4x4 IView;                    // Offset:  256 Size:    64
//   float3 CloudPos;                   // Offset:  320 Size:    12
//   float3 CamPos;                     // Offset:  336 Size:    12
//   float4 Orientation[2];             // Offset:  352 Size:    32
//      = 0x00000000 0x3f800000 0x00000000 0x00000000 
//        0x3f800000 0x00000000 0x00000000 0x3f800000 
//   float4 ImposterData[96];           // Offset:  384 Size:  1536 [unused]
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// $Globals                          cbuffer      NA          NA    0        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyz         0     NONE   float   xyz 
// POSITION                 1   xyz         1     NONE   float   xyz 
// COLOR                    0   xyzw        2     NONE   float   xyz 
// COLOR                    1   xyzw        3     NONE   float   xyzw
// TEXCOORD                 0   xyz         4     NONE   float   xyz 
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float   xyzw
// TEXCOORD                 0   xyz         1     NONE   float   xyz 
// COLOR                    0   xyzw        2     NONE   float   xyzw
// COLOR                    1   xyzw        3     NONE   float   xyzw
//
vs_4_0
dcl_constantbuffer cb0[24], dynamicIndexed
dcl_input v0.xyz
dcl_input v1.xyz
dcl_input v2.xyz
dcl_input v3.xyzw
dcl_input v4.xyz
dcl_output_siv o0.xyzw, position
dcl_output o1.xyz
dcl_output o2.xyzw
dcl_output o3.xyzw
// dcl_temps updated : previous = dcl_temps 5
dcl_temps 8
// added 3dmigoto declaration
dcl_resource_texture1d (float,float,float,float) t120
ld_indexable(texture1d)(float,float,float,float) r6.xyzw, l(0, 0, 0, 0), t120.xyzw
mov r7.x, r6.w
mov r7.y, r6.w
mov r7.zw, l(1.0, 1.0)
// end of 3dmigoto declaration
ftou r0.x, v4.z
// replacing matrix usage :mov r1.z, cb0[17].x
mov r5.z, cb0[17].x
mov r1.x, cb0[18].x
// replacing matrix usage :mov r1.y, cb0[16].x
mov r5.y, cb0[16].x
mul r1.y, r5.y, r7.y
mov r2.y, cb0[18].y
// replacing matrix usage :mov r2.z, cb0[16].y
mov r5.z, cb0[16].y
// replacing matrix usage :mov r2.x, cb0[17].y
mov r5.x, cb0[17].y
mul r2.x, r5.x, r7.x
mul r0.yzw, r1.xxyz, r2.xxyz
mad r0.yzw, r1.zzxy, r2.yyzx, -r0.yyzw
// replacing matrix usage :mov r1.x, cb0[16].z
mov r5.x, cb0[16].z
mul r1.x, r5.x, r7.x
// replacing matrix usage :mov r1.y, cb0[17].z
mov r5.y, cb0[17].z
mul r1.y, r5.y, r7.y
mov r1.z, cb0[18].z
dp3 r0.y, r1.xyzx, r0.yzwy
lt r0.y, l(0.000000), r0.y
if_nz r0.y
  mov r1.xyz, -r1.xyzx
else 
// replacing matrix usage :  mov r1.x, cb0[16].z
mov r5.x, cb0[16].z
mul r1.x, r5.x, r7.x
// replacing matrix usage :  mov r1.y, cb0[17].z
mov r5.y, cb0[17].z
mul r1.y, r5.y, r7.y
  mov r1.z, cb0[18].z
endif 
mul r0.yzw, r1.zzxy, cb0[r0.x + 22].yyzx
mad r0.xyz, r1.yzxy, cb0[r0.x + 22].zxyz, -r0.yzwy
dp3 r0.w, r0.xyzx, r0.xyzx
rsq r0.w, r0.w
mul r0.xyz, r0.wwww, r0.xyzx
mul r2.xyz, r1.yzxy, r0.zxyz
mad r2.xyz, r0.yzxy, r1.zxyz, -r2.xyzx
add r3.xyz, v1.xyzx, cb0[20].xyzx
add r4.xyz, v0.xyzx, v0.xyzx
mul r2.xyz, r2.xyzx, r4.yyyy
mad r0.xyz, r4.xxxx, r0.xyzx, r2.xyzx
mad r0.xyz, r4.zzzz, r1.xyzx, r0.xyzx
add r0.xyz, r3.xyzx, r0.xyzx
mov r0.w, l(1.000000)
dp4 r1.x, r0.xyzw, cb0[15].xyzw
// replacing matrix usage :mov o3.w, |cb0[17].z|
mov r5.w, |cb0[17].z|
mul r1.yzw, cb0[4].yyyy, cb0[17].xxyz
mad r1.yzw, cb0[4].xxxx, cb0[16].xxyz, r1.yyzw
mad r1.yzw, cb0[4].zzzz, cb0[18].xxyz, r1.yyzw
add r1.yzw, r1.yyzw, l(0.000000, 1.000000, 1.000000, 1.000000)
mul r1.yz, r1.yyzy, l(0.000000, 0.500000, 0.500000, 0.000000)
mad r2.x, -r1.w, l(0.500000), l(1.000000)
mad r1.w, r1.w, l(0.500000), -r2.x
mad o3.z, cb0[5].x, r1.w, r2.x
add r2.xyz, r3.xyzx, -cb0[21].xyzx
dp3 r1.w, r2.xyzx, r2.xyzx
rsq r1.w, r1.w
mul r2.xyz, r1.wwww, r2.xyzx
dp3 r1.w, r2.xyzx, cb0[4].xyzx
lt r2.w, r1.w, l(0.000000)
if_nz r2.w
  mov r2.w, l(0.750000)
else 
  mad r1.w, r1.w, r1.w, l(1.000000)
  mul r2.w, r1.w, l(0.750000)
endif 
mul o2.xyz, r2.wwww, v3.xyzx
mad r3.xyz, v2.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
dp3 r1.w, -r2.xyzx, r3.xyzx
max o1.z, r1.w, l(0.000000)
add r1.w, -|r2.y|, l(1.000000)
add r2.x, -r1.w, |r2.y|
mad r1.w, v4.z, r2.x, r1.w
mul r2.x, |r1.x|, l(0.010000)
min r2.x, r2.x, l(1.000000)
mul r2.x, r2.x, v3.w
mul o2.w, r1.w, r2.x
lt r1.w, r1.w, l(0.200000)
if_nz r1.w
  mov o0.xyzw, l(0,0,0,0)
else 
  dp4 o0.x, r0.xyzw, cb0[12].xyzw
  dp4 o0.y, r0.xyzw, cb0[13].xyzw
  dp4 o0.z, r0.xyzw, cb0[14].xyzw
  mov o0.w, r1.x
endif 
mov o3.xy, r1.yzyy
mov o1.xy, v4.xyxx
ret 
// Approximately 80 instruction slots used
