//
// 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 g_mCloudsShadowsSpace;    // Offset:    0 Size:    64
//   float4 g_vCloudsShadowDesc;        // Offset:   64 Size:    16 [unused]
//   float4 g_vDitherSettings;          // Offset:   80 Size:    16 [unused]
//   float4 specColor;                  // Offset:   96 Size:    16 [unused]
//   float4 ControlData;                // Offset:  112 Size:    16 [unused]
//   float4 difColor;                   // Offset:  128 Size:    16 [unused]
//   float4 ambient;                    // Offset:  144 Size:    16 [unused]
//   float4 g_vDefLightDir;             // Offset:  160 Size:    16
//   float4 g_vDefLightColor;           // Offset:  176 Size:    16 [unused]
//   float4 g_vDefSpecColor;            // Offset:  192 Size:    16 [unused]
//   uint CS_FRONT;                     // Offset:  208 Size:     4 [unused]
//      = 0x00000000 
//   uint CS_RIGHT;                     // Offset:  212 Size:     4 [unused]
//      = 0x00000001 
//   uint CS_BACK;                      // Offset:  216 Size:     4 [unused]
//      = 0x00000002 
//   uint CS_LEFT;                      // Offset:  220 Size:     4 [unused]
//      = 0x00000003 
//   uint CS_TOP;                       // Offset:  224 Size:     4 [unused]
//      = 0x00000004 
//   uint CS_BOTTOM;                    // Offset:  228 Size:     4 [unused]
//      = 0x00000005 
//   float4 g_vAmbientSettings;         // Offset:  240 Size:    16 [unused]
//   
//   struct
//   {
//       
//       float4 vDesc;                  // Offset:  256
//       float4 vFogLayerPlane;         // Offset:  272
//       float4 vFogLayerColor;         // Offset:  288
//       float4 vFogLayerSettings;      // Offset:  304
//       float4 vFogColor;              // Offset:  320
//       float4 vFogDistance;           // Offset:  336
//
//   } g_FogDesc;                       // Offset:  256 Size:    96 [unused]
//   float4 GrayK;                      // Offset:  352 Size:    16 [unused]
//      = 0x3eaa7efa 0x3eaa7efa 0x3eaa7efa 0x00000000 
//   float4x4 viewproj;                 // Offset:  368 Size:    64
//   float4 g_vCamPos;                  // Offset:  432 Size:    16
//   float4 UVSize;                     // Offset:  448 Size:    16
//   float4 PIConst;                    // Offset:  464 Size:    16
//      = 0x40c90e56 0x3e22fabe 0x3f22f41b 0x3fc91687 
//   float4 Threshold;                  // Offset:  480 Size:    16 [unused]
//   float4 g_vExclusionMask;           // Offset:  496 Size:    16 [unused]
//      = 0x3f800000 0x3f800000 0x3f800000 0x3f800000 
//   float4 Constraints;                // Offset:  512 Size:    16
//   float4 GlobalOffset;               // Offset:  528 Size:    16
//   float4 SunData;                    // Offset:  544 Size:    16 [unused]
//   float4 Mask[4];                    // Offset:  560 Size:    64 [unused]
//      = 0x00000000 0x00000000 0x00000000 0x3f800000 
//        0x00000000 0x00000000 0x3f800000 0x00000000 
//        0x00000000 0x3f800000 0x00000000 0x00000000 
//        0x3f800000 0x00000000 0x00000000 0x00000000 
//
// }
//
// cbuffer CBFBDData
// {
//
//   float4 g_vGetFaceData;             // Offset:    0 Size:    16
//   float4 g_vMaskCoord;               // Offset:   16 Size:    16 [unused]
//   float4 g_vNormalsCoord;            // Offset:   32 Size:    16 [unused]
//   float4 g_avTreeCenter[64];         // Offset:   48 Size:  1024
//   float4 g_avFaceK[64];              // Offset: 1072 Size:  1024
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// $Globals                          cbuffer      NA          NA    0        1
// CBFBDData                         cbuffer      NA          NA    1        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyzw        0     NONE   float   xyzw
// POSITION                 1   xyzw        1     NONE   float    y w
// POSITION                 2   xyzw        2     NONE   float       
// TEXCOORD                 0   xy          3     NONE   float   xy  
// TEXCOORD                 1   xy          4     NONE   float       
//
//
// 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   xyzw        2     NONE   float   xyzw
// TEXCOORD                 3   xyzw        3     NONE   float   xyzw
// TEXCOORD                 4   xyz         4     NONE   float   xyz 
// TEXCOORD                 5   xyz         5     NONE   float   xyz 
// TEXCOORD                 6   xyzw        6     NONE   float   xyzw
// COLOR                    0   xyzw        7     NONE   float   xyzw
// COLOR                    1   xyzw        8     NONE   float   xyzw
//
vs_4_0
dcl_constantbuffer cb0[34], immediateIndexed
dcl_constantbuffer cb1[131], dynamicIndexed
dcl_input v0.xyzw
dcl_input v1.yw
dcl_input v3.xy
dcl_output_siv o0.xyzw, position
dcl_output o1.xyzw
dcl_output o2.xyzw
dcl_output o3.xyzw
dcl_output o4.xyz
dcl_output o5.xyz
dcl_output o6.xyzw
dcl_output o7.xyzw
dcl_output o8.xyzw
// dcl_temps updated : previous = dcl_temps 7
dcl_temps 10
// added 3dmigoto declaration
dcl_resource_texture1d (float,float,float,float) t120
ld_indexable(texture1d)(float,float,float,float) r8.xyzw, l(0, 0, 0, 0), t120.xyzw
mov r9.x, r8.w
mov r9.y, r8.w
mov r9.zw, l(1.0, 1.0)
// end of 3dmigoto declaration
mad r0.x, v0.w, l(0.500000), l(0.000100)
round_ni r0.x, r0.x
ftou r0.y, r0.x
mad r0.x, r0.x, l(2.000000), l(0.500000)
lt r0.x, r0.x, v0.w
movc r0.xy, r0.xxxx, cb1[r0.y + 3].zwzz, cb1[r0.y + 3].xyxx
add r1.x, cb1[0].x, l(-1.000000)
max r1.yzw, r0.yyyx, l(0.000000, 1.000000, 1.000000, 1.000000)
min r1.xyz, r1.xxxx, r1.yzwy
mad r2.xyz, r1.xyzx, cb1[0].wwww, l(0.000100, 0.000100, 0.000100, 0.000000)
round_ni r2.xyz, r2.xyzx
mad r1.x, r2.x, cb1[0].y, r2.z
add r1.w, r1.x, r1.x
mad r1.y, -r2.y, cb1[0].z, r1.y
add r1.z, -r1.z, cb1[0].z
mad r1.z, r2.z, cb1[0].z, r1.z
lt r1.y, r1.z, r1.y
if_nz r1.y
  mad r1.w, r1.x, l(2.000000), l(1.000000)
