//Shadows PS 10. Low and no shadows.
//
// Generated by Microsoft (R) HLSL Shader Compiler 10.1
//
//   using 3Dmigoto v0.6.181 on Thu Jul 13 23:28:39 2023
//
//
// Buffer Definitions:
//
// cbuffer $Globals
// {
//
//   float4 projParams;                 // Index:    0.xyzw           Components:     4 [unused]
//   float4 inLightPos[3];              // Index:    1 2 3            Components:    12 [unused]
//   float4 inLightInvRadiusSq;         // Index:    4.xyzw           Components:     4 [unused]
//   float4 inLightColor[4];            // Index:    5 6 7 8          Components:    16 [unused]
//   float4 inLightSpotDir[3];          // Index:    9 10 11          Components:    12 [unused]
//   float4 inLightSpotAngle;           // Index:   12.xyzw           Components:     4 [unused]
//   float4 inLightSpotFalloff;         // Index:   13.xyzw           Components:     4 [unused]
//   float4 ambient;                    // Index:   14.xyzw           Components:     4 [unused]
//   float roughness;                   // Index:   15.x              Components:     1 [unused]
//   float4 specularColor;              // Index:   16.xyzw           Components:     4 [unused]
//   float4x4 worldToLightProj;         // Index:   17 18 19 20       Components:    16 [unused]
//   float4 scaleX;                     // Index:   21.xyzw           Components:     4 [unused]
//   float4 scaleY;                     // Index:   22.xyzw           Components:     4 [unused]
//   float4 offsetX;                    // Index:   23.xyzw           Components:     4 [unused]
//   float4 offsetY;                    // Index:   24.xyzw           Components:     4 [unused]
//   float4 atlasXOffset;               // Index:   25.xyzw           Components:     4 [unused]
//   float4 atlasYOffset;               // Index:   26.xyzw           Components:     4 [unused]
//   float4 farPlaneScalePSSM;          // Index:   27.xyzw           Components:     4 [unused]
//   float4 overDarkPSSM;               // Index:   28.xyzw           Components:     4 [unused]
//   float2 atlasScalePSSM;             // Index:   29.xy             Components:     2 [unused]
//   float2 fadeStartLength;            // Index:   29.zw             Components:     2 [unused]
//   float shadowSoftness;              // Index:   30.x              Components:     1 [unused]
//   float3 lightDirection;             // Index:   30.yzw            Components:     3
//   float4 lightColor;                 // Index:   31.xyzw           Components:     4
//   float lightBrightness;             // Index:   32.x              Components:     1
//   float4 lightAmbient;               // Index:   33.xyzw           Components:     4 [unused]
//   float3 eyePosWorld;                // Index:   34.xyz            Components:     3 [unused]
//   float3 vEye;                       // Index:   35.xyz            Components:     3 [unused]
//   float4 zNearFarInvNearFar;         // Index:   36.xyzw           Components:     4 [unused]
//   float4 lightMapParams;             // Index:   37.xyzw           Components:     4
//   float4x4 screenToWorld;            // Index:   38 39 40 41       Components:    16 [unused]
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// prePassBuffer_sampler_            sampler      NA          NA    0        1
// prePassBufferTex                  texture  float4          2d    0        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   xy          1     NONE   float   xy
// TEXCOORD                 1   xyz         2     NONE   float   xyz
// TEXCOORD                 2   xyz         3     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 CB0[38], immediateIndexed
dcl_constantbuffer CB13[44], immediateIndexed
dcl_sampler s0, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_input_ps linear v1.xy
dcl_input_ps linear v2.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

//mov r21.xy, v1.xyxx
//mad r21.x, r25.x, l(0.5), r21.x

