//9c4d679e13f9eef5-ps.txt
//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.17672
//
//   using 3Dmigoto v1.2.27 on Sat Feb 13 00:39:00 2016
//
//
// Buffer Definitions: 
//
// cbuffer SceneBuffer
// {
//
//   row_major float4x4 View;           // Offset:    0 Size:    64
//   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
//   float4 DepthToView;                // Offset:  288 Size:    16
//   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
//   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 [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 [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 MaterialBuffer
// {
//
//   float4 MaterialParams[512];        // Offset:    0 Size:  8192
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// SamplerGenericTrilinearWrap       sampler      NA          NA   11        1
// p_default_Setup_8CD6AD409878073_cp6_Param_texture    texture  float4          2d    0        1
// p_default_Setup_n4_n114_458FBB301198422_cp2_Param_texture    texture  float4          2d    1        1
// p_default_Setup_n4_n69_Texture_texture    texture  float4          2d    2        1
// p_default_Setup_n4_1BB3530022408697_cp0_Param_texture    texture  float4          2d    4        1
// p_default_Setup_n9_n69_Texture_texture    texture  float4          2d    5        1
// p_default_Setup_n4_9075B4F026705685_cp2_Param_texture    texture  float4          2d    6        1
// p_default_Setup_n3_8B09DC7019763283_cp1_Param_texture    texture  float4          2d    7        1
// p_default_Setup_n9_1BB3530022408697_cp0_Param_texture    texture  float4          2d    8        1
// p_default_Setup_n5_1BB3530022408697_cp0_Param_texture    texture  float4          2d    9        1
// p_default_Setup_n5_n69_Texture_texture    texture  float4          2d   10        1
// p_default_Setup_n3_1BB3530022408697_cp0_Param_texture    texture  float4          2d   11        1
// p_default_Setup_n9_9075B4F026705685_cp2_Param_texture    texture  float4          2d   12        1
// p_default_Setup_n5_9075B4F026705685_cp2_Param_texture    texture  float4          2d   13        1
// p_default_Setup_n3_n69_Texture_texture    texture  float4          2d   14        1
// p_default_Setup_n3_n114_458FBB301198422_cp2_Param_texture    texture  float4          2d   15        1
// p_default_Setup_n9_8B09DF1018700059_cp0_Param_texture    texture  float4          2d   16        1
// SceneBuffer                       cbuffer      NA          NA    2        1
// MaterialBuffer                    cbuffer      NA          NA    3        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float   xy w
// TEXCOORD                 0   xyzw        1     NONE   float   xyzw
// TEXCOORD                 2   xyz         2     NONE   float   xyz 
// PSIZE                    0   x           3     NONE    uint       
//
//
// 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 cb2[46], immediateIndexed
dcl_constantbuffer cb2[82], immediateIndexed
dcl_constantbuffer cb3[18], immediateIndexed
dcl_sampler s11, 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) 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_resource_texture2d (float,float,float,float) t8
dcl_resource_texture2d (float,float,float,float) t9
dcl_resource_texture2d (float,float,float,float) t10
dcl_resource_texture2d (float,float,float,float) t11
dcl_resource_texture2d (float,float,float,float) t12
dcl_resource_texture2d (float,float,float,float) t13
dcl_resource_texture2d (float,float,float,float) t14
dcl_resource_texture2d (float,float,float,float) t15
dcl_resource_texture2d (float,float,float,float) t16
dcl_input_ps_siv linear noperspective v0.xyw, position
dcl_input_ps linear v1.xyzw
dcl_input_ps linear v2.xyz
dcl_output o0.xyzw
// dcl_temps 11
dcl_temps 13
dcl_resource_texture2d (float,float,float,float) t125
mul r0.xy, v1.xyxx, cb3[11].xyxx
sample_indexable(texture2d)(float,float,float,float) r0.xy, r0.xyxx, t9.xyzw, s11
mad r0.xy, r0.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
mad r0.z, -r0.x, r0.x, l(1.000000)
mad r0.z, -r0.y, r0.y, r0.z
mul r1.xy, r0.xyxx, r0.xyxx
max r0.w, r1.y, r1.x
mul r0.w, r0.w, l(0.0000610351563)
max r0.z, r0.w, r0.z
rsq r0.z, r0.z
mul r0.xy, r0.xyxx, -r0.zzzz
mul r0.zw, cb2[24].xxxx, cb3[11].zzzw
mad r0.zw, v1.xxxy, cb3[10].zzzw, r0.zzzw
sample_indexable(texture2d)(float,float,float,float) r0.zw, r0.zwzz, t15.zwxy, s11
mad r0.zw, r0.zzzw, l(0.000000, 0.000000, 2.000000, 2.000000), l(0.000000, 0.000000, -1.000000, -1.000000)
mad r1.x, -r0.z, r0.z, l(1.000000)
mad r1.x, -r0.w, r0.w, r1.x
mul r1.yz, r0.zzwz, r0.zzwz
max r1.y, r1.z, r1.y
mul r1.y, r1.y, l(0.0000610351563)
max r1.x, r1.y, r1.x
rsq r1.x, r1.x
mul r0.zw, r0.zzzw, -r1.xxxx
mul r0.zw, r0.zzzw, cb3[14].wwww
mul r1.xy, v1.xyxx, cb3[7].zwzz
sample_indexable(texture2d)(float,float,float,float) r1.xy, r1.xyxx, t11.xyzw, s11
mad r1.xy, r1.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
mad r1.z, -r1.x, r1.x, l(1.000000)
mad r1.z, -r1.y, r1.y, r1.z
mul r2.xy, r1.xyxx, r1.xyxx
max r1.w, r2.y, r2.x
mul r1.w, r1.w, l(0.0000610351563)
max r1.z, r1.w, r1.z
rsq r1.z, r1.z
mul r1.xy, r1.xyxx, -r1.zzzz
mad r0.zw, r1.xxxy, cb3[17].xxxx, r0.zzzw
mul r1.xyzw, v1.zwxy, cb3[9].zwxy
mad r1.zw, cb2[24].xxxx, cb3[10].xxxy, r1.zzzw
sample_indexable(texture2d)(float,float,float,float) r2.xyz, r1.xyxx, t0.xyzw, s11
sample_indexable(texture2d)(float,float,float,float) r1.xy, r1.zwzz, t1.xyzw, s11
mad r1.xy, r1.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
mad r1.z, -r1.x, r1.x, l(1.000000)
mad r1.z, -r1.y, r1.y, r1.z
mul r3.xy, r1.xyxx, r1.xyxx
max r1.w, r3.y, r3.x
mul r1.w, r1.w, l(0.0000610351563)
max r1.z, r1.w, r1.z
rsq r1.z, r1.z
mul r1.xy, r1.xyxx, -r1.zzzz
mul r1.xy, r1.xyxx, cb3[12].zzzz
mul r3.xyzw, v1.xyxy, cb3[3].xyzw
sample_indexable(texture2d)(float,float,float,float) r1.zw, r3.xyxx, t4.zwxy, s11
mad r1.zw, r1.zzzw, l(0.000000, 0.000000, 2.000000, 2.000000), l(0.000000, 0.000000, -1.000000, -1.000000)
mad r2.w, -r1.z, r1.z, l(1.000000)
mad r2.w, -r1.w, r1.w, r2.w
mul r3.xy, r1.zwzz, r1.zwzz
max r3.x, r3.y, r3.x
mul r3.x, r3.x, l(0.0000610351563)
max r2.w, r2.w, r3.x
rsq r2.w, r2.w
mul r1.zw, r1.zzzw, -r2.wwww
mad r1.xy, r1.zwzz, cb3[13].yyyy, r1.xyxx
add_sat r1.z, cb3[15].x, cb3[16].w
mad r1.xy, -r1.zzzz, r0.zwzz, r1.xyxx
mul r0.zw, r0.zzzw, r1.zzzz
mad_sat r4.x, r2.x, cb3[13].x, cb3[12].w
mul r5.xyzw, v1.xyxy, cb3[6].xyzw
sample_indexable(texture2d)(float,float,float,float) r4.y, r5.zwzz, t6.yxzw, s11
sample_indexable(texture2d)(float,float,float,float) r1.w, r5.xyxx, t14.xzwy, s11
mov r4.z, l(1.000000)
dp3_sat r2.x, cb3[1].xyzx, r4.xyzx
mad r0.zw, r2.xxxx, r1.xxxy, r0.zzzw
mad r0.xy, r0.xyxx, cb3[1].wwww, -r0.zwzz
mad_sat r4.x, r2.z, cb3[2].w, cb3[12].x
mad_sat r5.x, r2.y, cb3[15].y, cb3[15].z
mul r6.xyzw, v1.xyxy, cb3[8].xyzw
sample_indexable(texture2d)(float,float,float,float) r4.y, r6.zwzz, t13.yxzw, s11
sample_indexable(texture2d)(float,float,float,float) r1.x, r6.xyxx, t2.yxzw, s11
mov r4.zw, l(0,0,1.000000,1.000000)
dp3_sat r1.y, cb3[2].xyzx, r4.xyzx
mad r0.xy, r1.yyyy, r0.xyxx, r0.zwzz
sample_indexable(texture2d)(float,float,float,float) r0.z, v1.xyxx, t16.yzxw, s11
add r0.z, r0.z, l(-0.500000)
mul r0.z, r0.z, cb3[16].y
mad r2.yz, v0.xxyx, cb2[45].zzwz, cb2[45].xxyx
mad r3.xy, r2.yzyy, cb2[18].xyxx, cb2[18].zwzz
mul r4.xy, r2.yzyy, v0.wwww
mul r6.xy, r3.xyxx, v0.wwww
mov r6.z, v0.w

