//
// Generated by Microsoft (R) HLSL Shader Compiler 10.0.10011.16384
//
//   using 3Dmigoto v1.3.16 on Sat Feb 05 16:49:15 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
                                        // Texture:   t6
//
// }
//
// cbuffer ConstBuf__materialData
// {
//
//   struct MaterialData
//   {
//
//       float flow1_cst_AlphaBlendAmount;// Index:    0
//       float flow2_cst_AlphaReference;// Index:    0.y
//       float flow3_cst_AlphaReference;// Index:    0.z
//
//   } resourceTables__materialData;    // Index:    0.xyz            Components:     3
                                        // Textures:  t9-t17
//
// }
//
//
// 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__viewData.blueNoiseTexture    texture   float     2darray    6        1
// resourceTables__materialData.material_dudv2    texture  float4          2d   10        1
// resourceTables__materialData.material_dudv3    texture  float4          2d   11        1
// resourceTables__materialData.flow1_alpha    texture  float4          2d   13        1
// resourceTables__materialData.flow3_alpha    texture  float4          2d   15        1
// resourceTables__materialData.layer_3__opacity    texture  float4          2d   16        1
// resourceTables__materialData.layer_3__alpha    texture  float4          2d   17        1
// ConstBuf__modelData               cbuffer      NA          NA    1        1
// ConstBuf__viewData                cbuffer      NA          NA    2        1
// ConstBuf__materialData            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   x
// TEXCOORD                 0   xy          2     NONE   float   xy
// TEXCOORD                 1   xy          3     NONE   float   xy
// NORMAL                   0   xyz         4     NONE   float   xyz
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// no Output
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb1[3], immediateIndexed
dcl_constantbuffer cb2[38], immediateIndexed
dcl_constantbuffer cb3[1], immediateIndexed
dcl_sampler s1, mode_default
dcl_sampler s2, mode_default
dcl_resource_texture2darray (float,float,float,float) t6
dcl_resource_texture2d (float,float,float,float) t10
dcl_resource_texture2d (float,float,float,float) t11
dcl_resource_texture2d (float,float,float,float) t13
dcl_resource_texture2d (float,float,float,float) t15
dcl_resource_texture2d (float,float,float,float) t16
dcl_resource_texture2d (float,float,float,float) t17
dcl_input_ps_siv linear noperspective v0.xyz, position
dcl_input_ps constant v1.x
dcl_input_ps linear v2.xy
dcl_input_ps linear v3.xy
dcl_input_ps linear v4.xyz
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
and r0.x, v1.x, l(0x00ffffff)
ne r0.y, l(1.000000), cb1[2].w
if_nz r0.y
  if_z cb2[36].x
    ne r0.y, l(0.000000, 0.000000, 0.000000, 0.000000), cb2[37].x
    if_z r0.y
      ftoi r0.yz, v0.xxyx
      iadd r0.w, r0.x, l(1)
      and r0.w, r0.w, l(7)
      imad r0.yz, r0.wwww, l(0, 7, 7, 0), r0.yyzy
      and r1.xy, r0.yzyy, l(63, 63, 0, 0)
      and r1.z, l(7), cb2[37].z
      mov r1.w, l(0)
      ld_indexable(texture2darray)(float,float,float,float) r0.y, r1.xyzw, t6.yxzw
    else
      mov r0.y, l(0)
    endif
  else
    mov r0.y, l(0)
  endif
  ge r0.y, r0.y, cb1[2].w
  discard_nz r0.y
endif
mul r0.yz, v0.xxyx, cb2[32].zzwz
mad r0.yz, r0.yyzy, l(0.000000, 2.000000, -2.000000, 0.000000), l(0.000000, -1.000000, 1.000000, 0.000000)
mad r0.w, v0.z, cb2[35].z, cb2[35].w
rcp r0.w, r0.w
mov r1.z, -r0.w
mul r1.xy, r0.yzyy, 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, cb2[12].xyzw
dp4 r2.y, r1.xyzw, cb2[13].xyzw
dp4 r2.z, r1.xyzw, cb2[14].xyzw
add r1.xyz, -r2.xyzx, cb2[29].xyzx

