//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.17672
//
//   using 3Dmigoto v1.2.27 on Mon Feb 08 02:06:25 2016
//
//
// Buffer Definitions: 
//
// cbuffer DrawableBuffer
// {
//
//   float4 FogColor;                   // Offset:    0 Size:    16 [unused]
//   float4 DebugColor;                 // Offset:   16 Size:    16 [unused]
//   float AlphaThreshold;              // Offset:   32 Size:     4
//   float4 __InstancedMaterialOpacity[256];// Offset:   48 Size:  4096 [unused]
//
// }
//
// 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
//   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
//   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
//   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 [unused]
//   float4 SnowParams02;               // Offset: 1568 Size:    16 [unused]
//   float4 SnowParams03;               // Offset: 1584 Size:    16 [unused]
//   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]
//
// }
//
// cbuffer LightBuffer
// {
//
//   struct Light
//   {
//       
//       float4 position;               // Offset:    0
//       float3 direction;              // Offset:   16
//       float4 attParams;              // Offset:   32
//       float4 spotParams;             // Offset:   48
//       float4 diffuseColor;           // Offset:   64
//       float4 shadowFadeParams;       // Offset:   80
//
//   } ShadowLights[3];                 // Offset:    0 Size:   288
//   
//   struct Light
//   {
//       
//       float4 position;               // Offset:  288
//       float3 direction;              // Offset:  304
//       float4 attParams;              // Offset:  320
//       float4 spotParams;             // Offset:  336
//       float4 diffuseColor;           // Offset:  352
//       float4 shadowFadeParams;       // Offset:  368
//
//   } NonShadowLights[3];              // Offset:  288 Size:   288 [unused]
//   
//   struct Light
//   {
//       
//       float4 position;               // Offset:  576
//       float3 direction;              // Offset:  592
//       float4 attParams;              // Offset:  608
//       float4 spotParams;             // Offset:  624
//       float4 diffuseColor;           // Offset:  640
//       float4 shadowFadeParams;       // Offset:  656
//
//   } SunLight;                        // Offset:  576 Size:    96 [unused]
//   row_major float4x4 WorldToShadowMap[3];// Offset:  672 Size:   192
//   row_major float3x4 WorldToModulationMapSpot[2];// Offset:  864 Size:    96 [unused]
//   row_major float2x4 WorldToModulationMapSun;// Offset:  960 Size:    32 [unused]
//   bool ShadowLightEnabled[3];        // Offset:  992 Size:    36 [unused]
//   bool NonShadowLightEnabled[3];     // Offset: 1040 Size:    36 [unused]
//   bool SunLightEnabled;              // Offset: 1088 Size:     4 [unused]
//   float4 LightAndProbeSet[24];       // Offset: 1104 Size:   384 [unused]
//   float4 LightSetInfo;               // Offset: 1488 Size:    16 [unused]
//   float4 ProbeSetInfo;               // Offset: 1504 Size:    16 [unused]
//
// }
//
// cbuffer InstanceBuffer
// {
//
//   struct InstanceStruct
//   {
//       
//       float4 InstanceParams[8];      // Offset:    0
//
//   } InstanceParameters[256];         // Offset:    0 Size: 32768
//
// }
//
// cbuffer xtendedInstanceBuffer
// {
//
//   struct ExtendedInstanceStruct
//   {
//       
//       float4 ExtendedInstanceParams[16];// Offset:    0
//
//   } ExtendedInstanceParameters[256]; // Offset:    0 Size: 65536
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// SamplerGenericPointClamp          sampler      NA          NA   10        1
// SamplerGenericBilinearClamp       sampler      NA          NA   13        1
// SamplerGenericShadowCompare     sampler_c      NA          NA   14        1
// p_default_Material_n9_NormalBufferTexture_texture    texture  float4          2d    0        1
// p_default_Material_n33_DeferredBufferTexture_texture    texture  float4          2d    1        1
// p_default_Material_7A7974CC1734462_DepthBufferTexture_texture    texture  float4          2d    2        1
// ShadowMapSampler_texture          texture  float4          2d   43        1
// AttenuationSampler_texture        texture  float4          2d   44        1
// DrawableBuffer                    cbuffer      NA          NA    1        1
// SceneBuffer                       cbuffer      NA          NA    2        1
// LightBuffer                       cbuffer      NA          NA    4        1
// InstanceBuffer                    cbuffer      NA          NA    5        1
// xtendedInstanceBuffer             cbuffer      NA          NA    8        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float   xy  
// TEXCOORD                 0   xyzw        1     NONE   float   xyzw
// PSIZE                    0   x           2     NONE    uint   x   
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_TARGET                0   xyzw        0   TARGET   float   xyzw
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb1[3], immediateIndexed
dcl_constantbuffer cb2[72], immediateIndexed
dcl_constantbuffer cb4[46], immediateIndexed
dcl_constantbuffer cb5[2043], dynamicIndexed
dcl_constantbuffer cb8[4081], dynamicIndexed
dcl_sampler s10, mode_default
dcl_sampler s13, mode_default
dcl_sampler s14, mode_comparison
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) t43
dcl_resource_texture2d (float,float,float,float) t44
dcl_input_ps_siv linear noperspective v0.xy, position
dcl_input_ps linear v1.xyzw
dcl_input_ps constant v2.x
dcl_output o0.xyzw
dcl_temps 8
mad r0.xy, v0.xyxx, cb2[45].zwzz, cb2[45].xyxx
sample_indexable(texture2d)(float,float,float,float) r1.xyzw, r0.xyxx, t0.xyzw, s10
dp3 r0.z, r1.xyzx, r1.xyzx
rsq r0.z, r0.z
mul r1.xyz, r0.zzzz, r1.xyzx
min r0.z, |r1.w|, l(1.000000)
mad r0.z, r0.z, l(12.000000), l(1.000000)
exp r0.z, r0.z
sample_l_indexable(texture2d)(float,float,float,float) r0.w, r0.xyxx, t2.yzwx, s10, l(0.000000)
sample_indexable(texture2d)(float,float,float,float) r0.x, r0.xyxx, t1.wxyz, s10
mad r0.y, r0.w, cb2[20].x, cb2[20].y
div r0.y, l(1.000000, 1.000000, 1.000000, 1.000000), r0.y
div r0.y, v1.w, r0.y
div r0.y, l(1.000000, 1.000000, 1.000000, 1.000000), r0.y
ishl r2.xy, v2.xxxx, l(3, 4, 0, 0)
mad r3.xyz, -v1.xyzx, r0.yyyy, cb5[r2.x + 1].xyzx
mul r4.xyz, r0.yyyy, v1.xyzx
dp3 r0.y, r3.xyzx, r3.xyzx
sqrt r0.y, r0.y
div r3.xyz, r3.xyzx, r0.yyyy
mad_sat r5.x, r0.y, cb5[r2.x + 0].y, cb4[2].z
dp3_sat r0.y, r3.xyzx, r1.xyzx
dp3 r0.w, -v1.xyzx, -v1.xyzx
rsq r0.w, r0.w
mul r6.xyz, r0.wwww, -v1.xyzx
mad r7.xyz, -v1.xyzx, r0.wwww, r3.xyzx
dp3 r0.w, cb5[r2.x + 2].xyzx, r3.xyzx
add r0.w, r0.w, cb5[r2.x + 0].z
mul_sat r0.w, r0.w, cb5[r2.x + 0].w
dp3_sat r1.w, r6.xyzx, r1.xyzx
min r2.z, r0.y, r1.w
div r0.y, r0.y, r1.w
eq r2.w, r1.w, r2.z
div r1.w, l(1.000000, 1.000000, 1.000000, 1.000000), r1.w
movc r0.y, r2.w, l(1.000000), r0.y
dp3 r2.w, r7.xyzx, r7.xyzx
rsq r2.w, r2.w
mul r3.xyz, r2.wwww, r7.xyzx
dp3_sat r1.x, r3.xyzx, r1.xyzx
dp3_sat r1.y, r6.xyzx, r3.xyzx
max r1.y, r1.y, l(1.192092896E-007)
add r1.z, r1.x, r1.x
log r1.x, r1.x
mul r0.yz, r0.yyzy, r1.zzxz
exp r0.z, r0.z
mul r1.x, r1.z, r2.z
ge r1.x, r1.y, r1.x
div r0.y, r0.y, r1.y
movc r0.y, r1.x, r0.y, r1.w
mul r0.y, r0.z, r0.y
mul r0.y, r0.y, cb4[4].w
mov r5.y, cb5[r2.x + 0].x
sample_l_indexable(texture2d)(float,float,float,float) r0.z, r5.xyxx, t44.xyzw, s13, l(0.000000)
mul r0.z, r0.w, r0.z
mul r0.y, r0.z, r0.y
mul r1.xyzw, r4.yyyy, cb4[43].xyzw
mad r1.xyzw, r4.xxxx, cb4[42].xyzw, r1.xyzw
mad r1.xyzw, r4.zzzz, cb4[44].xyzw, r1.xyzw
add r1.xyzw, r1.xyzw, cb4[45].xyzw
div r3.xyzw, r1.xyxy, r1.wwww
mad r5.xyzw, cb2[71].zwzw, l(-0.500000, 0.500000, 0.500000, 0.500000), r3.zwzw
mad r3.xyzw, cb2[71].zwzw, l(-0.500000, -0.500000, 0.500000, -0.500000), r3.xyzw
sample_c_lz_indexable(texture2d)(float,float,float,float) r0.z, r5.xyxx, t43.xxxx, s14, r1.z
sample_c_lz_indexable(texture2d)(float,float,float,float) r0.w, r5.zwzz, t43.xxxx, s14, r1.z
add r0.z, r0.w, r0.z
sample_c_lz_indexable(texture2d)(float,float,float,float) r0.w, r3.xyxx, t43.xxxx, s14, r1.z
sample_c_lz_indexable(texture2d)(float,float,float,float) r1.x, r3.zwzz, t43.xxxx, s14, r1.z
add r0.z, r0.w, r0.z
add r0.z, r1.x, r0.z
mul r0.z, r0.z, l(0.250000)
mov r4.w, l(1.000000)
dp4 r0.w, r4.xyzw, r4.xyzw
sqrt r0.w, r0.w
mad_sat r1.xy, r0.wwww, cb4[5].xyxx, cb4[5].zwzz
mad r0.z, r0.z, r1.x, r1.y
max r0.z, r0.z, cb8[r2.y + 0].x
mad r0.xyzw, r0.yyyy, r0.zzzz, r0.xxxx
add r1.x, r0.w, -cb1[2].x
mov o0.xyzw, r0.xyzw
lt r0.x, r1.x, l(0.000000)
discard_nz r0.x
ret 
// Approximately 82 instruction slots used
