//Shadows PS from cache.
//
// Generated by Microsoft (R) HLSL Shader Compiler 10.0.10011.16384
//
//   using 3Dmigoto v1.3.16 on Fri Jan 14 20:07:38 2022
//
//
// Buffer Definitions:
//
// cbuffer ConstBuf__viewData
// {
//
//   struct ViewData
//   {
//
//       float4x4 view;                 // Index:    0
//       float4x4 invView;              // Index:    4
//       float4x4 proj;                 // Index:    8
//       float4x4 invViewProjNoZReproj; // Index:   12
//       float4x4 viewProj;             // Index:   16
//       float4x4 invViewProj;          // Index:   20
//       float4x4 previousViewProj;     // Index:   24
//       float4 prevLodEyePos;          // Index:   28
//       float4 lodEyePos;              // Index:   29
//       float4 viewDirDepthBias;       // Index:   30
//       float3 eyePos;                 // Index:   31
//       float2 viewportSize;           // Index:   32
//       float2 invViewportSize;        // Index:   32.z
//       float4 mirrorPlaneWS;          // Index:   33
//       float2 mirrorViewportSize;     // Index:   34
//       float2 opaqueRefractionViewportSize;// Index:   34.z
//       float windTime;                // Index:   35
//       float deltaTime;               // Index:   35.y
//       float depthReprojectScale;     // Index:   35.z
//       float depthReprojectBias;      // Index:   35.w
//       uint shadowViewType;           // Index:   36
//       float normalDepthBias;         // Index:   36.y
//       float noNormalAA;              // Index:   36.z
//       float noNormalFromAlpha;       // Index:   36.w
//       float noOpaqueTransparency;    // Index:   37
//       float translucentAmount;       // Index:   37.y
//       uint framePhase;               // Index:   37.z
//       float cameraAmbientExposure;   // Index:   37.w
//       float fxExposure;              // Index:   38
//       float fxAmbientExposure;       // Index:   38.y
//       uint checkerboardPhase;        // Index:   38.z
//       float sparkleIntensityScale;   // Index:   38.w
//
//   } resourceTables__viewData;        // Index:    0-38             Components:   156
//
// }
//
// cbuffer ConstBuf__materialData
// {
//
//   struct MaterialData
//   {
//
//       float3 material_vertexoffset_matU;// Index:    0
//       float3 material_vertexoffset_matV;// Index:    1
//       float3 Layer0_emissive_matU;   // Index:    2
//       float3 Layer0_emissive_matV;   // Index:    3
//       float3 Layer0_alpha_matU;      // Index:    4
//       float3 Layer0_alpha_matV;      // Index:    5
//       float3 LayerX_emissive_matU;   // Index:    6
//       float3 LayerX_emissive_matV;   // Index:    7
//       float3 LayerX_alpha_matU;      // Index:    8
//       float3 LayerX_alpha_matV;      // Index:    9
//       float3 Layer1_alpha_matU;      // Index:   10
//       float3 Layer1_alpha_matV;      // Index:   11
//       float3 Layer2_alpha_matU;      // Index:   12
//       float3 Layer2_alpha_matV;      // Index:   13
//       float Layer2_cst_AlphaReference;// Index:   13.w
//
//   } resourceTables__materialData;    // Index:    0-13             Components:    56
                                        // Textures:  t41-t47
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// resourceTables__viewData__smpLowAniso    sampler      NA          NA    2        1
// resourceTables__materialData.Layer0_alpha    texture  float4          2d   43        1
// resourceTables__materialData.LayerX_alpha    texture  float4          2d   45        1
// resourceTables__materialData.Layer1_alpha    texture  float4          2d   47        1
// ConstBuf__viewData                cbuffer      NA          NA    3        1
// ConstBuf__materialData            cbuffer      NA          NA    4        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float   xyz
// VERT_ID                  0   x           1     NONE    uint
// TEXCOORD                 0   xy          2     NONE   float   xy
// NORMAL                   0   xyz         3     NONE   float   xyz
// TANGENT                  0   xyz         4     NONE   float
// BINORMAL                 0   xyz         5     NONE   float
// TEXCOORD                 5   xyzw        6     NONE   float   x
// TEXCOORD                 8   xyz         7     NONE   float
//
//
// 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 cb3[36], immediateIndexed
dcl_constantbuffer cb4[14], immediateIndexed
dcl_sampler s2, mode_default
dcl_resource_texture2d (float,float,float,float) t43
dcl_resource_texture2d (float,float,float,float) t45
dcl_resource_texture2d (float,float,float,float) t47
dcl_input_ps_siv linear noperspective v0.xyz, position
dcl_input_ps linear v2.xy
dcl_input_ps linear v3.xyz
dcl_input_ps linear v6.x
dcl_output o0.xyzw
dcl_temps 50
dcl_resource_texture2d (float,float,float,float) t125
ld_indexable(texture2d)(float,float,float,float) r40.xyzw, l(0, 0, 0, 0), t125.xyzw
mul r0.xy, v0.xyxx, cb3[32].zwzz
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, v0.z, cb3[35].z, cb3[35].w
rcp r0.z, r0.z
mov r1.z, -r0.z
mul r1.xy, r0.xyxx, r1.zzzz
mov r1.w, l(1.000000)