sample_l_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r0.xyz, v1.xyxx, t0.xyzw, s0, l(0.000000)
mad r0.xy, r0.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
max r0.z, r0.z, l(0.020000)
mul r0.z, r0.z, r0.z
ge r1.xy, r0.xyxx, l(0.000000, 0.000000, 0.000000, 0.000000)
movc r1.xy, r1.xyxx, l(1.000000,1.000000,0,0), l(-1.000000,-1.000000,0,0)
add r2.xyz, -|r0.xyxx|, l(1.000000, 1.000000, 1.000000, 0.000000)
mul r1.xy, r1.xyxx, r2.yzyy
add r2.z, -|r0.y|, r2.x
ge r0.w, r2.z, l(0.000000)
movc r2.xy, r0.wwww, r0.xyxx, r1.xyxx
dp3 r0.x, r2.xyzx, r2.xyzx
rsq r0.x, r0.x
mul r0.xyw, r0.xxxx, r2.xyxz

mov r22.xyz, v2.xyzx
//mov r20.xyzw, cb0[30].xyzw
//div r24.x, r25.y, r10.x
//add r24.x, r24.x, l(-1.0)
mul r26.x, l(-1.0), cb13[30].x
mul r26.y, l(-1.0), cb13[31].x
mul r26.z, l(-1.0), cb13[32].x
mul r26.w, cb13[30].x, cb13[30].x
mad r26.w, cb13[31].x, cb13[31].x, r26.w
mad r26.w, cb13[32].x, cb13[32].x, r26.w
div r26.xyz, r26.xyzx, r26.wwww
//div r26.xyz, r26.xyzx, r0.x
//mul r26.xyz, r26.xyzx, cb0[0].y
//mul r26.xyz, r26.xyzx, l(0.1)
//mad r20.yzw, r25.xxxx, r26.xxyz, r20.yyzw
//mad r22.xyz, r25.xxxx, r26.xyzx, r22.xyzx

dp3 r1.x, v2.xyzx, v2.xyzx
rsq r1.x, r1.x
mul r1.yzw, r1.xxxx, v2.xxyz
mad r2.xyz, -v2.xyzx, r1.xxxx, -cb0[30].yzwy

//mad r2.xyz, -r25.xxxx, r26.xyzx, r2.xyzx
////mad r0.xyw, -r25.xxxx, r26.xyxz, r0.xyxw

dp3 r1.x, r0.xywx, -r1.yzwy
dp3 r1.y, r0.xywx, -cb0[30].yzwy
max r1.xy, r1.xyxx, l(0.000010, 0.000010, 0.000000, 0.000000)
mul r1.z, r1.y, r1.y
mad r1.w, -r0.z, r0.z, l(1.000000)
mul r2.w, r0.z, r0.z
mad r0.z, r0.z, r0.z, l(-1.000000)
mad r1.z, r1.z, r1.w, r2.w
sqrt r1.z, r1.z
mul r1.z, r1.z, r1.x
mul r1.x, r1.x, r1.x
mad r1.x, r1.x, r1.w, r2.w
sqrt r1.x, r1.x
mad r1.x, r1.y, r1.x, r1.z
min r1.y, r1.y, l(1.000000)
mul r1.y, r1.y, cb0[32].x
div r1.z, l(0.500000), r1.x
ge r1.x, l(0.000000), r1.x
movc r1.x, r1.x, l(0), r1.z
dp3 r1.z, r2.xyzx, r2.xyzx
rsq r1.z, r1.z
mul r2.xyz, r1.zzzz, r2.xyzx
dp3 r0.x, r0.xywx, r2.xyzx
max r0.x, r0.x, l(0.000010)
mul r0.x, r0.x, r0.x
mad r0.x, r0.x, r0.z, l(1.000000)
mul r0.x, r0.x, r0.x
mul r0.x, r0.x, l(3.14159274)
div r0.x, r2.w, r0.x
mul r0.x, r1.x, r0.x
mul_sat o0.w, r1.y, r0.x
mul r0.xyz, cb0[31].xyzx, cb0[37].xyzx
mul o0.xyz, r1.yyyy, r0.xyzx
ret
// Approximately 52 instruction slots used