endif 
mad r1.xy, r1.wwww, l(2.000000, 2.000000, 0.000000, 0.000000), l(1.000100, 0.000100, 0.000000, 0.000000)
ftou r1.xy, r1.xyxx
add r1.z, -r0.x, cb1[r1.x + 67].x
mad r1.z, cb1[r1.y + 67].x, r1.z, cb1[r1.y + 67].z
add r1.x, r0.y, -cb1[r1.x + 67].y
mad r0.w, cb1[r1.y + 67].y, r1.x, r1.z
add r0.z, r0.w, v1.y
add r1.xyz, r0.xzyx, cb0[33].xyzx
add r0.xyz, r0.xwyx, cb0[33].xyzx
add r0.xyz, -r0.xyzx, cb0[27].xyzx
dp3 r0.w, r0.xyzx, r0.xyzx
sqrt r2.x, r0.w
lt r2.y, l(0.000000), v0.y
if_nz r2.y
  rsq r0.w, r0.w
  mul r0.xyz, r0.wwww, r0.xyzx
  dp3_sat r0.x, r0.xyzx, cb0[10].xyzx
else 
  mov r0.x, l(0)
endif 
lt r0.w, l(0.500000), cb0[27].w
if_nz r0.w
  mov r3.xyz, -cb0[10].xzyx
else 
  add r3.xyz, -r1.xzyx, cb0[27].xzyx