add r40.w, r1.z, -r40.y
mad r1.x, -r40.x, r40.w, r1.x

dp4 r2.x, r1.xyzw, cb3[12].xyzw
dp4 r2.y, r1.xyzw, cb3[13].xyzw
dp4 r2.z, r1.xyzw, cb3[14].xyzw
add r1.xyz, -r2.xyzx, cb3[29].xyzx

//Tessellation specular PS..
mul r41.xyz, r40.yyyy, cb3[16].xyzx
mul r41.w, cb3[16].x, cb3[16].x
mad r41.w, cb3[16].y, cb3[16].y, r41.w
mad r41.w, cb3[16].z, cb3[16].z, r41.w
div r41.xyz, r41.xyzx, r41.wwww
mad r1.x, r40.x, r41.x, r1.x
mad r1.y, r40.x, r41.y, r1.y
mad r1.z, r40.x, r41.z, r1.z

dp3 r0.z, r1.xyzx, r1.xyzx
rsq r0.z, r0.z
mul r1.xyz, r0.zzzz, r1.xyzx
dp3 r0.z, v3.xyzx, v3.xyzx
rsq r0.z, r0.z
mul r3.xyz, r0.zzzz, v3.xyzx
mov r4.xy, v2.xyxx
mov r4.z, l(1.000000)
dp3 r5.x, cb4[4].xyzx, r4.xyzx
dp3 r5.y, cb4[5].xyzx, r4.xyzx
dp3 r6.x, cb4[8].xyzx, r4.xyzx
dp3 r6.y, cb4[9].xyzx, r4.xyzx
dp3 r7.x, cb4[10].xyzx, r4.xyzx
dp3 r7.y, cb4[11].xyzx, r4.xyzx
dp3 r8.x, cb4[12].xyzx, r4.xyzx
dp3 r8.y, cb4[13].xyzx, r4.xyzx
sample_indexable(texture2d)(float,float,float,float) r0.z, r5.xyxx, t43.yzxw, s2
dp3 r0.w, r3.xyzx, r1.xyzx
dp2 r1.x, r0.xyxx, r0.xyxx
sqrt r1.x, r1.x
min r1.y, |r0.w|, l(1.000000)
log r1.y, r1.y
mul r1.y, r1.y, l(0.256348)
exp r1.y, r1.y
add_sat r1.x, -r1.x, l(2.000000)
mul r1.z, r1.x, r1.x
mad r1.x, -r1.x, l(2.000000), l(3.000000)
mul r1.x, r1.x, r1.z
mul r1.y, r1.x, r1.y
mul r0.z, r0.z, r1.y
mad_sat r0.z, r0.z, v6.x, l(-0.487671)
sample_indexable(texture2d)(float,float,float,float) r1.y, r6.xyxx, t45.yxzw, s2
mad_sat r1.y, r1.y, v6.x, l(-0.270996)
mad r0.z, r1.y, l(0.505737), r0.z
min r0.z, r0.z, l(1.000000)
sample_indexable(texture2d)(float,float,float,float) r1.y, r7.xyxx, t47.yxzw, s2
add r0.w, |r0.w|, l(-0.444458)
mul_sat r0.w, r0.w, l(1.800044)
log r0.w, r0.w
mul r0.w, r0.w, l(1.196290)
exp r0.w, r0.w
mul r0.w, r1.x, r0.w
mul r0.w, r0.w, r1.y
mad_sat r0.w, r0.w, v6.x, l(0.0246581994)
add r0.z, r0.w, r0.z
min r0.z, r0.z, l(1.000000)
sample_indexable(texture2d)(float,float,float,float) r0.w, r8.xyxx, t47.yzwx, s2
add r0.w, r0.w, -cb4[13].w
mul_sat r0.w, r0.w, l(2.35368323)
add r0.w, -r0.w, l(1.000000)
add r0.z, -r0.w, r0.z
max r0.z, r0.z, l(0.000000)
ge r0.w, l(0.000100), r0.z
discard_nz r0.w
lt r0.w, r0.z, l(0.040450)
mul r1.x, r0.z, l(0.0773993805)
add r0.z, r0.z, l(0.055000)
mul r0.z, r0.z, l(0.947867334)
log r0.z, r0.z
mul r0.z, r0.z, l(2.400000)
exp r0.z, r0.z
movc r0.z, r0.w, r1.x, r0.z
add r1.xyz, -r2.xyzx, cb3[31].xyzx

