//Lighting PS 13. Parking lot. Low.
//
// Generated by Microsoft (R) HLSL Shader Compiler 10.1
//
//   using 3Dmigoto v0.6.181 on Sun Aug 27 11:41:50 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]
//   float4 rtParams0;                  // Index:   17.xyzw           Components:     4
//   float3 lightPosition;              // Index:   18.xyz            Components:     3
//   float4 lightColor;                 // Index:   19.xyzw           Components:     4
//   float lightBrightness;             // Index:   20.x              Components:     1
//   float lightRange;                  // Index:   20.y              Components:     1
//   float2 lightAttenuation;           // Index:   20.zw             Components:     2
//   float4 lightMapParams;             // Index:   21.xyzw           Components:     4
//   float3 eyePosWorld;                // Index:   22.xyz            Components:     3 [unused]
//   float3 vEye;                       // Index:   23.xyz            Components:     3 [unused]
//   float3x3 worldToLightProj;         // Index:   24-26.z           Components:    11
//   float4 lightParams;                // Index:   27.xyzw           Components:     4
//   float shadowSoftness;              // Index:   28.x              Components:     1
//   float4x4 screenToWorld;            // Index:   29 30 31 32       Components:    16
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// prePassBuffer_sampler_            sampler      NA          NA    0        1
// prePassDepthBuffer_sampler_       sampler      NA          NA    1        1
// shadowMap_sampler_                sampler      NA          NA    2        1
// gTapRotationTex_sampler_          sampler      NA          NA    4        1
// prePassBufferTex                  texture  float4          2d    0        1
// prePassDepthBufferTex             texture  float4          2d    1        1
// shadowMapTex                      texture  float4          2d    2        1
// gTapRotationTexTex                texture  float4          2d    4        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   xyz
// TEXCOORD                 1   xyzw        2     NONE   float   xy w
// TEXCOORD                 2   xyzw        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[33], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s1, mode_default
dcl_sampler s2, mode_default
dcl_sampler s4, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2d (float,float,float,float) t1
dcl_resource_texture2d (float,float,float,float) t2
dcl_resource_texture2d (float,float,float,float) t4
dcl_input_ps linear v1.xyz
dcl_input_ps linear v2.xyw
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
div r0.xy, v2.xyxx, v2.wwww
add r0.zw, r0.xxxy, l(0.000000, 0.000000, 1.000000, 1.000000)
mul r0.xy, r0.xyxx, l(16.000000, 16.000000, 0.000000, 0.000000)
sample_l_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r0.xy, r0.xyxx, t4.xyzw, s4, l(0.000000)
add r0.xy, r0.yxyy, l(-0.500000, -0.500000, 0.000000, 0.000000)
mul r0.z, r0.z, cb0[17].z
mad r0.w, -r0.w, l(0.500000), l(1.000000)
mul r1.y, r0.w, cb0[17].w
mul r1.x, r0.z, l(0.500000)
add r0.zw, r1.xxxy, cb0[17].xxxy
mad r1.xy, r0.zwzz, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
mul r1.xy, r1.xyxx, l(1.000000, -1.000000, 0.000000, 0.000000)

mul r12.xyzw, r1.yyyy, cb0[30].xyzw
mad r11.xyzw, cb0[29].xyzw, r1.xxxx, r12.xyzw
sample_l_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r12.x, r0.zwzz, t1.xyzw, s1, l(0.000000)
sample_l_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r12.yzw, r0.zwzz, t0.wxyz, s0, l(0.000000)
mad r11.xyzw, cb0[31].xyzw, r12.xxxx, r11.xyzw
add r11.xyzw, r11.xyzw, cb0[32].xyzw

mad r26.x, r25.y, r11.w, l(-1.0)
mad r1.x, r25.x, r26.x, r1.x

