//2a357b40861851ed-ps.txt
//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.17672
//
//   using 3Dmigoto v1.2.27 on Thu Feb 04 21:49:38 2016
//
//
// Buffer Definitions: 
//
// 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
//   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
//   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_n10_007A0A6021048938_cp0_Param_texture    texture  float4          2d    1        1
// p_default_Setup_n10_007A886020185869_cp0_Param_texture    texture  float4          2d    2        1
// p_default_Setup_n9_1BB3530022408697_cp0_Param_texture    texture  float4          2d    3        1
// p_default_Setup_n9_9075B4F026705685_cp2_Param_texture    texture  float4          2d    4        1
// p_default_Setup_n5_n88_Texture_texture    texture  float4          2d    5        1
// p_default_Setup_n5_1BB3530022408697_cp0_Param_texture    texture  float4          2d    6        1
// p_default_Setup_n5_9075B4F026705685_cp2_Param_texture    texture  float4          2d    7        1
// p_default_Setup_n4_n88_Texture_texture    texture  float4          2d    9        1
// p_default_Setup_n4_1BB3530022408697_cp0_Param_texture    texture  float4          2d   10        1
// p_default_Setup_n4_9075B4F026705685_cp2_Param_texture    texture  float4          2d   11        1
// p_default_Setup_n3_n88_Texture_texture    texture  float4          2d   12        1
// p_default_Setup_n3_1BB3530022408697_cp0_Param_texture    texture  float4          2d   13        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   xy  
// 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[20], 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) 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_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_input_ps_siv linear noperspective v0.xyw, position
dcl_input_ps linear v1.xy
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.xyzw, v1.xyxy, cb3[11].zwxy
sample_indexable(texture2d)(float,float,float,float) r0.zw, r0.zwzz, t3.zwxy, s11
sample_indexable(texture2d)(float,float,float,float) r0.x, r0.xyxx, t5.yxzw, s11
mad r0.yz, r0.zzwz, l(0.000000, 2.000000, 2.000000, 0.000000), l(0.000000, -1.000000, -1.000000, 0.000000)
mad r0.w, -r0.y, r0.y, l(1.000000)
mad r0.w, -r0.z, r0.z, r0.w
mul r1.xy, r0.yzyy, r0.yzyy
max r1.x, r1.y, r1.x
mul r1.x, r1.x, l(0.0000610351563)
max r0.w, r0.w, r1.x
rsq r0.w, r0.w
mul r0.yz, r0.yyzy, -r0.wwww
mul r1.xy, v1.xyxx, cb3[9].zwzz
sample_indexable(texture2d)(float,float,float,float) r1.xy, r1.xyxx, t6.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 r0.w, -r1.x, r1.x, l(1.000000)
mad r0.w, -r1.y, r1.y, r0.w
mul r1.zw, r1.xxxy, r1.xxxy
max r1.z, r1.w, r1.z
mul r1.z, r1.z, l(0.0000610351563)
max r0.w, r0.w, r1.z
rsq r0.w, r0.w
mul r1.xy, r1.xyxx, -r0.wwww
mul r2.xyzw, v1.xyxy, cb3[7].zwxy
sample_indexable(texture2d)(float,float,float,float) r1.zw, r2.zwzz, t10.zwxy, s11
sample_indexable(texture2d)(float,float,float,float) r0.w, r2.xyxx, t12.xzwy, 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.x, -r1.z, r1.z, l(1.000000)
mad r2.x, -r1.w, r1.w, r2.x
mul r2.yz, r1.zzwz, r1.zzwz
max r2.y, r2.z, r2.y
mul r2.y, r2.y, l(0.0000610351563)
max r2.x, r2.y, r2.x
rsq r2.x, r2.x
mul r1.zw, r1.zzzw, -r2.xxxx
mul r2.xy, v1.xyxx, cb3[12].zwzz
sample_indexable(texture2d)(float,float,float,float) r2.xy, r2.xyxx, t13.xyzw, s11
mad r2.xy, r2.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
mad r2.z, -r2.x, r2.x, l(1.000000)
mad r2.z, -r2.y, r2.y, r2.z
mul r3.xy, r2.xyxx, r2.xyxx
max r2.w, r3.y, r3.x
mul r2.w, r2.w, l(0.0000610351563)
max r2.z, r2.w, r2.z
rsq r2.z, r2.z
mul r2.xy, r2.xyxx, -r2.zzzz
mul r2.xy, r2.xyxx, cb3[15].wwww
add_sat r2.z, cb3[1].w, cb3[16].x
mul r2.xy, r2.xyxx, r2.zzzz
mad r1.zw, r1.zzzw, cb3[17].xxxx, -r2.xxxy
mul r3.xy, v1.xyxx, cb3[6].zwzz
sample_indexable(texture2d)(float,float,float,float) r3.y, r3.xyxx, t11.yxzw, s11
mov r3.z, l(1.000000)
mad r4.xyzw, v0.xyxy, cb2[45].zwzw, cb2[45].xyxy
mul r4.xyzw, r4.xyzw, v0.wwww
mov r5.xy, r4.zwzz
mov r4.z, v0.w

