//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.17672
//
//   using 3Dmigoto v1.2.27 on Wed Feb 10 00:15:46 2016
//
//
// Buffer Definitions: 
//
// cbuffer WorldBuffer
// {
//
//   struct WorldStruct
//   {
//       
//       row_major float4x4 ViewProject;// Offset:    0
//       
//       struct WorldStruct_PerInstanceData
//       {
//           
//           row_major float4x4 World;  // Offset:   64
//           row_major float4x4 WorldViewProject;// Offset:  128
//
//       } PerInstance[256];            // Offset:   64
//
//   } WorldParameters;                 // Offset:    0 Size: 32832
//
// }
//
// cbuffer SceneBuffer
// {
//
//   row_major float4x4 View;           // Offset:    0 Size:    64 [unused]
//   row_major float4x4 ScreenMatrix;   // Offset:   64 Size:    64 [unused]
//   float2 DepthExportScale;           // Offset:  128 Size:     8 [unused]
//   float2 __padding0;                 // Offset:  136 Size:     8 [unused]
//   float4 FogParams;                  // Offset:  144 Size:    16 [unused]
//   float3 __CameraPosition;           // Offset:  160 Size:    12 [unused]
//   float __padding12;                 // Offset:  172 Size:     4 [unused]
//   float3 CameraDirection;            // Offset:  176 Size:    12 [unused]
//   float __padding9;                  // Offset:  188 Size:     4 [unused]
//   float3 DepthFactors;               // Offset:  192 Size:    12 [unused]
//   float __padding10;                 // Offset:  204 Size:     4 [unused]
//   float3 ShadowDepthBiasAndLightType;// Offset:  208 Size:    12 [unused]
//   float __padding11;                 // Offset:  220 Size:     4 [unused]
//   float4 SubframeViewport;           // Offset:  224 Size:    16 [unused]
//   row_major float3x4 DepthToWorld;   // Offset:  240 Size:    48 [unused]
//   float4 DepthToView;                // Offset:  288 Size:    16 [unused]
//   float4 OneOverDepthToView;         // Offset:  304 Size:    16 [unused]
//   float4 DepthToW;                   // Offset:  320 Size:    16 [unused]
//   float4 ClipPlane;                  // Offset:  336 Size:    16 [unused]
//   float2 ViewportDepthScaleOffset;   // Offset:  352 Size:     8 [unused]
//   float2 __padding1;                 // Offset:  360 Size:     8 [unused]
//   float2 ColorDOFDepthScaleOffset;   // Offset:  368 Size:     8 [unused]
//   float2 __padding2;                 // Offset:  376 Size:     8 [unused]
//   float4 TimeVector;                 // Offset:  384 Size:    16 [unused]
//   float4 FogParams2;                 // Offset:  400 Size:    16 [unused]
//   float4 FogParams3;                 // Offset:  416 Size:    16 [unused]
//   float3 GlobalAmbient;              // Offset:  432 Size:    12 [unused]
//   float __padding8;                  // Offset:  444 Size:     4 [unused]
//   float4 GlobalParams[16];           // Offset:  448 Size:   256 [unused]
//   float4 ViewToFogH;                 // Offset:  704 Size:    16 [unused]
//   float4 ScreenExtents;              // Offset:  720 Size:    16 [unused]
//   float2 ScreenResolution;           // Offset:  736 Size:     8 [unused]
//   float2 __padding3;                 // Offset:  744 Size:     8 [unused]
//   float4 PSSMToMap1Lin;              // Offset:  752 Size:    16 [unused]
//   float4 PSSMToMap1Const;            // Offset:  768 Size:    16 [unused]
//   float4 PSSMToMap2Lin;              // Offset:  784 Size:    16 [unused]
//   float4 PSSMToMap2Const;            // Offset:  800 Size:    16 [unused]
//   float4 PSSMToMap3Lin;              // Offset:  816 Size:    16 [unused]
//   float4 PSSMToMap3Const;            // Offset:  832 Size:    16 [unused]
//   float4 PSSMDistances;              // Offset:  848 Size:    16 [unused]
//   row_major float4x4 WorldToPSSM0;   // Offset:  864 Size:    64 [unused]
//   row_major float4x4 PrevViewProject;// Offset:  928 Size:    64 [unused]
//   row_major float4x4 PrevWorld;      // Offset:  992 Size:    64 [unused]
//   row_major float4x4 ViewT;          // Offset: 1056 Size:    64 [unused]
//   float4 PSSMExtents;                // Offset: 1120 Size:    16 [unused]
//   float4 ShadowAtlasResolution;      // Offset: 1136 Size:    16 [unused]
//   float4 UnitRimData[3];             // Offset: 1152 Size:    48 [unused]
//   float3 __CameraPositionForCorrection;// Offset: 1200 Size:    12 [unused]
//   float __padding7;                  // Offset: 1212 Size:     4 [unused]
//   row_major float4x4 CameraViewProject;// Offset: 1216 Size:    64 [unused]
//   float4 BackBufferResolution;       // Offset: 1280 Size:    16 [unused]
//   row_major float4x4 InverseProjection;// Offset: 1296 Size:    64 [unused]
//   float4 StereoOffset;               // Offset: 1360 Size:    16 [unused]
//   row_major float4x4 Projection;     // Offset: 1376 Size:    64 [unused]
//   row_major float4x4 ViewInv;        // Offset: 1440 Size:    64 [unused]
//   float4 ColorSSAO;                  // Offset: 1504 Size:    16 [unused]
//   float4 GlobalFogColor;             // Offset: 1520 Size:    16 [unused]
//   float4 VolumetricLightGlobalParams;// Offset: 1536 Size:    16 [unused]
//   float4 SnowParams01;               // Offset: 1552 Size:    16
//   float4 SnowParams02;               // Offset: 1568 Size:    16
//   float4 SnowParams03;               // Offset: 1584 Size:    16
//   int SSREnabled;                    // Offset: 1600 Size:     4 [unused]
//   int __padding4;                    // Offset: 1604 Size:     4 [unused]
//   int __padding5;                    // Offset: 1608 Size:     4 [unused]
//   int __padding6;                    // Offset: 1612 Size:     4 [unused]
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// SamplerGenericPointWrap           sampler      NA          NA    9        1
// p_Vertex_846A1FC060822824_cp0_316DF77090065_Param_texture    texture  float4          2d    0        1
// WorldBuffer                       cbuffer      NA          NA    0        1
// SceneBuffer                       cbuffer      NA          NA    2        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// COLOR                    0   xyzw        0     NONE   float    y  
// TEXCOORD                 3   xyzw        1     NONE   float       
// POSITION                 0   xyz         2     NONE   float   xyz 
// SV_InstanceID            0   x           3   INSTID    uint   x   
// SV_VertexID              0   x           4   VERTID    uint       
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// PSIZE                    0   x           0     NONE    uint   x   
// POSITION                 0   xyzw        1     NONE   float   xyzw
//
vs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[2048], dynamicIndexed
dcl_constantbuffer cb2[100], immediateIndexed
dcl_sampler s9, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_input v0.y
dcl_input v2.xyz
dcl_input_sgv v3.x, instance_id
dcl_output o0.x
dcl_output o1.xyzw
dcl_temps 9
ishl r0.x, v3.x, l(3)
mul r0.yzw, v2.yyyy, cb0[r0.x + 5].xxyz
mad r0.yzw, v2.xxxx, cb0[r0.x + 4].xxyz, r0.yyzw
mad r0.yzw, v2.zzzz, cb0[r0.x + 6].xxyz, r0.yyzw
add r0.yzw, r0.yyzw, cb0[r0.x + 7].xxyz
add r1.xy, cb2[98].xyxx, l(3072.000000, 3072.000000, 0.000000, 0.000000)
add_sat r2.xyz, r0.yzwy, -cb2[98].xyzx
mul r1.z, r2.y, r2.x
mul r1.z, r2.z, r1.z
add_sat r1.xy, -r0.yzyy, r1.xyxx
mul r1.x, r1.y, r1.x
eq r1.xz, r1.xxzx, l(0.000000, 0.000000, 0.000000, 0.000000)
or r1.x, r1.x, r1.z
if_z r1.x
  add r0.w, r0.w, -cb2[98].z
  mul r1.xy, r0.yzyy, l(0.333333343, 0.333333343, 0.000000, 0.000000)
  round_ni r1.xyzw, r1.xxyy
  mul r2.xy, r1.ywyy, l(0.000976562500, 0.000976562500, 0.000000, 0.000000)
  mad r3.xyzw, r1.ywyw, l(0.000976562500, 0.000976562500, 0.000976562500, 0.000976562500), l(0.000976562500, 0.000000, 0.000000, 0.000976562500)
  mad r2.zw, r1.yyyw, l(0.000000, 0.000000, 0.000976562500, 0.000976562500), l(0.000000, 0.000000, 0.000976562500, 0.000976562500)
  sample_l_indexable(texture2d)(float,float,float,float) r2.xy, r2.xyxx, t0.xyzw, s9, l(0.000000)
  sample_l_indexable(texture2d)(float,float,float,float) r3.xy, r3.xyxx, t0.xyzw, s9, l(0.000000)
  sample_l_indexable(texture2d)(float,float,float,float) r3.zw, r3.zwzz, t0.zwxy, s9, l(0.000000)
  sample_l_indexable(texture2d)(float,float,float,float) r4.xw, r2.zwzz, t0.yzwx, s9, l(0.000000)
  mov r5.x, r2.y
  mov r5.yz, r3.yywy
  mov r5.w, r4.x
  mad r5.xyzw, r5.xyzw, l(8192.000000, 8192.000000, 8192.000000, 8192.000000), cb2[99].xxxx
  mov r4.x, r2.x
  mov r4.yz, r3.xxzx
  mad r2.xyzw, r4.xyzw, l(1024.000000, 1024.000000, 1024.000000, 1024.000000), cb2[99].yyyy
  add r3.xyzw, -r2.xyzw, r5.xyzw
  add r3.xyzw, r0.wwww, -r3.xyzw
  mov_sat r4.xyzw, r3.xyzw
  mul r4.xy, r4.zwzz, r4.xyxx
  mul r4.x, r4.y, r4.x
  add_sat r6.xyzw, -r3.xyzw, l(150.000000, 150.000000, 150.000000, 150.000000)
  mul r4.yz, r6.zzwz, r6.xxyx
  mul r4.y, r4.z, r4.y
  eq r4.xy, r4.xyxx, l(0.000000, 0.000000, 0.000000, 0.000000)
  or r4.x, r4.y, r4.x
  if_z r4.x
    mad r1.xyzw, r0.yyzz, l(0.333333343, 0.333333343, 0.333333343, 0.333333343), -r1.xyzw
    add r4.xyzw, -r1.yyww, l(1.000000, 1.000000, 1.000000, 1.000000)
    max r3.xyzw, r3.xyzw, l(0.001000, 0.001000, 0.001000, 0.001000)
    mul r6.xyz, l(-1.000000, -1.000000, 1.000000, 0.000000), cb0[r0.x + 6].xyzx
    dp3 r0.y, r6.xyzx, r6.xyzx
    div r6.xyz, r6.xyzx, r0.yyyy
    mul r7.xyzw, r3.xyzw, l(0.400000, 0.400000, 0.400000, 0.400000)
    mul r8.xyzw, r3.xyzw, l(0.200000, 0.200000, 0.200000, 0.200000)
    mul r3.xyzw, r3.xyzw, cb2[97].xxxx
    sqrt r3.xyzw, r3.xyzw
    mul r2.xyzw, r2.xyzw, cb2[97].xxxx
    sqrt r2.xyzw, r2.xyzw
    add r2.xyzw, -r3.xyzw, r2.xyzw
    mul r2.xyzw, r2.xyzw, cb2[97].yyyy
    mul r2.xyzw, r2.xyzw, l(3.000000, 3.000000, 3.000000, 3.000000)
    div_sat r2.xyzw, r2.xyzw, r7.xyzw
    add r2.xyzw, r2.xyzw, l(-0.500000, -0.500000, -0.500000, -0.500000)
    add r2.xyzw, r2.xyzw, r2.xyzw
    mad r2.xyzw, -r2.xyzw, r2.xyzw, l(1.000000, 1.000000, 1.000000, 1.000000)
    add r3.xyzw, r0.wwww, -r5.xyzw
    max r3.xyzw, r3.xyzw, l(0.000000, 0.000000, 0.000000, 0.000000)
    mad r2.xyzw, r2.xyzw, r8.xyzw, -r3.xyzw
    mul r1.xyzw, r1.xyzw, r2.ywzw
    mad r1.xyzw, r2.xzxy, r4.xyzw, r1.xyzw
    add r0.y, r1.z, r1.x
    add r0.y, r1.y, r0.y
    add r0.y, r1.w, r0.y
    mul r0.y, r0.y, l(0.250000)
    mad r0.yzw, r6.xxyz, r0.yyyy, v2.xxyz
  else 
    mov r0.yzw, v2.xxyz
  endif 
else 
  mov r0.yzw, v2.xxyz
endif 
add r0.yzw, r0.yyzw, -v2.xxyz
mad r0.yzw, v0.yyyy, r0.yyzw, v2.xxyz
mul r1.xyzw, r0.zzzz, cb0[r0.x + 5].xyzw
mad r1.xyzw, r0.yyyy, cb0[r0.x + 4].xyzw, r1.xyzw
mad r1.xyzw, r0.wwww, cb0[r0.x + 6].xyzw, r1.xyzw
add o1.xyzw, r1.xyzw, cb0[r0.x + 7].xyzw
mov o0.x, v3.x
ret 
// Approximately 85 instruction slots used
