//
// 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
// {
//
//   struct
//   {
//       
//       float4 vDesc;                  // Offset:    0
//       float4 vFogLayerPlane;         // Offset:   16
//       float4 vFogLayerColor;         // Offset:   32
//       float4 vFogLayerSettings;      // Offset:   48
//       float4 vFogColor;              // Offset:   64
//       float4 vFogDistance;           // Offset:   80
//
//   } g_FogDesc;                       // Offset:    0 Size:    96
//   float4 g_vAmbient;                 // Offset:   96 Size:    16 [unused]
//   float4 g_vLightColor;              // Offset:  112 Size:    16 [unused]
//   float3 g_vLightDir;                // Offset:  128 Size:    12
//   float4x4 g_mCloudsShadowsSpace;    // Offset:  144 Size:    64 [unused]
//   float4 g_vCloudsShadowDesc;        // Offset:  208 Size:    16 [unused]
//   float4 g_vCamPos;                  // Offset:  224 Size:    16
//   float4 g_vCenter;                  // Offset:  240 Size:    16
//   float4x4 g_mViewProj;              // Offset:  256 Size:    64
//   float4 g_vSettings0;               // Offset:  320 Size:    16
//   float4 g_vSettings1;               // Offset:  336 Size:    16
//   float4 g_vSettings2;               // Offset:  352 Size:    16
//   float4 g_vScreenRect;              // Offset:  368 Size:    16 [unused]
//   float3 g_vPlaneN;                  // Offset:  384 Size:    12 [unused]
//   float4x4 g_mIWorld;                // Offset:  400 Size:    64
//
// }
//
//
// 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 
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float   xyzw
// TEXCOORD                 0   xyzw        1     NONE   float   xyzw
// TEXCOORD                 1   xyz         2     NONE   float   xyz 
// TEXCOORD                 2   xyz         3     NONE   float   xyz 
// TEXCOORD                 3   xyzw        4     NONE   float   xyzw
// TEXCOORD                 4   xyzw        5     NONE   float   xyzw
// TEXCOORD                 5   xyzw        6     NONE   float   xyzw
// TEXCOORD                 6   xyzw        7     NONE   float   xyzw
// TEXCOORD                 7   xyz         8     NONE   float   xyz 
// TEXCOORD                 8   xyz         9     NONE   float   xyz 
// SV_ClipDistance          0   x          10  CLIPDST   float   x   
// SV_ClipDistance          1    y         10  CLIPDST   float    y  
//
vs_4_0
dcl_constantbuffer cb0[28], immediateIndexed
dcl_input v0.xyz
dcl_output_siv o0.xyzw, position
dcl_output o1.xyzw
dcl_output o2.xyz
dcl_output o3.xyz
dcl_output o4.xyzw
dcl_output o5.xyzw
dcl_output o6.xyzw
dcl_output o7.xyzw
dcl_output o8.xyz
dcl_output o9.xyz
dcl_output_siv o10.x, clip_distance
dcl_output_siv o10.y, clip_distance
// dcl_temps updated : previous = dcl_temps 6
dcl_temps 9
// added 3dmigoto declaration
dcl_resource_texture1d (float,float,float,float) t120
ld_indexable(texture1d)(float,float,float,float) r7.xyzw, l(0, 0, 0, 0), t120.xyzw
mov r8.x, r7.w
mov r8.y, r7.w
mov r8.zw, l(1.0, 1.0)
// end of 3dmigoto declaration
add r0.x, v0.y, cb0[20].y
div r0.x, r0.x, cb0[20].x
lt r0.y, l(0.500000), cb0[21].z
if_nz r0.y
  add r0.x, -r0.x, l(1.000000)
