//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
//   using 3Dmigoto v1.2.67 on Mon Jan 01 13:11:45 2018
//
//
// Buffer Definitions: 
//
// cbuffer $Globals
// {
//
//   float4x4 viewproj;                 // Offset:    0 Size:    64
//   float4 cv4;                        // Offset:   64 Size:    16
//   float4 cam;                        // Offset:   80 Size:    16
//   float4 LightDir;                   // Offset:   96 Size:    16
//   float4 Ambient;                    // Offset:  112 Size:    16 [unused]
//   
//   struct
//   {
//       
//       float4 vDesc;                  // Offset:  128
//       float4 vFogLayerPlane;         // Offset:  144
//       float4 vFogLayerColor;         // Offset:  160
//       float4 vFogLayerSettings;      // Offset:  176
//       float4 vFogColor;              // Offset:  192
//       float4 vFogDistance;           // Offset:  208
//
//   } g_FogDesc;                       // Offset:  128 Size:    96
//   float4 TexSteps;                   // Offset:  224 Size:    16 [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 
// TEXCOORD                 0   xy          2     NONE   float   xy  
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float   xyzw
// TEXCOORD                 0   xyz         1     NONE   float   xyz 
// TEXCOORD                 1   xyzw        2     NONE   float   xyzw
// TEXCOORD                 2   xy          3     NONE   float   xy  
// COLOR                    0   xyzw        4     NONE   float   xyzw
// COLOR                    1   xyzw        5     NONE   float   xyzw
//
vs_4_0
dcl_constantbuffer cb0[14], immediateIndexed
dcl_input v0.xyz
dcl_input v1.xyz
dcl_input v2.xy
dcl_output_siv o0.xyzw, position
dcl_output o1.xyz
dcl_output o2.xyzw
dcl_output o3.xy
dcl_output o4.xyzw
dcl_output o5.xyzw
// 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.y, v0.y, -cb0[5].y
mov r0.xz, v0.xxzx
dp3 r1.x, r0.xyzx, r0.xyzx
sqrt r1.y, r1.x
mul r2.z, r1.y, cb0[13].x
mov r0.w, l(1.000000)
// replacing matrix usage :dp4 r3.x, r0.xyzw, cb0[0].xyzw
dp4 r6.x, r0.xyzw, cb0[0].xyzw
mul r3.x, r6.x, r8.x
// replacing matrix usage :dp4 r3.y, r0.xyzw, cb0[1].xyzw
dp4 r6.y, r0.xyzw, cb0[1].xyzw
mul r3.y, r6.y, r8.y
dp4 r3.z, r0.xyzw, cb0[2].xyzw
dp4 r3.w, r0.xyzw, cb0[3].xyzw
mad r2.xy, cb0[5].xzxx, cb0[4].xxxx, v2.xyxx
mul o3.xy, r2.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000)
mul r0.w, r2.z, r2.z
mul_sat r0.w, r2.z, r0.w
dp3 r1.z, cb0[12].xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
lt r1.z, l(0.001000), r1.z
lt r1.w, r0.w, cb0[8].x
if_nz r1.w
  mul r1.w, r0.w, cb0[8].y
  div r1.w, r1.w, cb0[8].x
else 
  add r4.xy, -cb0[8].yxyy, l(1.000000, 1.000000, 0.000000, 0.000000)
  add r2.w, r0.w, -cb0[8].x
  mul r2.w, r2.w, r4.x
  div r2.w, r2.w, r4.y
  add r1.w, r2.w, cb0[8].y
endif 
mul r4.xyz, r1.wwww, cb0[12].xyzx
log r4.xyz, r4.xyzx
mul r4.xyz, r4.xyzx, cb0[12].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 r1.w, l(0.800000), r0.w
and r1.z, r1.z, r1.w
if_nz r1.z
  add r0.w, r0.w, l(-0.800000)
  mul r0.w, r0.w, l(5.000000)
  add r5.xyz, -r4.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
  mad r4.xyz, r0.wwww, r5.xyzx, r4.xyzx
endif 
add r0.w, cb0[13].w, l(-0.250000)
add r0.w, r0.w, r0.w
dp3 r1.z, r4.xyzx, l(0.333300, 0.333300, 0.333300, 0.000000)
add r5.xyz, -r4.xyzx, r1.zzzz
mad o5.xyz, r0.wwww, r5.xyzx, r4.xyzx
mul r4.xyz, r3.xwyx, l(0.500000, 0.500000, -0.500000, 0.000000)
add o2.xy, r4.yyyy, r4.xzxx
dp3 r0.w, v0.xyzx, v0.xyzx
rsq r0.w, r0.w
mul r4.xyz, r0.wwww, v0.xyzx
dp3 r0.w, r4.xyzx, -cb0[6].xyzx
max r0.w, r0.w, l(0.000000)
mul r0.w, r0.w, r0.w
mul o4.xyz, r0.wwww, r0.wwww
rsq r0.w, r1.x
mul r0.xyz, r0.wwww, r0.xyzx
mul r0.w, r1.y, l(0.000100)
min r0.w, r0.w, l(1.000000)
dp3 r0.x, r0.xyzx, v1.xyzx
log r0.x, |r0.x|
mul r0.x, r0.x, l(0.100000)
exp r0.x, r0.x
add r0.x, r0.x, l(-1.000000)
mad o4.w, r0.w, r0.x, l(1.000000)
mov o0.xyzw, r3.xyzw
mov o2.zw, r3.zzzw
mov o5.w, l(0)
mov o1.xyz, r2.xyzx
ret 
// Approximately 71 instruction slots used