//View space correction, therefore need the InvProj._m00
ld_indexable(texture2d)(float,float,float,float) r12.xyzw, l(0, 0, 0, 0), t125.xyzw
add r12.w, v0.w, -r12.y
mul r12.w, r12.w, r12.x
mul r12.w, r12.w, cb2[81].x
add r6.x, r6.x, -r12.w


dp3 r0.w, -r6.xyzx, -r6.xyzx
rsq r0.w, r0.w
mul r2.yzw, r0.wwww, -r6.xxyz
dp3 r6.z, r2.yzwy, cb2[2].xyzx
dp3 r6.x, r2.yzwy, cb2[0].xyzx
dp3 r6.y, r2.yzwy, cb2[1].xyzx
mov r4.z, v0.w
dp4 r0.w, cb2[15].xyzw, r4.xyzw
deriv_rty_fine r7.y, r0.w
deriv_rtx_fine r8.x, r0.w
dp4 r0.w, cb2[16].xyzw, r4.xyzw
dp4 r2.y, cb2[17].xyzw, r4.xyzw
deriv_rty_fine r7.z, r0.w
deriv_rtx_fine r8.y, r0.w
deriv_rty_fine r7.x, r2.y
deriv_rtx_fine r8.z, r2.y
dp3 r0.w, v2.xyzx, v2.xyzx
rsq r0.w, r0.w
mul r2.yzw, r0.wwww, v2.xxyz
mul r4.xyz, r2.zwyz, r7.xyzx
mad r4.xyz, r7.zxyz, r2.wyzw, -r4.xyzx
dp3 r3.x, r4.xyzx, r6.xyzx
dp3 r4.x, r8.xyzx, r4.xyzx
mul r4.yzw, r8.yyzx, r2.wwyz
mad r4.yzw, r2.zzwy, r8.zzxy, -r4.yyzw
dp3 r3.y, r4.yzwy, r6.xyzx
dp3 r4.y, r6.xyzx, r2.yzwy
mul r4.yz, r2.yyzy, r4.yyyy
mad r4.yz, r4.yyzy, l(0.000000, 2.000000, 2.000000, 0.000000), -r6.xxyx
mul r4.yz, r4.yyzy, cb3[16].zzzz
sample_indexable(texture2d)(float,float,float,float) r4.y, r4.yzyy, t7.xyzw, s11
div r3.xy, r3.xyxx, r4.xxxx
deriv_rty_fine r6.xy, v1.xyxx
mul r4.xz, r3.yyyy, r6.xxyx
deriv_rtx_fine r9.xy, v1.xyxx
mad r3.xy, r3.xxxx, r9.xyxx, r4.xzxx
mul r3.xy, r3.xyxx, cb3[4].xyxx
mad r3.zw, r3.xxxy, r0.zzzz, r3.zzzw
mad r3.xy, r3.xyxx, r0.zzzz, v1.xyxx
mul r3.xy, r3.xyxx, cb3[7].xyxx
sample_indexable(texture2d)(float,float,float,float) r0.z, r3.xyxx, t5.xzyw, s11
sample_indexable(texture2d)(float,float,float,float) r3.xy, r3.zwzz, t8.xyzw, s11
mad r3.xy, r3.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
mad r3.z, -r3.x, r3.x, l(1.000000)
mad r3.z, -r3.y, r3.y, r3.z
mul r4.xz, r3.xxyx, r3.xxyx
max r3.w, r4.z, r4.x
mul r3.w, r3.w, l(0.0000610351563)
max r3.z, r3.w, r3.z
rsq r3.z, r3.z
mul r3.xy, r3.xyxx, -r3.zzzz
mad r3.xy, r3.xyxx, cb3[14].zzzz, -r0.xyxx
mul r10.xyzw, v1.xyxy, cb3[5].zwxy
sample_indexable(texture2d)(float,float,float,float) r5.y, r10.zwzz, t12.yxzw, s11
sample_indexable(texture2d)(float,float,float,float) r3.z, r10.xyxx, t7.yzxw, s11
mul r3.z, r3.z, cb3[16].x
mul_sat r3.z, r3.z, r4.y
mov r5.z, l(1.000000)
dp3_sat r3.w, cb3[0].xyzx, r5.xyzx
mad r0.xy, r3.wwww, r3.xyxx, r0.xyxx
mul r3.x, r6.x, r9.y
mad r3.x, r9.x, r6.y, -r3.x
mov r6.z, -r9.y
lt r3.y, r3.x, l(0.000000)
lt r3.x, l(0.000000), |r3.x|
movc r3.y, r3.y, l(-1.000000), l(1.000000)
mul r4.xy, r6.yzyy, r3.yyyy
dp3 r4.z, r7.yzxy, r2.yzwy
mad r5.xyz, -r4.zzzz, r2.yzwy, r7.yzxy
mul r4.yzw, r4.yyyy, r5.xxyz
dp3 r5.w, r8.xyzx, r2.yzwy
mad r6.xyz, -r5.wwww, r2.zwyz, r8.yzxy
mad r4.xyz, r6.zxyz, r4.xxxx, r4.yzwy
dp3 r4.w, r4.xyzx, r4.xyzx
rsq r4.w, r4.w
mul r7.xyz, r4.wwww, r4.xyzx
movc r4.xyz, r3.xxxx, r7.xyzx, r4.xyzx
mul r7.xyz, r2.wyzw, r4.yzxy
mad r7.xyz, r2.zwyz, r4.zxyz, -r7.xyzx
mul r8.xyz, r2.wyzw, r6.xyzx
mad r2.yzw, r2.zzwy, r6.yyzx, -r8.xxyz
dp3 r2.y, r5.xyzx, r2.yzwy
lt r2.y, r2.y, l(0.000000)
movc r2.y, r2.y, l(-1.000000), l(1.000000)
mul r2.y, r2.y, r3.y
mul r2.yzw, r2.yyyy, r7.xxyz
mul r2.yzw, r0.yyyy, r2.yyzw
mad r2.yzw, r0.xxxx, r4.xxyz, r2.yyzw
mad r0.xyw, v2.xyxz, r0.wwww, -r2.yzyw
dp3 r2.y, r0.xywx, r0.xywx
rsq r2.y, r2.y
mul o0.xyz, r0.xywx, r2.yyyy
add r0.x, -cb3[17].z, cb3[17].y
mad r0.x, r1.w, r0.x, cb3[17].z
add r0.y, -r0.x, cb3[15].w
mad r0.x, r3.z, r0.y, r0.x
add r0.x, r0.x, l(-1.000000)
mad r0.x, r1.z, r0.x, l(1.000000)
add r0.y, -cb3[13].w, cb3[13].z
mad r0.y, r1.x, r0.y, cb3[13].w
add r0.y, -r0.x, r0.y
mad r0.x, r2.x, r0.y, r0.x
mul r0.yw, v1.xxxy, cb3[4].zzzw
sample_indexable(texture2d)(float,float,float,float) r0.y, r0.ywyy, t10.xyzw, s11
add r0.w, cb3[0].w, -cb3[12].y
mad r0.y, r0.y, r0.w, cb3[12].y
add r0.y, -r0.x, r0.y
mad r0.x, r1.y, r0.y, r0.x
add r0.y, -cb3[14].x, cb3[14].y
mad r0.y, r0.z, r0.y, cb3[14].x
add r0.y, -r0.x, r0.y
mad r0.x, r3.w, r0.y, r0.x
max r0.x, r0.x, l(2.000000)
log r0.x, r0.x
add r0.x, r0.x, l(-1.000000)
mul r0.x, r0.x, l(0.0833333358)
min o0.w, r0.x, l(1.000000)
ret 
// Approximately 207 instruction slots used