endif 
max r3.z, r3.z, l(0.000000)
dp3 r0.w, r3.xyzx, r3.xyzx
rsq r0.w, r0.w
mul r4.xyz, r0.wwww, r3.xzyx
mov r4.w, -r4.x
dp2 r2.y, r4.zwzz, r4.zwzz
rsq r2.y, r2.y
mul r5.z, r2.y, r4.z
mul r5.y, r2.y, -r4.x
lt r2.y, cb0[32].x, r2.x
lt r2.z, r2.x, cb0[32].y
and r2.y, r2.z, r2.y
if_nz r2.y
  mov r5.x, l(0)
  mul r2.yzw, r4.zzxy, r5.xxyz
  mad r2.yzw, r4.yyzx, r5.yyzx, -r2.yyzw
  mul r2.yw, r2.yyyw, v0.yyyy
  mad r2.yw, r5.zzzy, v0.xxxx, r2.yyyw
  mul r3.x, r4.y, v0.z
  mad r6.y, r2.z, v0.y, r3.x
  mad r6.xz, r4.xxzx, v0.zzzz, r2.yywy
  add r1.xyz, r1.xyzx, r6.xyzx
endif 
mov r1.w, l(1.000000)
// replacing matrix usage :dp4 r6.x, r1.xyzw, cb0[23].xyzw
dp4 r7.x, r1.xyzw, cb0[23].xyzw
mul r6.x, r7.x, r9.x
// replacing matrix usage :dp4 r6.y, r1.xyzw, cb0[24].xyzw
dp4 r7.y, r1.xyzw, cb0[24].xyzw
mul r6.y, r7.y, r9.y
dp4 r6.z, r1.xyzw, cb0[25].xyzw
dp4 r6.w, r1.xyzw, cb0[26].xyzw
dp4 o1.z, r1.xyzw, cb0[0].xyzw
dp4 o1.w, r1.xyzw, cb0[2].xyzw
lt r1.w, l(0.000000), cb0[32].x
add r2.x, r2.x, -cb0[32].x
mul_sat r2.x, r2.x, l(0.0142857144)
movc r0.z, r1.w, r2.x, l(1.000000)
div r1.w, l(0.500000), r6.w
mad o3.x, r6.x, r1.w, l(0.500000)
mad o3.y, -r6.y, r1.w, l(0.500000)
add r1.w, -|r5.z|, l(1.000000)
sqrt r1.w, r1.w
mad r2.x, |r5.z|, l(-0.0187292993), l(0.074261)
mad r2.x, r2.x, |r5.z|, l(-0.212114394)
mad r2.x, r2.x, |r5.z|, l(1.57072878)
mul r2.y, r1.w, r2.x
mad r2.y, r2.y, l(-2.000000), l(3.14159274)
lt r2.z, r5.z, -r5.z
and r2.y, r2.z, r2.y
mad r1.w, r2.x, r1.w, r2.y
lt r2.x, l(0.000000), -r5.y
if_nz r2.x
  add r1.w, -r1.w, cb0[29].x
endif 
add r1.w, r1.w, -v1.w
lt r2.x, r1.w, l(0.000000)
if_nz r2.x
  add r1.w, r1.w, cb0[29].x
endif 
lt r2.x, cb0[29].x, r1.w
if_nz r2.x
  add r1.w, r1.w, -cb0[29].x
endif 
mad r0.w, -r3.z, r0.w, l(1.000000)
sqrt r0.w, r0.w
mad r2.x, r4.y, l(-0.0187292993), l(0.074261)
mad r2.x, r2.x, r4.y, l(-0.212114394)
mad r2.x, r2.x, r4.y, l(1.57072878)
mad r0.w, -r2.x, r0.w, l(1.57079637)
mad r1.w, -r1.w, cb0[29].y, l(1.000000)
div r1.w, r1.w, cb0[28].x
round_ne r1.w, r1.w
div r2.x, l(1.000000, 1.000000, 1.000000, 1.000000), cb0[28].x
add r2.x, r2.x, l(-0.100000)
ge r2.x, r1.w, r2.x
if_nz r2.x
  mov r1.w, l(0)
endif 
mul r0.w, r0.w, cb0[29].z
div r0.w, r0.w, cb0[28].z
round_ne r0.w, r0.w
mad r2.x, r1.w, cb0[28].x, v3.x
mad r2.y, r0.w, cb0[28].y, v3.y
mov r3.x, l(0)
mov r3.y, cb0[28].y
add o2.xy, r2.xyxx, r3.xyxx
mov o0.xyzw, r6.xyzw
mov o1.xy, r2.xyxx
mov o2.w, r6.w
mov o2.z, r0.z
mov o3.zw, r6.zzzw
mov o6.xyzw, l(0,0,0,0)
mov o7.xyzw, l(0,0,0,0)
mov r0.y, l(0)
mov o8.xyzw, r0.xyyz
mov o4.xyz, r1.xyzx
mov o5.xyz, r4.xyzx
ret 
// Approximately 141 instruction slots used