mul r2.xyzw, r1.yyyy, cb0[30].xyzw
mad r1.xyzw, cb0[29].xyzw, r1.xxxx, r2.xyzw
sample_l_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r2.x, r0.zwzz, t1.xyzw, s1, l(0.000000)
sample_l_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r2.yzw, r0.zwzz, t0.wxyz, s0, l(0.000000)
mad r1.xyzw, cb0[31].xyzw, r2.xxxx, r1.xyzw
add r1.xyzw, r1.xyzw, cb0[32].xyzw
div r1.xyz, r1.xyzx, r1.wwww
add r1.xyz, -r1.xyzx, cb0[18].xyzx
dp3 r3.y, r1.xyzx, r1.xyzx
sqrt r3.x, r3.y
dp2 r0.z, cb0[20].zwzz, r3.xyxx
add r0.zw, -r0.zzzz, l(0.000000, 0.000000, 1.000000, 0.999999)
add r1.w, -r3.x, cb0[20].y
lt r1.w, r1.w, l(0.000000)
discard_nz r1.w
lt r0.w, r0.w, l(0.000000)
discard_nz r0.w
div r0.w, r3.x, cb0[20].y
div r1.xyz, r1.xyzx, r3.xxxx
mul r3.xyz, -r1.yyyy, cb0[25].xyzx
mad r3.xyz, cb0[24].xyzx, -r1.xxxx, r3.xyzx
mad r3.xyz, cb0[26].xyzx, -r1.zzzz, r3.xyzx
lt r1.w, r3.y, l(0.000000)
movc r2.x, r1.w, -r3.y, r3.y
add r2.x, r2.x, l(1.000000)
add r2.x, r2.x, r2.x
div r3.xyz, r3.zxxz, r2.xxxx
add r3.xyz, r3.xyzx, l(0.500000, 0.500000, 1.500000, 0.000000)
movc r1.w, r1.w, r3.z, r3.y
add r3.y, -r3.x, l(1.000000)
mul r3.x, r1.w, l(0.500000)
mul r3.zw, r0.yyyy, l(0.000000, 0.000000, 1.918618, -1.747848)
mad r3.zw, r0.xxxx, l(0.000000, 0.000000, 1.785666, -1.882716), -r3.zzzw
mul r4.xy, r3.zwzz, cb0[28].xxxx
dp2 r1.w, r0.xyxx, l(-1.747848, -1.882716, 0.000000, 0.000000)
mul r4.w, r1.w, cb0[28].x
add r3.zw, r3.xxxy, r4.yyyw
sample_l_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r1.w, r3.zwzz, t2.yzwx, s2, l(0.000000)
add r1.w, -r0.w, -r1.w
add r1.w, r1.w, l(1.000000)
mul r1.w, r1.w, cb0[27].y
mul r1.w, r1.w, l(1.442695)
exp r1.w, r1.w
min r1.w, r1.w, l(1.000000)
mul r1.w, r1.w, l(0.200000)
dp2 r2.x, r0.xyxx, l(1.918618, 1.785666, 0.000000, 0.000000)
mul r4.z, r2.x, cb0[28].x
add r3.zw, r3.xxxy, r4.xxxz
sample_l_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r2.x, r3.zwzz, t2.xyzw, s2, l(0.000000)
add r2.x, -r2.x, l(1.000000)
add r2.x, -r0.w, r2.x
mul r2.x, r2.x, cb0[27].y
mul r2.x, r2.x, l(1.442695)
exp r2.x, r2.x
min r2.x, r2.x, l(1.000000)
mad r1.w, r2.x, l(0.200000), r1.w
mul r3.zw, r0.yyyy, l(0.000000, 0.000000, 0.668824, -1.359210)
mad r3.zw, r0.xxxx, l(0.000000, 0.000000, -0.520366, 0.697352), -r3.zzzw
mul r4.xy, r3.zwzz, cb0[28].xxxx
dp2 r2.x, r0.xyxx, l(0.668824, -0.520366, 0.000000, 0.000000)
mul r4.z, r2.x, cb0[28].x
add r3.zw, r3.xxxy, r4.xxxz
sample_l_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r2.x, r3.zwzz, t2.xyzw, s2, l(0.000000)
add r2.x, -r0.w, -r2.x
add r2.x, r2.x, l(1.000000)
mul r2.x, r2.x, cb0[27].y
mul r2.x, r2.x, l(1.442695)
exp r2.x, r2.x
min r2.x, r2.x, l(1.000000)
mad r1.w, r2.x, l(0.200000), r1.w
dp2 r2.x, r0.xyxx, l(-1.359210, 0.697352, 0.000000, 0.000000)
mul r4.w, r2.x, cb0[28].x
add r3.zw, r3.xxxy, r4.yyyw
sample_l_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r2.x, r3.zwzz, t2.xyzw, s2, l(0.000000)
add r2.x, -r0.w, -r2.x
add r2.x, r2.x, l(1.000000)
mul r2.x, r2.x, cb0[27].y
mul r2.x, r2.x, l(1.442695)
exp r2.x, r2.x
min r2.x, r2.x, l(1.000000)
mad r1.w, r2.x, l(0.200000), r1.w
mul r2.x, r0.y, l(-0.781274)
mad r2.x, r0.x, l(-1.139004), -r2.x
dp2 r0.x, r0.xyxx, l(-0.781274, -1.139004, 0.000000, 0.000000)
mul r0.y, r0.x, cb0[28].x
mul r0.x, r2.x, cb0[28].x
add r0.xy, r0.xyxx, r3.xyxx
sample_l_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r0.x, r0.xyxx, t2.xyzw, s2, l(0.000000)
add r0.x, -r0.x, -r0.w
add r0.x, r0.x, l(1.000000)
mul r0.x, r0.x, cb0[27].y
mul r0.x, r0.x, l(1.442695)
exp r0.x, r0.x
min r0.x, r0.x, l(1.000000)
mad r0.x, r0.x, l(0.200000), r1.w
add r0.y, r0.x, l(-1.000000)
mad r0.y, r0.z, r0.y, l(1.000000)
mul r3.xyz, cb0[19].xyzx, cb0[21].xyzx
lt r0.w, cb0[21].w, l(0.000000)
movc r3.xyz, r0.wwww, r0.yyyy, r3.xyzx
mad r2.xy, r2.yzyy, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
max r0.y, r2.w, l(0.020000)
mul r0.y, r0.y, r0.y
ge r2.zw, r2.xxxy, l(0.000000, 0.000000, 0.000000, 0.000000)
movc r2.zw, r2.zzzw, l(0,0,1.000000,1.000000), l(0,0,-1.000000,-1.000000)
add r4.xyz, -|r2.xyxx|, l(1.000000, 1.000000, 1.000000, 0.000000)
mul r2.zw, r2.zzzw, r4.yyyz
add r4.z, -|r2.y|, r4.x
ge r1.w, r4.z, l(0.000000)
movc r4.xy, r1.wwww, r2.xyxx, r2.zwzz
dp3 r1.w, r4.xyzx, r4.xyzx
rsq r1.w, r1.w
mul r2.xyz, r1.wwww, r4.xyzx
dp3 r1.w, r1.xyzx, r2.xyzx
max r2.w, r1.w, l(0.000010)
mov_sat r1.w, r1.w
mul r0.z, r0.z, r1.w
mul_sat r0.x, r0.x, r0.z
mul r4.x, r0.x, cb0[20].x
dp3 r0.x, v1.xyzx, v1.xyzx
rsq r0.x, r0.x
mul r5.xyz, r0.xxxx, v1.xyzx
mad r1.xyz, -v1.xyzx, r0.xxxx, r1.xyzx
dp3 r0.x, r2.xyzx, -r5.xyzx
max r0.x, r0.x, l(0.000010)
mul r0.z, r2.w, r2.w
mad r1.w, -r0.y, r0.y, l(1.000000)
mul r3.w, r0.y, r0.y
mad r0.y, r0.y, r0.y, l(-1.000000)
mad r0.z, r0.z, r1.w, r3.w
sqrt r0.z, r0.z
mul r0.z, r0.z, r0.x
mul r0.x, r0.x, r0.x
mad r0.x, r0.x, r1.w, r3.w
sqrt r0.x, r0.x
mad r0.x, r2.w, r0.x, r0.z
div r0.z, l(0.500000), r0.x
ge r0.x, l(0.000000), r0.x
movc r0.x, r0.x, l(0), r0.z
dp3 r0.z, r1.xyzx, r1.xyzx
rsq r0.z, r0.z
mul r1.xyz, r0.zzzz, r1.xyzx
dp3 r0.z, r2.xyzx, r1.xyzx
max r0.z, r0.z, l(0.000010)
mul r0.z, r0.z, r0.z
mad r0.y, r0.z, r0.y, l(1.000000)
mul r0.y, r0.y, r0.y
mul r0.y, r0.y, l(3.14159274)
div r0.y, r3.w, r0.y
mul r0.x, r0.x, r0.y
mul_sat r4.y, r4.x, r0.x
mul r0.y, r4.y, cb0[20].x
mov r0.x, l(1.000000)
movc r0.xy, r0.wwww, r0.xyxx, r4.xyxx
mul o0.xyz, r0.xxxx, r3.xyzx
mov o0.w, r0.y
ret
// Approximately 169 instruction slots used
