//
// 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
// {
//
//   float4x4 viewproj;                 // Offset:    0 Size:    64
//   float4 cv4;                        // Offset:   64 Size:    16
//   float4 cam;                        // Offset:   80 Size:    16
//   float4 lightInfo[4];               // Offset:   96 Size:    64 [unused]
//   float4 lightCount;                 // Offset:  160 Size:    16 [unused]
//   float4 ambient;                    // Offset:  176 Size:    16 [unused]
//   
//   struct
//   {
//       
//       float4 vDesc;                  // Offset:  192
//       float4 vFogLayerPlane;         // Offset:  208
//       float4 vFogLayerColor;         // Offset:  224
//       float4 vFogLayerSettings;      // Offset:  240
//       float4 vFogColor;              // Offset:  256
//       float4 vFogDistance;           // Offset:  272
//
//   } g_FogDesc;                       // Offset:  192 Size:    96
//   float4 bright;                     // Offset:  288 Size:    16 [unused]
//   float4 camVector;                  // Offset:  304 Size:    16 [unused]
//   float4 SunCamK;                    // Offset:  320 Size:    16 [unused]
//   float3 layerK;                     // Offset:  336 Size:    12 [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 
// TEXCOORD                 0   xy          1     NONE   float   xy  
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float   xyzw
// COLOR                    0   xyzw        1     NONE   float   xyzw
// TEXCOORD                 0   xyz         2     NONE   float   xyz 
// TEXCOORD                 1   xyzw        3     NONE   float   xyzw
//
vs_4_0
dcl_constantbuffer cb0[18], immediateIndexed
dcl_input v0.xyz
dcl_input v1.xy
dcl_output_siv o0.xyzw, position
dcl_output o1.xyzw
dcl_output o2.xyz
dcl_output o3.xyzw
// dcl_temps updated : previous = dcl_temps 3
dcl_temps 6
// added 3dmigoto declaration
dcl_resource_texture1d (float,float,float,float) t120
ld_indexable(texture1d)(float,float,float,float) r4.xyzw, l(0, 0, 0, 0), t120.xyzw
mov r5.x, r4.w
mov r5.y, r4.w
mov r5.zw, l(1.0, 1.0)
// end of 3dmigoto declaration
add r0.xzw, v0.xxzy, cb0[5].xxzy
add r0.y, r0.w, cb0[4].z
dp3 r1.x, r0.xyzx, r0.xyzx
sqrt r1.x, r1.x
mov r0.w, l(1.000000)
// replacing matrix usage :dp4 r2.x, r0.xyzw, cb0[0].xyzw
dp4 r3.x, r0.xyzw, cb0[0].xyzw
mul r2.x, r3.x, r5.x
// replacing matrix usage :dp4 r2.y, r0.xyzw, cb0[1].xyzw
dp4 r3.y, r0.xyzw, cb0[1].xyzw
mul r2.y, r3.y, r5.y
dp4 r2.z, r0.xyzw, cb0[2].xyzw
dp4 r2.w, r0.xyzw, cb0[3].xyzw
add o2.xy, v1.xyxx, cb0[4].xyxx
mul r0.x, r1.x, cb0[17].x
min r0.x, r0.x, l(1.000000)
dp3 r0.y, cb0[16].xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
lt r0.z, r0.x, cb0[12].x
if_nz r0.z
  mul r0.z, r0.x, cb0[12].y
  div r0.z, r0.z, cb0[12].x
else 
  add r1.yz, -cb0[12].yyxy, l(0.000000, 1.000000, 1.000000, 0.000000)
  add r0.w, r0.x, -cb0[12].x
  mul r0.w, r0.w, r1.y
  div r0.w, r0.w, r1.z
  add r0.z, r0.w, cb0[12].y
endif 
mul r1.yzw, r0.zzzz, cb0[16].xxyz
log r1.yzw, r1.yyzw
mul r1.yzw, r1.yyzw, cb0[16].wwww
exp r1.yzw, r1.yyzw
mul r1.yzw, r1.yyzw, l(0.000000, -1.442695, -1.442695, -1.442695)
exp r1.yzw, r1.yyzw
add r1.yzw, -r1.yyzw, l(0.000000, 1.000000, 1.000000, 1.000000)
lt r0.yz, l(0.000000, 0.001000, 0.800000, 0.000000), r0.yyxy
and r0.y, r0.y, r0.z
if_nz r0.y
  add r0.x, r0.x, l(-0.800000)
  mul r0.x, r0.x, l(5.000000)
  add r0.yzw, -r1.yyzw, l(0.000000, 1.000000, 1.000000, 1.000000)
  mad r1.yzw, r0.xxxx, r0.yyzw, r1.yyzw
endif 
add r0.x, cb0[17].w, l(-0.250000)
add r0.x, r0.x, r0.x
dp3 r0.y, r1.yzwy, l(0.333300, 0.333300, 0.333300, 0.000000)
add r0.yzw, -r1.yyzw, r0.yyyy
mad o1.xyz, r0.xxxx, r0.yzwy, r1.yzwy
mul r0.xyz, r2.xwyx, l(0.500000, 0.500000, -0.500000, 0.000000)
add o3.xy, r0.yyyy, r0.xzxx
mov o0.xyzw, r2.xyzw
mov o1.w, l(0)
mov o3.zw, r2.zzzw
mov o2.z, r1.x
ret 
// Approximately 51 instruction slots used
