//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:08:21 2022
//
//
// Buffer Definitions:
//
// cbuffer ConstBuf__modelData
// {
//
//   struct ModelData
//   {
//
//       uint lightGroupID;             // Index:    0
//       uint modelFlags;               // Index:    0.y
//       float lodFade;                 // Index:    0.z
//       float displacementBlend;       // Index:    0.w
//       int turbulenceDataIdx;         // Index:    1
//       int instanceOffset;            // Index:    1.y
//       int characterFxIdx;            // Index:    1.z
//       uint debugRenderChannel;       // Index:    1.w
//       uint decayWriteOffset;         // Index:    2
//       uint decayWriteMaxCount;       // Index:    2.y
//       uint decayAtomicCounterIndex;  // Index:    2.z
//       float modelAlpha;              // Index:    2.w
//       float emissiveScale;           // Index:    3
//       float desaturationScale;       // Index:    3.y
//       float decayCoverageEstimation; // Index:    3.z
//       float3 quantScale;             // Index:    4
//       float3 quantBias;              // Index:    5
//
//   } resourceTables__modelData;       // Index:    0-5.z            Components:    23
//
// }
//
// 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
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// resourceTables__viewData__smpLinear    sampler      NA          NA    1        1
// resourceTables__viewData__smpLowAniso    sampler      NA          NA    2        1
// resourceTables__materialData.material_dudv1    texture  float4          2d   11        1
// resourceTables__materialData.layer_0__diffuse    texture  float4          2d   17        1
// resourceTables__materialData.layer_1__alpha    texture  float4          2d   20        1
// resourceTables__materialData.layer_2__normal    texture  float4          2d   21        1
// ConstBuf__modelData               cbuffer      NA          NA    1        1
// ConstBuf__viewData                cbuffer      NA          NA    3        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
// TEXCOORD                 1   xy          3     NONE   float
// NORMAL                   0   xyz         4     NONE   float   xyz
// TANGENT                  0   xyz         5     NONE   float   xyz
// BINORMAL                 0   xyz         6     NONE   float   xyz
// TEXCOORD                 8   xyz         7     NONE   float   xyz
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target                0   xyzw        0   TARGET   float   xyzw
// SV_Target                1   xyzw        1   TARGET   float   xyzw
// SV_Target                2   xyzw        2   TARGET   float   xyzw
// SV_Target                3   xyzw        3   TARGET   float   xyzw
// SV_Target                4   xy          4   TARGET   float   xy
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb1[4], immediateIndexed
dcl_constantbuffer cb3[38], immediateIndexed
dcl_sampler s1, mode_default
dcl_sampler s2, mode_default
dcl_resource_texture2d (float,float,float,float) t11
dcl_resource_texture2d (float,float,float,float) t17
dcl_resource_texture2d (float,float,float,float) t20
dcl_resource_texture2d (float,float,float,float) t21
dcl_input_ps_siv linear noperspective v0.xyz, position
dcl_input_ps linear v2.xy
dcl_input_ps linear v4.xyz
dcl_input_ps linear v5.xyz
dcl_input_ps linear v6.xyz
dcl_input_ps linear v7.xyz
dcl_output o0.xyzw
dcl_output o1.xyzw
dcl_output o2.xyzw
dcl_output o3.xyzw
dcl_output o4.xy
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, v4.xyzx, v4.xyzx
rsq r0.z, r0.z
mul r2.xyz, r0.zzzz, v4.xyzx
mul r0.zw, v2.xxxy, l(0.000000, 0.000000, 4.000000, 4.000000)
sample_indexable(texture2d)(float,float,float,float) r0.zw, r0.zwzz, t11.zwxy, s1
mad r3.xyzw, r0.zwzw, l(2.000000, 2.000000, 2.000000, 2.000000), l(-0.996078432, -0.996078432, -0.996078432, -0.996078432)
mul r0.z, l(10.000000), cb3[35].x
frc r0.z, r0.z
add r0.w, r0.z, l(-0.500000)
add r1.w, l(0.050000), cb3[35].x
mul r1.w, r1.w, l(10.000000)
frc r1.w, r1.w
add r1.w, r1.w, l(-0.500000)
mul r0.z, r0.z, l(6.28318548)
sincos null, r0.z, r0.z
mad r0.z, r0.z, l(0.500000), l(0.500000)
mad r4.xyzw, r3.zwzw, r0.wwww, v2.xyxy
mad r3.xyzw, r3.xyzw, r1.wwww, v2.xyxy
mul r4.xyzw, r4.xyzw, l(20.000000, 20.000000, 10.000000, 10.000000)
mul r3.xyzw, r3.xyzw, l(20.000000, 20.000000, 10.000000, 10.000000)
sample_indexable(texture2d)(float,float,float,float) r5.xyz, r4.xyxx, t17.xyzw, s1
sample_indexable(texture2d)(float,float,float,float) r6.xyz, r3.xyxx, t17.xyzw, s1
add r6.xyz, -r5.xyzx, r6.xyzx
mad r5.xyz, r0.zzzz, r6.xyzx, r5.xyzx
mul r6.xyz, r5.xyzx, l(0.500000, 0.495568514, 0.298601, 0.000000)
sample_indexable(texture2d)(float,float,float,float) r0.w, r4.zwzz, t20.yzwx, s2
sample_indexable(texture2d)(float,float,float,float) r1.w, r3.zwzz, t20.yzwx, s2
add r1.w, -r0.w, r1.w
mad r0.z, r0.z, r1.w, r0.w
dp3 r0.w, r2.xyzx, r1.xyzx
dp2 r1.x, r0.xyxx, r0.xyxx
sqrt r1.x, r1.x
add r1.x, -r1.x, l(1.000000)
add r0.w, |r0.w|, l(-0.100000)
mul_sat r0.w, r0.w, l(1.11111116)
log r0.w, r0.w
mul r0.w, r0.w, l(0.300000)
exp r0.w, r0.w
add r0.w, -r0.w, l(1.000000)
mul_sat r1.x, r1.x, l(5.018821)
mul r1.y, r1.x, r1.x
mad r1.x, -r1.x, l(2.000000), l(3.000000)
mul r1.x, r1.x, r1.y
mul r0.w, r0.w, r1.x
mul_sat r0.z, r0.w, r0.z
lt r0.w, l(0.000000), r0.z
if_nz r0.w
  mad r0.w, r0.z, l(-0.339999974), l(0.390000)
  mad r6.xyz, r5.xyzx, l(0.500000, 0.495568514, 0.298601, 0.000000), r0.zzzz
