//
// Generated by Microsoft (R) HLSL Shader Compiler 10.1
//
//   using 3Dmigoto v0.6.181 on Wed Jul 12 16:21:46 2023
//
//
// Buffer Definitions:
//
// cbuffer $Globals
// {
//
//   float4 projParams;                 // Index:    0.xyzw           Components:     4
//   float4 inLightPos[3];              // Index:    1 2 3            Components:    12
//   float4 inLightInvRadiusSq;         // Index:    4.xyzw           Components:     4
//   float4 inLightColor[4];            // Index:    5 6 7 8          Components:    16
//   float4 inLightSpotDir[3];          // Index:    9 10 11          Components:    12
//   float4 inLightSpotAngle;           // Index:   12.xyzw           Components:     4
//   float4 inLightSpotFalloff;         // Index:   13.xyzw           Components:     4
//   float4 ambient;                    // Index:   14.xyzw           Components:     4
//   float roughness;                   // Index:   15.x              Components:     1 [unused]
//   float4 specularColor;              // Index:   16.xyzw           Components:     4 [unused]
//   float backLighting;                // Index:   17.x              Components:     1
//   float3 eyePosWorld;                // Index:   17.yzw            Components:     3
//   float useLighting;                 // Index:   18.x              Components:     1
//   float oneOverSoftness;             // Index:   18.y              Components:     1
//   float oneOverFar;                  // Index:   18.z              Components:     1
//   float4 prePassTargetParams;        // Index:   19.xyzw           Components:     4
//   float alphaFactor;                 // Index:   20.x              Components:     1
//   float alphaScale;                  // Index:   20.y              Components:     1
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// diffuseMap_sampler_               sampler      NA          NA    0        1
// prepassDepthTex_sampler_          sampler      NA          NA    1        1
// diffuseMapTex                     texture  float4          2d    0        1
// prepassDepthTexTex                texture  float4          2d    1        1
// $Globals                          cbuffer      NA          NA    0        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float
// TEXCOORD                 0   xyzw        1     NONE   float   xyzw
// TEXCOORD                 1   xy          2     NONE   float   xy
// TEXCOORD                 2   xyzw        3     NONE   float   xy w
// TEXCOORD                 3   xyz         4     NONE   float   xyz
//
//
// 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 CB0[21], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s1, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2d (float,float,float,float) t1
dcl_input_ps linear v1.xyzw
dcl_input_ps linear v2.xy
dcl_input_ps linear v3.xyw
dcl_input_ps linear v4.xyz
dcl_output o0.xyzw
dcl_temps 29
dcl_resource_texture2d (float,float,float,float) t125
ld_indexable(texture2d)(float,float,float,float) r25.xyzw, l(0, 0, 0, 0), t125.xyzw
mul r0.xy, v3.xyxx, l(1.000000, -1.000000, 0.000000, 0.000000)
div r0.xy, r0.xyxx, v3.wwww
add r0.xy, r0.xyxx, l(1.000000, 1.000000, 0.000000, 0.000000)
mul_sat r0.xy, r0.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000)
mad r0.xy, r0.xyxx, cb0[19].zwzz, cb0[19].xyxx

//mad r0.x, r25.x, l(1920.0), r0.x