//Tessellation specular PS..
mul r41.xyz, r40.yyyy, cb3[16].xyzx
mul r41.w, cb3[16].x, cb3[16].x
mad r41.w, cb3[16].y, cb3[16].y, r41.w
mad r41.w, cb3[16].z, cb3[16].z, r41.w
div r41.xyz, r41.xyzx, r41.wwww
mad r1.x, r40.x, r41.x, r1.x
mad r1.y, r40.x, r41.y, r1.y
mad r1.z, r40.x, r41.z, r1.z

dp3 r0.w, r1.xyzx, r1.xyzx
rsq r0.w, r0.w
mul r1.xyz, r0.wwww, r1.xyzx
dp3 r0.w, -r1.xyzx, r3.xyzx
add r0.w, r0.w, r0.w
mad r1.xyz, r3.xyzx, -r0.wwww, -r1.xyzx
mad r1.xyz, r1.xyzx, l(-0.150000, -0.150000, -0.150000, 0.000000), r2.xyzx
mov r1.w, l(1.000000)
dp4 r3.x, r1.xyzw, cb3[16].xyzw
dp4 r3.y, r1.xyzw, cb3[17].xyzw
dp4 r0.w, r1.xyzw, cb3[19].xyzw

add r40.w, r0.w, -r40.y
mad r3.x, r40.x, r40.w, r3.x

div r1.xy, r3.xyxx, r0.wwww
add r1.xy, -r0.xyxx, r1.xyxx
mul r0.zw, r0.zzzz, r1.xxxy
mul r0.xy, r0.xyxx, r0.xyxx
mul r0.xy, r0.xyxx, r0.xyxx
mad r0.xy, -r0.xyxx, r0.xyxx, l(1.000000, 1.000000, 0.000000, 0.000000)
mul r0.xy, r0.xyxx, r0.zwzz
dp2 r0.z, r0.xyxx, r0.xyxx
sqrt r0.z, r0.z
mul r0.z, r0.z, l(50.000000)
mov r2.w, l(1.000000)
dp4 r0.w, r2.xyzw, cb3[2].xyzw
mov o0.w, -r0.w
ftou r1.xy, v0.xyxx
and r1.xy, r1.xyxx, l(1, 1, 0, 0)
ine r0.w, r1.y, r1.x
movc o0.z, r0.w, l(-1.000000), r0.z
mov o0.xy, r0.xyxx
ret
// Approximately 104 instruction slots used