//Tessellation specular PS..
mul r41.xyz, r40.yyyy, cb2[16].xyzx
mul r41.w, cb2[16].x, cb2[16].x
mad r41.w, cb2[16].y, cb2[16].y, r41.w
mad r41.w, cb2[16].z, cb2[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
mov r2.x, v3.y
mov r2.y, l(1.000000)
dp2 r3.w, l(4.000000, 0.100000, 0.000000, 0.000000), r2.xyxx
mul r3.xyz, v3.xyxx, l(5.000000, 5.000000, -3.000000, 0.000000)
sample_indexable(texture2d)(float,float,float,float) r2.zw, r3.zwzz, t10.zwxy, s1
mad r2.zw, r2.zzzw, l(0.000000, 0.000000, 2.000000, 2.000000), l(0.000000, 0.000000, -0.996078432, -0.996078432)
mul r3.zw, l(0.000000, 0.000000, 5.000000, 10.000000), cb2[35].xxxx
frc r3.zw, r3.zzzw
add r4.xy, r3.zwzz, l(-0.500000, -0.500000, 0.000000, 0.000000)
add r4.zw, l(0.000000, 0.000000, 0.100000, 0.050000), cb2[35].xxxx
mul r4.xyzw, r4.xyzw, l(0.300000, 0.550000, 5.000000, 10.000000)
frc r4.zw, r4.zzzw
add r4.zw, r4.zzzw, l(0.000000, 0.000000, -0.500000, -0.500000)
mul r4.zw, r4.zzzw, l(0.000000, 0.000000, 0.300000, 0.550000)
mul r3.zw, r3.zzzw, l(0.000000, 0.000000, 6.28318548, 6.28318548)
sincos null, r3.zw, r3.zzzw
dp2 r2.y, l(4.000000, 0.100000, 0.000000, 0.000000), r2.xyxx
mul r2.x, v3.x, l(-3.000000)
sample_indexable(texture2d)(float,float,float,float) r2.xy, r2.xyxx, t11.xyzw, s1
mad r2.xy, r2.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-0.996078432, -0.996078432, 0.000000, 0.000000)
mad r3.zw, r3.zzzw, l(0.000000, 0.000000, 0.500000, 0.500000), l(0.000000, 0.000000, 0.500000, 0.500000)
mad r5.xy, r2.xyxx, r4.yyyy, v3.xyxx
mad r2.xy, r2.xyxx, r4.wwww, v3.xyxx
mad r6.xy, r2.zwzz, r4.xxxx, v3.xyxx
mov r6.z, l(1.000000)
dp2 r4.x, l(3.000000, 0.300000, 0.000000, 0.000000), r6.xzxx
dp2 r4.y, l(2.000000, 0.300000, 0.000000, 0.000000), r6.yzyy
mad r6.xy, r2.zwzz, r4.zzzz, v3.xyxx
mov r6.z, l(1.000000)
dp2 r7.x, l(3.000000, 0.300000, 0.000000, 0.000000), r6.xzxx
dp2 r7.y, l(2.000000, 0.300000, 0.000000, 0.000000), r6.yzyy
sample_indexable(texture2d)(float,float,float,float) r0.w, v2.xyxx, t13.yzwx, s1
dp3 r1.w, v4.xyzx, v4.xyzx
rsq r1.w, r1.w
mul r6.xyz, r1.wwww, v4.xyzx
dp3 r1.x, r6.xyzx, r1.xyzx
dp2 r0.y, r0.yzyy, r0.yzyy
sqrt r0.y, r0.y
min r0.z, |r1.x|, l(1.000000)
mul r1.y, r0.z, r0.z
mul r1.y, r0.z, r1.y
add_sat r0.y, -r0.y, l(2.000000)
mul r1.z, r0.y, r0.y
mad r0.y, -r0.y, l(2.000000), l(3.000000)
mul r0.y, r0.y, r1.z
mul r1.y, r0.y, r1.y
mad r0.w, r0.w, r1.y, l(-0.250488)
sample_indexable(texture2d)(float,float,float,float) r1.y, r5.xyxx, t13.yxzw, s1
sample_indexable(texture2d)(float,float,float,float) r1.z, r2.xyxx, t13.yzxw, s1
add r1.z, -r1.y, r1.z
mad r1.y, r3.w, r1.z, r1.y
mul r0.z, r0.y, r0.z
mad r0.z, r1.y, r0.z, -cb3[0].y
mul_sat r0.zw, r0.zzzw, l(0.000000, 0.000000, 4.92751646, 6.360231)
mul r0.z, r0.z, l(0.800000)
mad_sat r0.z, r0.w, cb3[0].x, r0.z
sample_indexable(texture2d)(float,float,float,float) r0.w, v3.xyxx, t15.xyzw, s2
add r1.x, |r1.x|, l(-0.0980224982)
mul_sat r1.x, r1.x, l(1.10867512)
log r1.x, r1.x
mul r1.x, r1.x, l(1.458130)
exp r1.x, r1.x
mul r0.y, r0.y, r1.x
mad r0.y, r0.w, r0.y, -cb3[0].z
mul_sat r0.y, r0.y, l(5.10001135)
mad r0.y, r0.y, l(0.550000), r0.z
min r0.y, r0.y, l(1.000000)
sample_indexable(texture2d)(float,float,float,float) r0.z, r4.xyxx, t16.yzxw, s1
sample_indexable(texture2d)(float,float,float,float) r0.w, r7.xyxx, t16.yzwx, s1
add r0.w, -r0.z, r0.w
mad r0.z, r3.z, r0.w, r0.z
sample_indexable(texture2d)(float,float,float,float) r0.w, r3.xyxx, t17.yzwx, s2
lt r1.x, r0.w, l(0.500000)
dp2 r1.y, r0.zzzz, r0.wwww
add r0.zw, -r0.zzzw, l(0.000000, 0.000000, 1.000000, 1.000000)
add r0.w, r0.w, r0.w
mad r0.z, -r0.w, r0.z, l(1.000000)
movc r0.z, r1.x, r1.y, r0.z
add r0.z, r0.z, l(-0.235294)
mul_sat r0.z, r0.z, l(3.18749475)
add r0.y, -r0.z, r0.y
max r0.y, r0.y, l(0.000000)
if_z cb2[36].x
  ne r0.z, l(0.000000, 0.000000, 0.000000, 0.000000), cb2[37].x
  if_z r0.z
    ftoi r0.zw, v0.xxxy
    iadd r0.x, r0.x, cb2[37].z
    imul null, r0.x, r0.x, l(4099)
    and r0.x, r0.x, l(63)
    iadd r0.xz, r0.xxxx, r0.zzwz
    utof r0.xz, r0.xxzx
    mul r0.xz, r0.xxzx, l(0.0671105608, 0.000000, 0.00583714992, 0.000000)
    add r0.x, r0.z, r0.x
    frc r0.x, r0.x
    mul r0.x, r0.x, l(52.982918)
    frc r0.x, r0.x
  else
    mov r0.x, l(0)
  endif
else
  mov r0.x, l(0)
endif
ge r0.x, r0.x, r0.y
discard_nz r0.x
ge r0.x, l(0.000000), r0.y
discard_nz r0.x
ret
// Approximately 144 instruction slots used
