//
// 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
// {
//
//   struct
//   {
//       
//       float4x4 mLightSpaceInverse;   // Offset:    0
//       float4x4 mLightSpace;          // Offset:   64
//       float4 vShadowBias;            // Offset:  128
//       float4 vBiasDir;               // Offset:  144
//       float4 vSmoothOffs;            // Offset:  160
//       float4 vShadowsDesc;           // Offset:  176
//       float4 avCPlane[8];            // Offset:  192
//       float4 avCascadeZ[2];          // Offset:  320
//       float4 avUVTransform[8];       // Offset:  352
//       float4 avZTransformZF[8];      // Offset:  480
//
//   } g_ShadSettings;                  // Offset:    0 Size:   608 [unused]
//   float4x4 g_mCloudsShadowsSpace;    // Offset:  608 Size:    64 [unused]
//   float4 g_vCloudsShadowDesc;        // Offset:  672 Size:    16
//   float4 specColor;                  // Offset:  688 Size:    16 [unused]
//   float4 ControlData;                // Offset:  704 Size:    16 [unused]
//   float4 difColor;                   // Offset:  720 Size:    16
//   float4 ambient;                    // Offset:  736 Size:    16
//   float4 lightCount;                 // Offset:  752 Size:    16 [unused]
//   float4 g_avLightPos[4];            // Offset:  768 Size:    64
//   float4 g_avLightColor[4];          // Offset:  832 Size:    64 [unused]
//   float4 g_avConeDir[4];             // Offset:  896 Size:    64 [unused]
//   float4 g_vAmbientSettings;         // Offset:  960 Size:    16 [unused]
//   float4 g_avColorMask[2];           // Offset:  976 Size:    32 [unused]
//   float4 g_vParalaxMaskData;         // Offset: 1008 Size:    16 [unused]
//   float4 Offset_Time;                // Offset: 1024 Size:    16 [unused]
//   float AlphaDensity;                // Offset: 1040 Size:     4 [unused]
//      = 0x3c75c28f 
//   float4x4 ViewProjection;           // Offset: 1056 Size:    64 [unused]
//   float4 RenderPos;                  // Offset: 1120 Size:    16 [unused]
//   float4 g_vWorldPos;                // Offset: 1136 Size:    16 [unused]
//   float4 GlobalK;                    // Offset: 1152 Size:    16 [unused]
//   float4 g_vGrassSettings;           // Offset: 1168 Size:    16
//      = 0x3f333333 0x3f800000 0x00000000 0x00000000 
//   float4 g_avCapsules[32];           // Offset: 1184 Size:   512 [unused]
//   float4 nc[4];                      // Offset: 1696 Size:    64 [unused]
//   float4 pc;                         // Offset: 1760 Size:    16 [unused]
//   float4 pcInfo;                     // Offset: 1776 Size:    16 [unused]
//   float4 TileUV;                     // Offset: 1792 Size:    16 [unused]
//   float4 TreeShInfo;                 // Offset: 1808 Size:    16 [unused]
//   float4 g_vMaxDistance;             // Offset: 1824 Size:    16 [unused]
//   float4 g_vAsyncTexScale;           // Offset: 1840 Size:    16 [unused]
//      = 0x3f800000 0x3f800000 0x00000000 0x00000000 
//   float PI;                          // Offset: 1856 Size:     4 [unused]
//      = 0x40490fdb 
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// CloudsShadowsSampler              sampler      NA          NA    0        1
// DiffuseTextureSampler             sampler      NA          NA    1        1
// ParalaxMaskSampler                sampler      NA          NA    2        1
// CliffsTextureSampler              sampler      NA          NA    3        1
// NormalTextureSampler              sampler      NA          NA    4        1
// TileTextureSampler                sampler      NA          NA    5        1
// MaskTextureSampler                sampler      NA          NA    6        1
// TreeShadowTextureSampler          sampler      NA          NA    7        1
// DiffuseTextureSampler             texture  float4          2d    0        1
// TileTextureSampler                texture  float4          2d    1        1
// CliffsTextureSampler              texture  float4          2d    2        1
// ParalaxMaskSampler                texture  float4          2d    3        1
// MaskTextureSampler                texture  float4          2d    4        1
// NormalTextureSampler              texture  float4          2d    5        1
// CloudsShadowsSampler              texture  float4          2d    6        1
// TreeShadowTextureSampler          texture  float4          2d    7        1
// $Globals                          cbuffer      NA          NA    0        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float       
// TEXCOORD                 0   xyzw        1     NONE   float   xyzw
// TEXCOORD                 1   xy          2     NONE   float   xy  
// TEXCOORD                 2     zw        2     NONE   float     zw
// TEXCOORD                 3   xyzw        3     NONE   float   xyzw
// TEXCOORD                 4   xyzw        4     NONE   float       
// TEXCOORD                 5   xyzw        5     NONE   float       
// TEXCOORD                 6   xyz         6     NONE   float   xyz 
// TEXCOORD                 7   xyz         7     NONE   float   xyz 
// COLOR                    0   xy          8     NONE   float   xy  
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target                0   xyzw        0   TARGET   float   xyzw
//
ps_4_1
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[74], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s1, mode_default
dcl_sampler s2, mode_default
dcl_sampler s3, mode_default
dcl_sampler s4, mode_default
dcl_sampler s5, mode_default
dcl_sampler s6, mode_default
dcl_sampler s7, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2d (float,float,float,float) t1
dcl_resource_texture2d (float,float,float,float) t2
dcl_resource_texture2d (float,float,float,float) t3
dcl_resource_texture2d (float,float,float,float) t4
dcl_resource_texture2d (float,float,float,float) t5
dcl_resource_texture2d (float,float,float,float) t6
dcl_resource_texture2d (float,float,float,float) t7
dcl_input_ps linear v1.xyzw
dcl_input_ps linear v2.xy
dcl_input_ps linear v2.zw
dcl_input_ps linear v3.xyzw
dcl_input_ps linear v6.xyz
dcl_input_ps linear v7.xyz
dcl_input_ps linear v8.xy
dcl_output o0.xyzw
dcl_temps 7
sample r0.xyzw, v1.xyxx, t0.xyzw, s1
mul r0.w, r0.w, v8.x
lt r1.x, l(0.350000), r0.w
if_nz r1.x
  sample r1.xyzw, v2.zwzz, t1.xyzw, s5
  sample r2.xy, v2.xyxx, t2.yzxw, s3
  sample_d r2.z, v3.zwzz, t3.xzyw, s2, l(0.000000, 0.000000, 0.000000, 0.000000), l(0.000000, 0.000000, 0.000000, 0.000000)
  mad_sat r2.z, r2.z, l(10.000000), l(-1.500000)
  mad_sat r1.w, -r1.w, l(2.000000), l(1.000000)
  lt r2.w, l(0.500000), cb0[73].z
  if_nz r2.w
    sample r2.w, v2.zwzz, t4.xzwy, s6
    mul_sat r2.w, r2.w, l(10.000000)
    mul r1.w, r1.w, r2.w
  endif 
  mul r0.w, r0.w, r1.w
  add r2.xy, r2.yxyy, l(-0.500000, -0.200000, 0.000000, 0.000000)
  mul r3.x, r2.y, l(10.000000)
  mad_sat r1.w, -r2.x, l(10.000000), l(1.000000)
  mov_sat r3.x, r3.x
  mul r1.w, r1.w, r3.x
  mul r0.w, r0.w, r1.w
  mul r0.w, r2.z, r0.w
  lt r1.w, l(0.350000), r0.w
  if_nz r1.w
    sample r2.xyz, v2.xyxx, t5.xyzw, s4
    mad r2.xyz, r2.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
    dp3 r1.w, r2.xyzx, r2.xyzx
    rsq r1.w, r1.w
    mul r2.xyz, r1.wwww, r2.xyzx
    dp3_sat r1.w, r2.xyzx, -cb0[48].xyzx
    sample r2.x, v1.zwzz, t6.yxzw, s0
    add r2.x, r2.x, l(-1.000000)
    mad r2.x, cb0[42].z, r2.x, l(1.000000)
    mul r2.y, r1.w, r2.x
    mad r1.w, -r1.w, r2.x, l(1.000000)
    mad r1.w, v8.y, r1.w, r2.y
    sample r2.x, v3.xyxx, t7.yxzw, s7
    mul r1.w, r1.w, r2.x
    lt r2.x, cb0[73].y, l(0.001000)
    if_nz r2.x
      mov r2.yzw, r0.xxyz
    endif 
    if_z r2.x
      add r1.xyz, r1.xyzx, l(-0.500000, -0.500000, -0.500000, 0.000000)
      mad r3.xyz, cb0[73].xxxx, r1.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000)
      lt r4.xyz, l(0.500000, 0.500000, 0.500000, 0.000000), r3.xyzx
      if_nz r4.x
        add r2.x, -r3.x, l(1.000000)
        add r5.x, r2.x, r2.x
        mad r1.x, cb0[73].x, r1.x, r3.x
        add r6.x, r1.x, l(-0.500000)
      else 
        add r5.x, r3.x, r3.x
        mov r6.x, l(0)
      endif 
      if_nz r4.y
        add r1.x, -r3.y, l(1.000000)
        add r5.y, r1.x, r1.x
        mad r1.x, cb0[73].x, r1.y, r3.y
        add r6.y, r1.x, l(-0.500000)
      else 
        add r5.y, r3.y, r3.y
        mov r6.y, l(0)
      endif 
      if_nz r4.z
        add r1.x, -r3.z, l(1.000000)
        add r5.z, r1.x, r1.x
        mad r1.x, cb0[73].x, r1.z, r3.z
        add r6.z, r1.x, l(-0.500000)
      else 
        add r5.z, r3.z, r3.z
        mov r6.z, l(0)
      endif 
      mad r1.xyz, r0.xyzx, r5.xyzx, r6.xyzx
      add r1.xyz, -r0.xyzx, r1.xyzx
      mad r2.yzw, cb0[73].yyyy, r1.xxyz, r0.xxyz
    endif 
    mad r0.xyz, v6.xyzx, r1.wwww, cb0[46].xyzx
    add r0.xyz, r0.xyzx, v7.xyzx
    mul r0.xyz, r0.xyzx, r2.yzwy
    mul o0.xyz, r0.xyzx, cb0[45].xyzx
    mov o0.w, r0.w
  else 
    discard_nz l(-1)
    mov o0.xyzw, l(0,0,0,0)
  endif 
else 
  discard_nz l(-1)
  mov o0.xyzw, l(0,0,0,0)
endif 
ret 
// Approximately 92 instruction slots used