endif 
mov_sat r0.yz, v0.xxzx
mul r0.yz, r0.yyzy, cb0[22].xxzx
mul r1.y, r0.x, cb0[22].y
mul r1.xz, r0.yyzy, cb0[21].wwww
add r0.xyz, r1.xyzx, cb0[15].xyzx
add r1.xyz, -r0.xyzx, cb0[14].xyzx
dp3 r1.w, r1.xyzx, r1.xyzx
sqrt r1.w, r1.w
div r1.xyz, r1.xyzx, r1.wwww
mov r0.w, l(1.000000)
// replacing matrix usage :dp4 r2.x, r0.xyzw, cb0[16].xyzw
dp4 r6.x, r0.xyzw, cb0[16].xyzw
mul r2.x, r6.x, r8.x
// replacing matrix usage :dp4 r2.y, r0.xyzw, cb0[17].xyzw
dp4 r6.y, r0.xyzw, cb0[17].xyzw
mul r2.y, r6.y, r8.y
dp4 r2.z, r0.xyzw, cb0[18].xyzw
dp4 r2.w, r0.xyzw, cb0[19].xyzw
dp4 r3.x, r0.xyzw, cb0[25].xyzw
dp4 r3.y, r0.xyzw, cb0[26].xyzw
dp4 r0.w, r0.xyzw, cb0[27].xyzw
div o1.z, r3.y, cb0[21].y
mul r4.xyz, r2.xwyx, l(0.500000, 0.500000, -0.500000, 0.000000)
add o6.xy, r4.yyyy, r4.xzxx
mul r1.w, r1.w, cb0[5].x
min r1.w, r1.w, l(1.000000)
dp3 r3.z, cb0[4].xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
lt r3.z, l(0.001000), r3.z
lt r3.w, r1.w, cb0[0].x
if_nz r3.w
  mul r3.w, r1.w, cb0[0].y
  div r3.w, r3.w, cb0[0].x
else 
  add r4.xy, -cb0[0].yxyy, l(1.000000, 1.000000, 0.000000, 0.000000)
  add r4.z, r1.w, -cb0[0].x
  mul r4.x, r4.z, r4.x
  div r4.x, r4.x, r4.y
  add r3.w, r4.x, cb0[0].y
endif 
mul r4.xyz, r3.wwww, cb0[4].xyzx
log r4.xyz, r4.xyzx
mul r4.xyz, r4.xyzx, cb0[4].wwww
exp r4.xyz, r4.xyzx
mul r4.xyz, r4.xyzx, l(-1.442695, -1.442695, -1.442695, 0.000000)
exp r4.xyz, r4.xyzx
add r4.xyz, -r4.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
lt r3.w, l(0.800000), r1.w
and r3.z, r3.z, r3.w
if_nz r3.z
  add r1.w, r1.w, l(-0.800000)
  mul r1.w, r1.w, l(5.000000)
  add r5.xyz, -r4.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
  mad r4.xyz, r1.wwww, r5.xyzx, r4.xyzx
endif 
add r1.w, cb0[5].w, l(-0.250000)
add r1.w, r1.w, r1.w
dp3 r3.z, r4.xyzx, l(0.333300, 0.333300, 0.333300, 0.000000)
add r5.xyz, -r4.xyzx, r3.zzzz
mad o5.xyz, r1.wwww, r5.xyzx, r4.xyzx
div r4.y, r0.w, cb0[22].z
div r4.xz, r3.xxyx, cb0[22].xxxx
mul r3.xyz, r4.xyzx, cb0[22].wwww
add o3.xyz, r3.xyzx, r3.xyzx
dp3 r0.w, r1.xyzx, cb0[8].xyzx
lt r1.x, r0.w, l(0.000000)
if_nz r1.x
  mov r1.x, l(0.750000)
else 
  mad r0.w, r0.w, r0.w, l(1.000000)
  mul r1.x, r0.w, l(0.750000)
endif 
mov o0.xyzw, r2.xyzw
mov o1.xy, r4.xyxx
mov o1.w, l(1.000000)
mov o4.x, r1.x
mov o4.yzw, l(0,0,0,1.000000)
mov o5.w, l(0)
mov o6.zw, r2.zzzw
mov o7.xyzw, l(0,0,0,0)
mov o2.xyz, r3.xyzx
mov o8.xyz, r0.xyzx
mov o9.xyz, l(0,0,0,0)
mov o10.xy, l(1.000000,1.000000,0,0)
ret 
// Approximately 86 instruction slots used
