//Lighting PS 11. Beam mountain tunnel. High.
//
// Generated by Microsoft (R) HLSL Shader Compiler 10.1
//
//   using 3Dmigoto v0.6.181 on Sun Aug 27 10:10:16 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 rtParams1;                  // 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
//   float3 lightDirection;             // Index:   21.xyz            Components:     3
//   float4 lightSpotParams;            // Index:   22.xyzw           Components:     4
//   float4 lightMapParams;             // Index:   23.xyzw           Components:     4
//   float4x4 worldToLightProj;         // Index:   24 25 26 27       Components:    16 [unused]
//   float3 eyePosWorld;                // Index:   28.xyz            Components:     3 [unused]
//   float3 vEye;                       // Index:   29.xyz            Components:     3 [unused]
//   float4 lightParams;                // Index:   30.xyzw           Components:     4 [unused]
//   float shadowSoftness;              // Index:   31.x              Components:     1 [unused]
//   float4x4 screenToWorld;            // Index:   32 33 34 35       Components:    16
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// prePassBuffer_sampler_            sampler      NA          NA    0        1
// prePassDepthBuffer_sampler_       sampler      NA          NA    1        1
// prePassBufferTex                  texture  float4          2d    0        1
// prePassDepthBufferTex             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   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[36], 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.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.xy, r0.xyxx, l(1.000000, 1.000000, 0.000000, 0.000000)
mul r0.x, r0.x, cb0[17].z
mad r0.y, -r0.y, l(0.500000), l(1.000000)
mul r1.y, r0.y, cb0[17].w
mul r1.x, r0.x, l(0.500000)
add r0.xy, r1.xyxx, cb0[17].xyxx
mad r0.zw, r0.xxxy, l(0.000000, 0.000000, 2.000000, 2.000000), l(0.000000, 0.000000, -1.000000, -1.000000)
mul r0.zw, r0.zzzw, l(0.000000, 0.000000, 1.000000, -1.000000)

mul r11.xyzw, r0.wwww, cb0[33].xyzw
mad r11.xyzw, cb0[32].xyzw, r0.zzzz, r11.xyzw
sample_l_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r10.z, r0.xyxx, t1.yzxw, s1, l(0.000000)
sample_l_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r10.xyw, r0.xyxx, t0.xywz, s0, l(0.000000)
mad r11.xyzw, cb0[34].xyzw, r10.zzzz, r11.xyzw

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

mul r1.xyzw, r0.wwww, cb0[33].xyzw
mad r1.xyzw, cb0[32].xyzw, r0.zzzz, r1.xyzw
sample_l_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r0.z, r0.xyxx, t1.yzxw, s1, l(0.000000)
sample_l_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r0.xyw, r0.xyxx, t0.xywz, s0, l(0.000000)
mad r1.xyzw, cb0[34].xyzw, r0.zzzz, r1.xyzw
add r1.xyzw, r1.xyzw, cb0[35].xyzw
div r1.xyz, r1.xyzx, r1.wwww
add r1.xyz, r1.xyzx, -cb0[18].xyzx
dp3 r2.y, r1.xyzx, r1.xyzx
sqrt r2.x, r2.y
dp2 r0.z, cb0[20].zwzz, r2.xyxx
add r0.z, -r0.z, l(1.000000)
div r1.xyz, r1.xyzx, r2.xxxx
add r1.w, -r2.x, cb0[20].y
lt r1.w, r1.w, l(0.000000)
discard_nz r1.w
dp3 r1.w, cb0[21].xyzx, r1.xyzx
add r1.w, r1.w, -cb0[22].x
lt r2.x, r1.w, l(0.000000)
div r1.w, r1.w, cb0[22].y
discard_nz r2.x
mad r2.x, r0.z, r1.w, l(-0.000001)
mul r0.z, r0.z, r1.w
lt r1.w, r2.x, l(0.000000)
discard_nz r1.w
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.w, r0.w, l(0.020000)
ge r2.xy, r0.xyxx, l(0.000000, 0.000000, 0.000000, 0.000000)
movc r2.xy, r2.xyxx, l(1.000000,1.000000,0,0), l(-1.000000,-1.000000,0,0)
add r3.xyz, -|r0.xyxx|, l(1.000000, 1.000000, 1.000000, 0.000000)
mul r2.xy, r2.xyxx, r3.yzyy
add r3.z, -|r0.y|, r3.x
ge r1.w, r3.z, l(0.000000)
movc r3.xy, r1.wwww, r0.xyxx, r2.xyxx
dp3 r0.x, r3.xyzx, r3.xyzx
rsq r0.x, r0.x
mul r2.xyz, r0.xxxx, r3.xyzx
dp3 r0.x, r2.xyzx, -r1.xyzx
max r0.y, r0.x, l(0.000010)
mov_sat r0.xz, r0.xxzx
mul r0.x, r0.z, r0.x
mul r3.x, r0.x, cb0[20].x
dp4 r0.x, v1.xyzw, v1.xyzw
rsq r0.x, r0.x
mul r4.xyz, r0.xxxx, v1.xyzx
mad r1.xyz, -v1.xyzx, r0.xxxx, -r1.xyzx
dp3 r0.x, r2.xyzx, -r4.xyzx
max r0.x, r0.x, l(0.000010)
mul r0.zw, r0.yyyw, r0.yyyw
mad r1.w, -r0.w, r0.w, l(1.000000)
mul r2.w, r0.w, r0.w
mad r0.w, r0.w, r0.w, l(-1.000000)
mad r0.z, r0.z, r1.w, r2.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, r2.w
sqrt r0.x, r0.x
mad r0.x, r0.y, r0.x, r0.z
div r0.y, l(0.500000), r0.x
ge r0.x, l(0.000000), r0.x
movc r0.x, r0.x, l(0), r0.y
dp3 r0.y, r1.xyzx, r1.xyzx
rsq r0.y, r0.y
mul r1.xyz, r0.yyyy, r1.xyzx
dp3 r0.y, r2.xyzx, r1.xyzx
max r0.y, r0.y, l(0.000010)
mul r0.y, r0.y, r0.y
mad r0.y, r0.y, r0.w, l(1.000000)
mul r0.y, r0.y, r0.y
mul r0.y, r0.y, l(3.14159274)
div r0.y, r2.w, r0.y
mul r0.x, r0.x, r0.y
mul_sat r3.y, r3.x, r0.x
mul r0.y, r3.y, cb0[20].x
mov r0.x, l(1.000000)
lt r0.z, cb0[23].w, l(0.000000)
movc r0.xy, r0.zzzz, r0.xyxx, r3.xyxx
mul r1.xyz, cb0[19].xyzx, cb0[23].xyzx
movc r1.xyz, r0.zzzz, l(1.000000,1.000000,1.000000,0), r1.xyzx
mul o0.xyz, r0.xxxx, r1.xyzx
mov o0.w, r0.y
ret
// Approximately 92 instruction slots used