else
  mov r0.w, l(0.390000)
endif
sample_indexable(texture2d)(float,float,float,float) r1.xyz, v2.xyxx, t21.xyzw, s2
mad r1.xyz, r1.xyzx, l(2.007874, 2.007874, 2.007874, 0.000000), l(-1.007874, -1.007874, -1.007874, 0.000000)
dp3 r0.z, r1.xyzx, r1.xyzx
sqrt r0.z, r0.z
max r0.z, r0.z, l(0.000010)
rcp r1.w, r0.z
mul r1.xyz, r1.wwww, r1.xyzx
mul r3.xyz, r1.zzzz, l(0.000000, 0.000000, 4.000000, 0.000000)
div r3.xyz, r3.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000)
mad r1.xyz, -r1.xyzx, l(-1.000000, -1.000000, 1.000000, 0.000000), r3.xyzx
min r3.x, r0.z, l(1.000000)
dp3 r0.z, v5.xyzx, v5.xyzx
rsq r0.z, r0.z
mul r4.xyz, r0.zzzz, v5.xyzx
dp3 r0.z, v6.xyzx, v6.xyzx
rsq r0.z, r0.z
mul r5.xyz, r0.zzzz, v6.xyzx
dp3 r0.z, r1.xyzx, r1.xyzx
rsq r0.z, r0.z
mul r1.xyz, r0.zzzz, r1.xyzx
mul r5.xyz, r5.xyzx, r1.yyyy
mad r1.xyw, r1.xxxx, r4.xyxz, r5.xyxz
mad r1.xyz, r1.zzzz, r2.xyzx, r1.xywx
dp3 r0.z, r1.xyzx, r1.xyzx
rsq r0.z, r0.z
mul r1.xyz, r0.zzzz, r1.xyzx
ne r0.z, l(0.000000, 0.000000, 0.000000, 0.000000), cb3[36].z
deriv_rtx_fine r4.xyz, r2.xyzx
deriv_rty_fine r2.xyz, r2.xyzx
dp3 r1.w, r4.xyzx, r4.xyzx
dp3 r2.x, r2.xyzx, r2.xyzx
add r1.w, r1.w, r2.x
min r3.y, r1.w, l(0.300000)
movc r2.xy, r0.zzzz, l(1.000000,0,0,0), r3.xyxx
add r0.z, -r0.w, l(1.000000)
mul r0.z, r0.z, r0.z
max r0.w, r2.x, l(0.600000)
mad r0.w, r0.w, l(-0.527635), l(0.520718)
max r0.w, r0.w, l(0.000000)
mad r0.z, r0.z, r0.z, r0.w
add r0.z, r2.y, r0.z
sqrt r0.z, r0.z
min r0.z, r0.z, l(1.000000)
sqrt r0.z, r0.z
add o2.z, -r0.z, l(1.000000)
mul r0.z, l(0.900000), cb3[37].w
exp r0.z, r0.z
mul r2.yzw, r0.zzzz, r6.xxyz
mul r2.yzw, r2.yyzw, cb1[3].xxxx
and r0.z, l(8), cb1[0].y
max r0.w, r2.w, r2.z
max r0.w, r0.w, r2.y
lt r0.w, l(0.0000153787005), r0.w
add r1.w, r2.x, l(-0.950000)
mul o1.w, r1.w, l(20.000000)
mad o1.xyz, r1.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000), l(0.500000, 0.500000, 0.500000, 0.000000)
movc r0.z, r0.z, l(1), l(0)
and r1.x, r0.w, l(2)
iadd r0.z, r0.z, r1.x
iadd r0.z, r0.z, l(28)
utof r0.z, r0.z
mul o2.w, r0.z, l(0.00392156886)
and o3.xyz, r2.yzwy, r0.wwww
max r0.z, |v7.z|, l(0.000001)

mov r37.xyz, v7.xyzx
ld_indexable(texture2d)(float,float,float,float) r41.xyzw, l(2, 0, 0, 0), t125.xyzw
ge r42.x, r41.x, l(5.0)
if_z r42.x
add r40.w, r37.z, -r41.y
mad r37.x, r41.x, r40.w, r37.x
else
add r40.w, r37.z, -r40.y
mad r37.x, r40.x, r40.w, r37.x
endif

div r0.zw, r37.xxxy, r0.zzzz
add o4.xy, -r0.zwzz, r0.xyxx
mov o0.xyzw, l(0,0.498039216,0,0.512347519)
mov o2.xy, l(1.000000,0,0,0)
mov o3.w, l(0)
ret
// Approximately 136 instruction slots used