//Screen space correction, therefore need the '0.5'
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, l(0.5)
add r5.x, r5.x, -r12.w


mov r4.w, l(1.000000)
mov r5.zw, r4.zzzw
dp4 r6.x, cb2[15].xyzw, r5.xyzw
dp4 r6.y, cb2[16].xyzw, r5.xyzw
dp4 r6.z, cb2[17].xyzw, r5.xyzw
mad r5.xyz, r6.xyzx, cb3[0].yyyy, cb3[5].xyzx
mul r7.x, r5.y, cb3[13].z
mad r7.z, -cb3[13].w, r5.z, l(1.000000)
sample_indexable(texture2d)(float,float,float,float) r7.xyz, r7.xzxx, t0.xyzw, s11
mul r8.x, r5.x, cb3[10].z
mad r8.z, -cb3[10].w, r5.y, l(1.000000)
sample_indexable(texture2d)(float,float,float,float) r8.xyz, r8.xzxx, t0.xyzw, s11
mul r9.x, r5.x, cb3[12].x
mad r9.z, -cb3[12].y, r5.z, l(1.000000)
sample_indexable(texture2d)(float,float,float,float) r5.xyz, r9.xzxx, t0.xyzw, s11
dp3 r2.w, v2.xyzx, v2.xyzx
rsq r2.w, r2.w
mul r9.xyz, r2.wwww, v2.xyzx
mul r10.xyz, |r9.xyzx|, cb3[3].xyzx
mul r5.xyz, r5.xyzx, r10.yyyy
mad r5.xyz, r8.xyzx, r10.zzzz, r5.xyzx
mad r5.xyz, r7.xyzx, r10.xxxx, r5.xyzx
mad_sat r3.x, r5.y, cb3[16].z, cb3[16].y
dp3_sat r3.x, cb3[2].xyzx, r3.xyzx
mad r1.zw, r3.xxxx, r1.zzzw, r2.xxxy
mad r1.xy, r1.xyxx, cb3[19].xxxx, -r1.zwzz
mul r2.xy, v1.xyxx, cb3[13].xyxx
sample_indexable(texture2d)(float,float,float,float) r3.z, r2.xyxx, t7.wyxz, s11
mov r3.w, l(1.000000)
mad_sat r3.y, r5.x, cb3[2].w, cb3[18].z
mad_sat r5.x, r5.z, cb3[14].z, cb3[14].w
dp3_sat r2.x, cb3[4].xyzx, r3.yzwy
mad r1.xy, r2.xxxx, r1.xyxx, r1.zwzz
mad r0.yz, r0.yyzy, cb3[5].wwww, -r1.xxyx
mul r1.zw, v1.xxxy, cb3[10].xxxy
sample_indexable(texture2d)(float,float,float,float) r5.y, r1.zwzz, t4.yxzw, s11
mov r5.z, l(1.000000)
dp3_sat r1.z, cb3[1].xyzx, r5.xyzx
mad r0.yz, r1.zzzz, r0.yyzy, r1.xxyx
deriv_rty_fine r5.xy, v1.xyxx
deriv_rtx_fine r1.xy, v1.xyxx
mul r1.w, r5.x, r1.y
mad r1.x, r1.x, r5.y, -r1.w
mov r5.z, -r1.y
lt r1.y, r1.x, l(0.000000)
lt r1.x, l(0.000000), |r1.x|
movc r1.y, r1.y, l(-1.000000), l(1.000000)
mul r3.yz, r5.yyzy, r1.yyyy
deriv_rty_fine r5.xyz, r6.xyzx
deriv_rtx_fine r6.xyz, r6.yzxy
dp3 r1.w, r5.xyzx, r9.xyzx
mad r5.xyz, -r1.wwww, r9.xyzx, r5.xyzx
mul r7.xyz, r3.zzzz, r5.xyzx
dp3 r1.w, r6.zxyz, r9.xyzx
mad r6.xyz, -r1.wwww, r9.yzxy, r6.xyzx
mad r3.yzw, r6.zzxy, r3.yyyy, r7.xxyz
dp3 r1.w, r3.yzwy, r3.yzwy
rsq r1.w, r1.w
mul r7.xyz, r1.wwww, r3.yzwy
movc r3.yzw, r1.xxxx, r7.xxyz, r3.yyzw
mul r7.xyz, r3.zwyz, r9.zxyz
mad r7.xyz, r9.yzxy, r3.wyzw, -r7.xyzx
mul r8.xyz, r6.xyzx, r9.zxyz
mad r6.xyz, r9.yzxy, r6.yzxy, -r8.xyzx
dp3 r1.x, r5.xyzx, r6.xyzx
lt r1.x, r1.x, l(0.000000)
movc r1.x, r1.x, l(-1.000000), l(1.000000)
mul r1.x, r1.x, r1.y
mul r1.xyw, r1.xxxx, r7.xyxz
mul r1.xyw, r0.zzzz, r1.xyxw
mad r1.xyw, r0.yyyy, r3.yzyw, r1.xyxw
dp4 r5.x, cb2[15].xyzw, r4.xyzw
dp4 r5.y, cb2[16].xyzw, r4.xyzw
dp4 r5.z, cb2[17].xyzw, r4.xyzw
mul r4.xyzw, r5.yzxz, l(0.005000, 0.005000, 0.005000, 0.005000)
mul r5.xyzw, cb2[24].xxxx, cb3[14].xyxy
mad r5.xyzw, cb3[9].xyxy, r4.xyzw, r5.xyzw
mad r5.xyzw, r5.zwxy, l(1.000000, -1.000000, 1.000000, -1.000000), l(0.000000, 1.000000, 0.000000, 1.000000)
sample_indexable(texture2d)(float,float,float,float) r0.yz, r5.xyxx, t2.zxyw, s11
sample_indexable(texture2d)(float,float,float,float) r3.yz, r5.zwzz, t2.zxyw, s11
mad r3.yz, r3.yyzy, l(0.000000, 2.000000, -2.000000, 0.000000), l(0.000000, -1.000000, 1.000000, 0.000000)
mad r0.yz, r0.yyzy, l(0.000000, 2.000000, -2.000000, 0.000000), l(0.000000, -1.000000, 1.000000, 0.000000)
mul r2.y, cb2[24].x, cb3[18].x
round_ni r2.y, r2.y
div r3.w, r2.y, cb3[8].z
round_z r3.w, r3.w
div r4.y, l(1.000000, 1.000000, 1.000000, 1.000000), cb3[8].z
mul r5.x, r2.y, r4.y
div r5.w, l(-1.000000), cb3[8].w
mov r5.yz, l(0,0,0,0)
mad r4.yw, r5.zzzw, r3.wwww, r5.xxxy
mad r4.xy, cb3[6].xyxx, r4.zxzz, r4.ywyy
add r4.z, -r4.y, l(1.000000)
sample_indexable(texture2d)(float,float,float,float) r4.xy, r4.xzxx, t1.xyzw, s11
lt r2.y, l(0.000000), r9.z
and r4.xy, r4.xyxx, r2.yyyy
mad r4.xy, r4.xyxx, l(2.000000, -2.000000, 0.000000, 0.000000), l(-1.000000, 1.000000, 0.000000, 0.000000)
add r5.xyz, |r9.xyzx|, l(-0.200000, -0.200000, -0.200000, 0.000000)
max r5.xyz, r5.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
mul r6.xyz, r5.xyzx, r5.xyzx
mul r5.xyw, r5.xyxz, r6.xyxz
add r2.y, r5.y, r5.x
mad r2.y, r5.z, r6.z, r2.y
div r5.xyz, r5.xywx, r2.yyyy
mul r2.y, r5.z, cb3[17].y
mul r4.zw, r5.yyyx, cb3[16].wwww
mul r3.w, r2.y, -r4.x
mad r5.x, -r0.y, r4.z, r3.w
mul r3.yz, -r3.yyzy, r4.wwww
mad r5.z, -r0.z, r4.z, r3.y
mad r5.y, -r4.y, r2.y, r3.z
dp3 r0.y, r5.xyzx, r9.xyzx
mad r3.yzw, -r0.yyyy, r9.xxyz, r5.xxyz
add r3.yzw, -r1.xxyw, r3.yyzw
mad r1.xyw, cb3[18].wwww, r3.yzyw, r1.xyxw
mad r1.xyw, v2.xyxz, r2.wwww, -r1.xyxw
dp3 r0.y, r1.xywx, r1.xywx
rsq r0.y, r0.y
mul o0.xyz, r0.yyyy, r1.xywx
add r0.y, -cb3[3].w, cb3[15].z
mad r0.y, r0.w, r0.y, cb3[3].w
add r0.y, r0.y, l(-1.000000)
mad r0.y, r2.z, r0.y, l(1.000000)
mul r0.zw, v1.xxxy, cb3[8].xxxy
sample_indexable(texture2d)(float,float,float,float) r0.z, r0.zwzz, t9.xzyw, s11
add r0.w, -cb3[17].w, cb3[17].z
mad r0.z, r0.z, r0.w, cb3[17].w
add r0.z, -r0.y, r0.z
mad r0.y, r3.x, r0.z, r0.y
add r0.z, -cb3[15].y, cb3[15].x
mad r0.x, r0.x, r0.z, cb3[15].y
add r0.x, -r0.y, r0.x
mad r0.x, r2.x, r0.x, r0.y
add r0.y, -r0.x, cb3[4].w
mad r0.x, r1.z, r0.y, r0.x
add r0.y, -r0.x, cb3[18].y
mad r0.x, cb3[18].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 200 instruction slots used