sample_l_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r0.x, r0.xyxx, t1.xyzw, s1, l(0.000000)
add r0.x, r0.x, -cb0[0].z
div r0.x, cb0[0].w, r0.x
div r0.x, r0.x, cb0[0].y
mad r0.x, -v3.w, cb0[18].z, r0.x
mul_sat r0.x, r0.x, cb0[18].y
ne r0.y, l(0.000000, 0.000000, 0.000000, 0.000000), cb0[18].x
if_nz r0.y
  add r0.yzw, -v4.xxyz, cb0[17].yyzw
  dp3 r1.x, r0.yzwy, r0.yzwy
  rsq r1.x, r1.x
  mul r0.yzw, r0.yyzw, r1.xxxx
  add r1.xyzw, v4.xxxx, -cb0[1].xyzw
  add r2.xyzw, v4.yyyy, -cb0[2].xyzw
  add r3.xyzw, v4.zzzz, -cb0[3].xyzw
  mul r4.xyzw, r1.xyzw, r1.xyzw
  mul r5.xyzw, r2.xyzw, r2.xyzw
  mad r6.xyzw, r1.xyzw, r1.xyzw, r5.xyzw
  mul r7.xyzw, r3.xyzw, r3.xyzw
  mad r6.xyzw, r3.xyzw, r3.xyzw, r6.xyzw
  mul r8.xyzw, -r0.yyyy, r1.xyzw
  add r0.y, -cb0[17].x, l(1.000000)
  mul r4.xyzw, r4.xyzw, cb0[17].xxxx
  mad r4.xyzw, r8.xyzw, r0.yyyy, r4.xyzw
  mul r8.xyzw, -r0.zzzz, r2.xyzw
  mul r5.xyzw, r5.xyzw, cb0[17].xxxx
  mad r5.xyzw, r8.xyzw, r0.yyyy, r5.xyzw
  add r4.xyzw, r4.xyzw, r5.xyzw
  mul r5.xyzw, -r0.wwww, r3.xyzw
  mul r7.xyzw, r7.xyzw, cb0[17].xxxx
  mad r5.xyzw, r5.xyzw, r0.yyyy, r7.xyzw
  add r4.xyzw, r4.xyzw, r5.xyzw
  rsq r5.xyzw, r6.xyzw
  mul_sat r4.xyzw, r4.xyzw, r5.xyzw
  mad_sat r6.xyzw, -r6.xyzw, cb0[4].xyzw, l(1.000000, 1.000000, 1.000000, 1.000000)
  mul r2.xyzw, r2.xyzw, cb0[10].xyzw
  mad r1.xyzw, r1.xyzw, cb0[9].xyzw, r2.xyzw
  mad r1.xyzw, r3.xyzw, cb0[11].xyzw, r1.xyzw
  mad r1.xyzw, r1.xyzw, r5.xyzw, -cb0[12].xyzw
  mul_sat r1.xyzw, r1.xyzw, cb0[13].xyzw
  mul r1.xyzw, r1.xyzw, r6.xyzw
  mul r1.xyzw, r1.xyzw, r4.xyzw
  mul r0.yzw, r1.yyyy, cb0[6].xxyz
  mad r0.yzw, r1.xxxx, cb0[5].xxyz, r0.yyzw
  mad r0.yzw, r1.zzzz, cb0[7].xxyz, r0.yyzw
  mad r0.yzw, r1.wwww, cb0[8].xxyz, r0.yyzw
  add r1.xyz, r0.yzwy, cb0[14].xyzx
else
  mov r1.xyz, l(1.000000,1.000000,1.000000,0)
endif

//mov r22.xy, v2.xyxx
//mad r22.x, r25.x, l(1.0), r22.x

sample_indexable(texture2d)(float,float,float,float) r2.xyzw, v2.xyxx, t0.xyzw, s0
mov r1.w, l(1.000000)
mul r1.xyzw, r1.xyzw, r2.xyzw
lt r0.y, cb0[20].x, l(0.000000)
lt r0.z, l(0.000000), cb0[20].x
mul r1.xyzw, r1.xyzw, v1.xyzw
mul r0.w, r1.w, cb0[20].x
mul r0.w, r0.x, r0.w
movc r0.z, r0.z, r0.w, r0.x
movc r0.yzw, r0.yyyy, r1.xxyz, r0.zzzz
mul o0.xyz, r0.yzwy, r1.xyzx
mul r0.x, r0.x, r1.w
mul o0.w, r0.x, cb0[20].y
ret
// Approximately 69 instruction slots used
