//
// 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
//   float4 g_vLightColor;              // Offset:  112 Size:    16
//   float3 g_vLightDir;                // Offset:  128 Size:    12
//   float4x4 g_mCloudsShadowsSpace;    // Offset:  144 Size:    64
//   float4 g_vCloudsShadowDesc;        // Offset:  208 Size:    16
//   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
//   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   xyzw        0     NONE   float   xyzw
//
//
// 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.xyzw
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 8
dcl_temps 11
// added 3dmigoto declaration
dcl_resource_texture1d (float,float,float,float) t120
ld_indexable(texture1d)(float,float,float,float) r9.xyzw, l(0, 0, 0, 0), t120.xyzw
mov r10.x, r9.w
mov r10.y, r9.w
mov r10.zw, l(1.0, 1.0)
// end of 3dmigoto declaration
add r0.x, v0.w, cb0[20].y
add r0.x, -r0.x, cb0[20].x
div r0.x, r0.x, cb0[20].x
add r0.y, -cb0[20].z, cb0[20].w
mul r0.z, r0.y, r0.x
mad r0.x, r0.x, r0.y, cb0[20].z
add r0.w, cb0[20].z, cb0[21].z
lt r0.w, r0.x, r0.w
if_nz r0.w
  div r1.y, r0.z, cb0[21].z
else 
  add r0.w, cb0[20].w, -cb0[21].z
  lt r0.w, r0.w, r0.x
  if_nz r0.w
    add r0.w, -r0.x, cb0[20].w
    div r1.y, r0.w, cb0[21].z
  else 
    mov r1.y, l(1.000000)
  endif 
endif 
mad r2.xyz, v0.xyzx, r0.xxxx, cb0[15].xyzx
add r3.xyz, -r2.xyzx, cb0[14].xyzx
dp3 r0.x, r3.xyzx, r3.xyzx
sqrt r0.x, r0.x
div r3.xyz, r3.xyzx, r0.xxxx
mov r2.w, l(1.000000)
// replacing matrix usage :dp4 r4.x, r2.xyzw, cb0[16].xyzw
dp4 r8.x, r2.xyzw, cb0[16].xyzw
mul r4.x, r8.x, r10.x
// replacing matrix usage :dp4 r4.y, r2.xyzw, cb0[17].xyzw
dp4 r8.y, r2.xyzw, cb0[17].xyzw
mul r4.y, r8.y, r10.y
dp4 r4.z, r2.xyzw, cb0[18].xyzw
dp4 r4.w, r2.xyzw, cb0[19].xyzw
dp4 r0.w, r2.xyzw, cb0[25].xyzw
dp4 r3.w, r2.xyzw, cb0[26].xyzw
dp4 r5.x, r2.xyzw, cb0[27].xyzw
div r1.x, r3.w, cb0[21].y
mul r5.yzw, r4.xxwy, l(0.000000, 0.500000, 0.500000, -0.500000)
add r6.xy, r5.zzzz, r5.ywyy
mul r5.yz, r4.wwww, cb0[23].xxyx
mad o7.xy, r6.xyxx, cb0[23].zwzz, r5.yzyy
dp4 o9.x, r2.xyzw, cb0[9].xyzw
dp4 r5.y, r2.xyzw, cb0[10].xyzw
dp4 o9.y, r2.xyzw, cb0[11].xyzw
add r2.w, r5.y, -cb0[13].x
mad_sat o9.z, -r2.w, cb0[13].y, l(1.000000)
mul r0.x, r0.x, cb0[5].x
min r0.x, r0.x, l(1.000000)
dp3 r2.w, cb0[4].xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
lt r2.w, l(0.001000), r2.w
lt r5.y, r0.x, cb0[0].x
if_nz r5.y
  mul r5.y, r0.x, cb0[0].y
  div r5.y, r5.y, cb0[0].x
else 
  add r5.zw, -cb0[0].yyyx, l(0.000000, 0.000000, 1.000000, 1.000000)
  add r7.x, r0.x, -cb0[0].x
  mul r5.z, r5.z, r7.x
  div r5.z, r5.z, r5.w
  add r5.y, r5.z, cb0[0].y
endif 
mul r5.yzw, r5.yyyy, cb0[4].xxyz
log r5.yzw, r5.yyzw
mul r5.yzw, r5.yyzw, cb0[4].wwww
exp r5.yzw, r5.yyzw
mul r5.yzw, r5.yyzw, l(0.000000, -1.442695, -1.442695, -1.442695)
exp r5.yzw, r5.yyzw
add r5.yzw, -r5.yyzw, l(0.000000, 1.000000, 1.000000, 1.000000)
lt r7.x, l(0.800000), r0.x
and r2.w, r2.w, r7.x
if_nz r2.w
  add r0.x, r0.x, l(-0.800000)
  mul r0.x, r0.x, l(5.000000)
  add r7.xyz, -r5.yzwy, l(1.000000, 1.000000, 1.000000, 0.000000)
  mad r5.yzw, r0.xxxx, r7.xxyz, r5.yyzw
endif 
add r0.x, cb0[5].w, l(-0.250000)
add r0.x, r0.x, r0.x
dp3 r2.w, r5.yzwy, l(0.333300, 0.333300, 0.333300, 0.000000)
add r7.xyz, -r5.yzwy, r2.wwww
mad o5.xyz, r0.xxxx, r7.xyzx, r5.yzwy
div r7.x, r0.w, cb0[22].x
div r7.y, r5.x, cb0[22].z
div r7.z, r3.w, cb0[22].x
mul r5.xyz, r7.xyzx, cb0[22].wwww
add o3.xyz, r5.xyzx, r5.xyzx
dp3 r0.x, r3.xyzx, cb0[8].xyzx
div_sat r0.y, r0.z, r0.y
add r3.xyz, cb0[6].xyzx, cb0[7].xyzx
mul r3.xyz, r3.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000)
max r0.x, r0.x, l(0.000000)
mul r0.x, r0.x, r0.x
mul r0.x, r0.x, l(0.500000)
add r0.y, r0.y, l(-0.500000)
mad r0.y, -|r0.y|, l(2.000000), l(1.000000)
rsq r0.y, r0.y
div r0.y, l(1.000000, 1.000000, 1.000000, 1.000000), r0.y
dp3 r0.z, r3.xyzx, r3.xyzx
mul r0.y, r0.z, r0.y
mul o4.w, r0.y, r0.x
mov o0.xyzw, r4.xyzw
mov r1.zw, r7.xxxy
mov o1.xyzw, r1.zwxy
mov o4.xyz, r3.xyzx
mov o5.w, l(0)
mov r6.zw, r4.zzzw
mov o6.xyzw, r6.xyzw
mov o7.zw, r6.zzzw
mov o2.xyz, r5.xyzx
mov o8.xyz, r2.xyzx
mad o10.xy, r1.xxxx, l(1.000000, -1.000000, 0.000000, 0.000000), l(0.000000, 1.000000, 0.000000, 0.000000)
ret 
// Approximately 109 instruction slots used
