#version 450

struct lightingInput_t
{
    vec3 albedo;
    vec3 colorMask;
    vec3 specular;
    float smoothness;
    float maskSSS;
    float thickness;
    vec3 normal;
    vec3 normalTS;
    vec3 normalSSS;
    vec3 lightmap;
    vec3 emissive;
    float alpha;
    float ssdoDiffuseMul;
    vec3 view;
    vec3 position;
    vec4 texCoords;
    vec4 fragCoord;
    mat3 invTS;
    vec3 ambient_lighting;
    vec3 diffuse_lighting;
    vec3 specular_lighting;
    vec3 output_lighting;
    uint albedo_packed;
    uint specular_packed;
    uint diffuse_lighting_packed;
    uint specular_lighting_packed;
    uint normal_packed;
    uvec4 ticksDecals;
    uvec4 ticksProbes;
    uvec4 ticksLights;
};

struct clusternumlights_t
{
    int offset;
    int numItems;
};

struct decal_t
{
    vec4 projS;
    vec4 projT;
    vec4 projR;
    uvec2 albedoScaleBias;
    uvec2 specScaleBias;
    uvec2 normalScaleBias;
    uint opacity;
    uint decalParms;
    uint albedo;
    uint emissive;
    uint specOverride;
    uint decalParms2;
};

struct light_t
{
    vec3 pos;
    uint lightParms;
    vec4 posShadow;
    vec4 falloffR;
    vec4 projS;
    vec4 projT;
    vec4 projQ;
    uvec4 scaleBias;
    vec4 boxMin;
    vec4 boxMax;
    vec4 areaPlane;
    uint lightParms2;
    uint colorPacked;
    float specMultiplier;
    float shadowBleedReduce;
};

struct shadowparms_t
{
    vec4 shadowLightS;
    vec4 shadowLightT;
    vec4 shadowLightR;
    vec4 shadowLightQ;
    vec4 shadowAtlasScaleBias;
};


// Vk3DVision (http://3dsurroundgaming.com/) - Stereo Injection
layout(set = 0, binding = 30, std140) uniform Vk3DParams
{
    vec4 stereo;
    vec4 custom_params;
} vk3d_params;

layout(set = 0, binding = 6, std140) uniform freqLow_fragmentUniforms_ubo
{
    vec4 globalvieworigin;
    vec4 resolutionscale;
    vec4 projectionmatrixz;
    vec4 clusteredlighting;
    vec4 envirradiancescale;
    vec4 pbrdebugparms;
    vec4 parallellightslicescale;
    vec4 shadowatlasresolution;
    vec4 globalpostowindowx;
    vec4 globalpostowindowy;
    vec4 globalpostowindowz;
    vec4 globalpostowindoww;
    vec4 foglightinscattercolor;
    vec4 foglightinscatterintensity;
    vec4 foglightoppositecolor;
    vec4 fogcolor;
    vec4 transparencylightmult;
    vec4 highlightcolor;
} freqLow_fragmentUniforms;

layout(set = 0, binding = 5, std140) uniform freqHigh_fragmentUniforms_ubo
{
    vec4 tiling;
    vec4 glassalbedo;
    vec4 staticmodel;
    vec4 positiontoviewtexture;
} freqHigh_fragmentUniforms;

layout(set = 0, binding = 26, std430) restrict readonly buffer clusternumlights_b
{
    clusternumlights_t clusternumlights[];
} _1300;

layout(set = 0, binding = 27, std430) restrict readonly buffer clusterlightsid_b
{
    uint clusterlightsid[];
} _1408;

layout(set = 0, binding = 7, std140) uniform decalparms1_ubo
{
    vec4 decalparms1[4096];
} _1438;

layout(set = 0, binding = 8, std140) uniform decalparms2_ubo
{
    vec4 decalparms2[4096];
} _1458;

layout(set = 0, binding = 9, std140) uniform decalparms3_ubo
{
    vec4 decalparms3[4096];
} _1510;

layout(set = 0, binding = 10, std140) uniform lightparms1_ubo
{
    vec4 lightparms1[4096];
} _2361;

layout(set = 0, binding = 11, std140) uniform lightparms2_ubo
{
    vec4 lightparms2[4096];
} _2400;

layout(set = 0, binding = 12, std140) uniform lightparms3_ubo
{
    vec4 lightparms3[4096];
} _2468;

layout(set = 0, binding = 13, std140) uniform shadowsparmsubo_ubo
{
    vec4 shadowsparmsubo[4095];
} _3391;

layout(set = 0, binding = 14) uniform sampler2D samp_sparediffusemap;
layout(set = 0, binding = 15) uniform sampler2D samp_sparebumpmap;
layout(set = 0, binding = 16) uniform sampler2D samp_sparepowermap;
layout(set = 0, binding = 17) uniform sampler2D samp_decalsatlasmap;
layout(set = 0, binding = 18) uniform samplerCubeArray samp_envprobesmaparray;
layout(set = 0, binding = 19) uniform sampler2D samp_lightsatlasmap;
layout(set = 0, binding = 20) uniform sampler2DShadow samp_shadowatlasdepthcomparemap;
layout(set = 0, binding = 21) uniform sampler2D samp_scenemip0;
layout(set = 0, binding = 22) uniform sampler2D samp_scenemip1;
layout(set = 0, binding = 23) uniform sampler2D samp_scenemip2;
layout(set = 0, binding = 24) uniform sampler2D samp_scenemip3;
layout(set = 0, binding = 25) uniform sampler2D samp_scenemip4;

layout(location = 2) in vec4 vofi_TexCoord0;
layout(location = 6) in vec4 vofi_TexCoord4;
layout(location = 3) in vec4 vofi_TexCoord1;
layout(location = 4) in vec4 vofi_TexCoord2;
layout(location = 5) in vec4 vofi_TexCoord3;
layout(location = 10) in vec4 vofi_TexCoord8;
layout(location = 11) in vec4 vofi_TexCoord9;
layout(location = 12) in vec4 vofi_TexCoord10;
layout(location = 7) in vec4 vofi_TexCoord5;
layout(location = 0) out vec4 out_FragColor0;

float _393;

vec4 tex2D(sampler2D image, vec2 texcoord)
{
    return texture(image, texcoord);
}

float SRGBlinear(float value)
{
    if (value <= 0.040449999272823333740234375)
    {
        return value / 12.9200000762939453125;
    }
    else
    {
        return pow((value / 1.05499994754791259765625) + 0.0521326996386051177978515625, 2.400000095367431640625);
    }
}

vec3 SRGBlinear(vec3 sRGB)
{
    float param = sRGB.x;
    vec3 outLinear;
    outLinear.x = SRGBlinear(param);
    float param_1 = sRGB.y;
    outLinear.y = SRGBlinear(param_1);
    float param_2 = sRGB.z;
    outLinear.z = SRGBlinear(param_2);
    return outLinear;
}

vec4 SRGBlinear(vec4 sRGBA)
{
    vec3 param = sRGBA.xyz;
    vec4 outLinear = vec4(SRGBlinear(param), 1.0);
    float param_1 = sRGBA.w;
    outLinear.w = SRGBlinear(param_1);
    return outLinear;
}

vec4 DeGamma(vec4 color)
{
    vec4 param = color;
    return SRGBlinear(param);
}

vec4 tex2DDeGamma(sampler2D image, vec2 texcoord)
{
    vec2 param = texcoord;
    vec4 color = tex2D(image, param);
    vec4 param_1 = color;
    color = DeGamma(param_1);
    return color;
}

vec2 screenPosToTexcoord(vec2 pos, vec4 bias_scale)
{
    return (pos * bias_scale.zw) + bias_scale.xy;
}

float GetLinearDepth(float ndcZ, vec4 projectionMatrixZ, float rcpFarZ, bool bFirstPersonArmsRescale)
{
    float linearZ = projectionMatrixZ.w / (ndcZ + projectionMatrixZ.z);
    if (bFirstPersonArmsRescale)
    {
        float _968;
        if (linearZ < 1.0)
        {
            _968 = 10.0;
        }
        else
        {
            _968 = 1.0;
        }
        linearZ *= _968;
    }
    return linearZ * rcpFarZ;
}

vec3 saturate(vec3 v)
{
    return clamp(v, vec3(0.0), vec3(1.0));
}

uint packR10G10B10(inout vec3 value)
{
    vec3 param = value;
    value = saturate(param);
    return ((uint(value.x * 1023.0) << uint(20)) | (uint(value.y * 1023.0) << uint(10))) | uint(value.z * 1023.0);
}

float saturate(float v)
{
    return clamp(v, 0.0, 1.0);
}

vec3 ReconstructNormal(vec3 normalTS, bool isFrontFacing)
{
    vec3 N = (normalTS * 2.0) - vec3(1.0);
    float param = (1.0 - (N.x * N.x)) - (N.y * N.y);
    N.z = sqrt(saturate(param));
    if (isFrontFacing == false)
    {
        N.z = -N.z;
    }
    return N;
}

vec3 TransformNormal(vec3 normal, mat3 mat)
{
    return normalize(vec3(dot(normal, mat[0]), dot(normal, mat[1]), dot(normal, mat[2])));
}

vec3 GetWorldSpaceNormal(vec3 normalTS, mat3 invTS, bool isFrontFacing)
{
    vec3 param = normalTS;
    bool param_1 = isFrontFacing;
    vec3 N = ReconstructNormal(param, param_1);
    vec3 param_2 = N;
    mat3 param_3 = invTS;
    return TransformNormal(param_2, param_3);
}

uint asuint(float x)
{
    return floatBitsToUint(x);
}

float fmin3(float f1, float f2, float f3)
{
    return min(f1, min(f2, f3));
}

float fmax3(float f1, float f2, float f3)
{
    return max(f1, max(f2, f3));
}

vec4 unpackR15G15B15A15(uvec2 value)
{
    return vec4(float((value.x >> uint(16)) & 65535u), float(value.x & 65535u), float((value.y >> uint(16)) & 65535u), float(value.y & 65535u)) * 3.0518509447574615478515625e-05;
}

vec4 tex2D(sampler2D image, vec2 texcoord, vec2 dx, vec2 dy)
{
    return textureGrad(image, texcoord, dx, dy);
}

vec4 texPhys(sampler2D image, vec2 texcoord, vec2 dx, vec2 dy)
{
    vec2 param = texcoord;
    vec2 param_1 = dx;
    vec2 param_2 = dy;
    return tex2D(image, param, param_1, param_2);
}

vec4 unpackUintR8G8B8A8(uint value)
{
    return vec4(float((value >> uint(24)) & 255u), float((value >> uint(16)) & 255u), float((value >> uint(8)) & 255u), float(value & 255u));
}

vec4 unpackR8G8B8A8(uint value)
{
    return vec4(float((value >> uint(24)) & 255u), float((value >> uint(16)) & 255u), float((value >> uint(8)) & 255u), float(value & 255u)) / vec4(255.0);
}

int asint(float x)
{
    return floatBitsToInt(x);
}

float asfloat(int x)
{
    return intBitsToFloat(x);
}

float sqrtIEEEIntApproximation(float inX, int inSqrtConst)
{
    float param = inX;
    int x = asint(param);
    x = inSqrtConst + (x >> 1);
    int param_1 = x;
    return asfloat(param_1);
}

float fastSqrtNR0(float inX)
{
    float param = inX;
    int param_1 = 532487669;
    return sqrtIEEEIntApproximation(param, param_1);
}

vec3 unpackR10G10B10(uint value)
{
    return vec3(float((value >> uint(20)) & 1023u), float((value >> uint(10)) & 1023u), float(value & 1023u)) / vec3(1023.0);
}

float GetLuma(vec3 c)
{
    return dot(c, vec3(0.2125999927520751953125, 0.715200006961822509765625, 0.072200000286102294921875));
}

float ApproxLog2(float f)
{
    float param = f;
    return (float(asuint(param)) / 8388608.0) - 127.0;
}

float asfloat(uint x)
{
    return uintBitsToFloat(x);
}

float ApproxExp2(float f)
{
    uint param = uint((f + 127.0) * 8388608.0);
    return asfloat(param);
}

vec4 saturate(vec4 v)
{
    return clamp(v, vec4(0.0), vec4(1.0));
}

uint packR8G8B8A8(inout vec4 value)
{
    vec4 param = value;
    value = saturate(param);
    return (((uint(value.x * 255.0) << uint(24)) | (uint(value.y * 255.0) << uint(16))) | (uint(value.z * 255.0) << uint(8))) | uint(value.w * 255.0);
}

uint packRGBE(vec3 value)
{
    float param = max(max(value.x, value.y), value.z);
    float sharedExp = ceil(ApproxLog2(param));
    float param_1 = sharedExp;
    vec4 param_2 = vec4(value / vec3(ApproxExp2(param_1)), (sharedExp + 128.0) / 255.0);
    vec4 param_3 = saturate(param_2);
    uint _739 = packR8G8B8A8(param_3);
    return _739;
}

vec3 unpackRGBE(uint value)
{
    uint param = value;
    vec4 rgbe = unpackR8G8B8A8(param);
    float param_1 = (rgbe.w * 255.0) - 128.0;
    return rgbe.xyz * ApproxExp2(param_1);
}

vec4 texCUBEARRAYlod(samplerCubeArray image, vec4 texcoord, float lod)
{
    return textureLod(image, texcoord, lod);
}

vec3 environmentBRDF(float NdotV, float smoothness, vec3 f0)
{
    float t1 = 0.0949999988079071044921875 + (smoothness * (0.60000002384185791015625 + (4.190000057220458984375 * smoothness)));
    float t2 = NdotV + 0.02500000037252902984619140625;
    float t3 = (9.5 * smoothness) * NdotV;
    float param = 1.0 - (14.0 * NdotV);
    float a0 = (t1 * t2) * ApproxExp2(param);
    float param_1 = -t3;
    float a1 = 0.4000000059604644775390625 + (0.60000002384185791015625 * (1.0 - ApproxExp2(param_1)));
    return mix(vec3(a0), vec3(a1), f0);
}

vec4 tex2Dlod(sampler2D image, vec4 texcoord)
{
    return textureLod(image, texcoord.xy, texcoord.w);
}

uint getCubeMapFaceID(float x, float y, float z)
{
    bool _323 = abs(z) >= abs(x);
    bool _331;
    if (_323)
    {
        _331 = abs(z) >= abs(y);
    }
    else
    {
        _331 = _323;
    }
    if (_331)
    {
        int _334;
        if (z < 0.0)
        {
            _334 = 5;
        }
        else
        {
            _334 = 4;
        }
        return uint(_334);
    }
    if (abs(y) >= abs(x))
    {
        int _352;
        if (y < 0.0)
        {
            _352 = 3;
        }
        else
        {
            _352 = 2;
        }
        return uint(_352);
    }
    int _363;
    if (x < 0.0)
    {
        _363 = 1;
    }
    else
    {
        _363 = 0;
    }
    return uint(_363);
}

float shadow2Ddepth(sampler2DShadow image, vec3 texcoord)
{
    return textureLod(image, vec3(texcoord.xy, texcoord.z), 0.0);
}

vec2 saturate(vec2 v)
{
    return clamp(v, vec2(0.0), vec2(1.0));
}

float ApproxPow(float fBase, float fPower)
{
    float param = fBase;
    uint param_1 = uint((fPower * float(asuint(param))) - (((fPower - 1.0) * 127.0) * 8388608.0));
    return asfloat(param_1);
}

vec3 fresnelSchlick(vec3 f0, float costheta)
{
    float param = 50.0 * dot(f0, vec3(0.33329999446868896484375));
    float baked_spec_occl = saturate(param);
    float param_1 = 1.0 - costheta;
    float param_2 = saturate(param_1);
    float param_3 = 5.0;
    vec3 param_4 = f0 + ((vec3(baked_spec_occl) - f0) * ApproxPow(param_2, param_3));
    return saturate(param_4);
}

vec3 specBRDF(vec3 N, vec3 V, vec3 L, vec3 f0, float smoothness)
{
    vec3 H = normalize(V + L);
    float m = 1.0 - (smoothness * 0.800000011920928955078125);
    m *= m;
    m *= m;
    float m2 = m * m;
    float param = dot(N, H);
    float NdotH = saturate(param);
    float spec = ((NdotH * NdotH) * (m2 - 1.0)) + 1.0;
    spec = m2 / ((spec * spec) + 9.9999999392252902907785028219223e-09);
    float param_1 = dot(N, V);
    float Gv = (saturate(param_1) * (1.0 - m)) + m;
    float param_2 = dot(N, L);
    float Gl = (saturate(param_2) * (1.0 - m)) + m;
    spec /= (((4.0 * Gv) * Gl) + 9.9999999392252902907785028219223e-09);
    vec3 param_3 = f0;
    float param_4 = dot(L, H);
    return fresnelSchlick(param_3, param_4) * spec;
}

vec4 MatrixMul(vec3 pos, mat4 mat)
{
    return vec4((pos.x * mat[0].x) + ((pos.y * mat[0].y) + ((pos.z * mat[0].z) + mat[0].w)), (pos.x * mat[1].x) + ((pos.y * mat[1].y) + ((pos.z * mat[1].z) + mat[1].w)), (pos.x * mat[2].x) + ((pos.y * mat[2].y) + ((pos.z * mat[2].z) + mat[2].w)), (pos.x * mat[3].x) + ((pos.y * mat[3].y) + ((pos.z * mat[3].z) + mat[3].w)));
}

void main()
{
    lightingInput_t inputs = lightingInput_t(vec3(0.0), vec3(0.0), vec3(0.0), 0.0, 0.0, 0.0, vec3(0.0), vec3(0.0, 0.0, 1.0), vec3(0.0, 0.0, 1.0), vec3(0.0), vec3(0.0), 1.0, 1.0, vec3(0.0), vec3(0.0), vec4(0.0), vec4(0.0), mat3(vec3(1.0, 0.0, 0.0), vec3(0.0, 1.0, 0.0), vec3(0.0, 0.0, 1.0)), vec3(0.0), vec3(0.0), vec3(0.0), vec3(0.0), 0u, 0u, 0u, 0u, 0u, uvec4(0u), uvec4(0u), uvec4(0u));
    inputs.texCoords = vofi_TexCoord0;
    inputs.fragCoord = gl_FragCoord;
    inputs.position = freqLow_fragmentUniforms.globalvieworigin.xyz + vofi_TexCoord4.xyz;
    inputs.view = normalize(-vofi_TexCoord4.xyz);
    inputs.invTS = mat3(vec3(vofi_TexCoord1.xyz), vec3(vofi_TexCoord2.xyz), vec3(vofi_TexCoord3.xyz));
    uint feedback = 0u;
    vec4 sampleLightmap = vec4(0.0);
    vec4 sampleColorMask = vec4(0.0);
    vec4 sampleDiffuse = vec4(0.0);
    vec4 sampleSpecular = vec4(0.0);
    vec4 sampleNormal = vec4(0.0);
    inputs.albedo = sampleDiffuse.xyz;
    inputs.specular = sampleSpecular.xyz;
    inputs.colorMask = sampleColorMask.xyz;
    inputs.lightmap = sampleLightmap.xyz;
    inputs.smoothness = sampleLightmap.w;
    inputs.normal = sampleNormal.wyz;
    vec2 tc = vofi_TexCoord0.xy * freqHigh_fragmentUniforms.tiling.xy;
    vec2 param = tc;
    vec4 albedo = tex2DDeGamma(samp_sparediffusemap, param);
    vec4 specular = vec4(0.07999999821186065673828125);
    vec2 param_1 = tc;
    vec4 normal = tex2D(samp_sparebumpmap, param_1);
    vec2 param_2 = tc;
    float smoothness = tex2DDeGamma(samp_sparepowermap, param_2).x;
    inputs.albedo = freqHigh_fragmentUniforms.glassalbedo.xyz * albedo.xyz;
    inputs.alpha = freqHigh_fragmentUniforms.glassalbedo.w * albedo.w;
    inputs.specular = specular.xyz;
    inputs.smoothness = smoothness;
    inputs.normal = normal.xyz;
    int _1188;
    if (freqHigh_fragmentUniforms.staticmodel.x > 0.0)
    {
        _1188 = 8;
    }
    else
    {
        _1188 = 0;
    }
    uint skipStaticModel = uint(_1188);
    float NUM_CLUSTERS_X = 16.0;
    float NUM_CLUSTERS_Y = 8.0;
    float NUM_CLUSTERS_Z = 24.0;
    vec2 param_3 = inputs.fragCoord.xy;
    vec4 param_4 = freqHigh_fragmentUniforms.positiontoviewtexture;
    vec2 _1215 = screenPosToTexcoord(param_3, param_4) * freqLow_fragmentUniforms.resolutionscale.zw;
    vec3 clusterCoordinate;
    clusterCoordinate = vec3(_1215.x, _1215.y, clusterCoordinate.z);
    clusterCoordinate.y = 1.0 - clusterCoordinate.y;

// Vk3DVision (http://3dsurroundgaming.com/) - Stereo Injection
clusterCoordinate.x -= vk3d_params.stereo.x * 0.5; 
    vec2 _1228 = floor(clusterCoordinate.xy * vec2(NUM_CLUSTERS_X, NUM_CLUSTERS_Y));
    clusterCoordinate = vec3(_1228.x, _1228.y, clusterCoordinate.z);
    float param_5 = inputs.fragCoord.z;
    vec4 param_6 = freqLow_fragmentUniforms.projectionmatrixz;
    float param_7 = 1.0;
    bool param_8 = false;
    float curr_z = GetLinearDepth(param_5, param_6, param_7, param_8);
    float slice = log2(max(1.0, curr_z / freqLow_fragmentUniforms.clusteredlighting.z)) * freqLow_fragmentUniforms.clusteredlighting.w;
    clusterCoordinate.z = min(NUM_CLUSTERS_Z - 1.0, floor(slice));
    uint clusterOffset = uint((clusterCoordinate.x + (clusterCoordinate.y * NUM_CLUSTERS_X)) + ((clusterCoordinate.z * NUM_CLUSTERS_X) * NUM_CLUSTERS_Y));
    vec3 param_9 = inputs.albedo;
    uint _1277 = packR10G10B10(param_9);
    inputs.albedo_packed = _1277;
    vec3 param_10 = inputs.specular;
    uint _1283 = packR10G10B10(param_10);
    inputs.specular_packed = _1283;
    uint lightsMin = 0u;
    uint lightsMax = 0u;
    uint decalsMin = 0u;
    uint decalsMax = 0u;
    uint probesMin = 0u;
    uint probesMax = 0u;
    int MAX_LIGHTS_PER_CLUSTER = 256;
    clusternumlights_t cluster;
    cluster.offset = _1300.clusternumlights[clusterOffset].offset;
    cluster.numItems = _1300.clusternumlights[clusterOffset].numItems;
    int dataOffset = cluster.offset & (~(cluster.offset >> 31));
    int numItems = cluster.numItems & (~(cluster.numItems >> 31));
    lightsMin = uint((dataOffset >> 16) * MAX_LIGHTS_PER_CLUSTER);
    lightsMax = lightsMin + uint(numItems & 255);
    decalsMin = lightsMin;
    decalsMax = decalsMin + uint((numItems >> 8) & 255);
    probesMin = lightsMin;
    probesMax = probesMin + uint((numItems >> 16) & 255);
    bool isFrontFacing = true;
    vec3 param_11 = inputs.normal;
    bool param_12 = isFrontFacing;
    inputs.normalTS = ReconstructNormal(param_11, param_12);
    vec3 param_13 = inputs.normal;
    mat3 param_14 = inputs.invTS;
    bool param_15 = isFrontFacing;
    inputs.normal = GetWorldSpaceNormal(param_13, param_14, param_15);
    vec3 posDDX = dFdx(inputs.position);
    vec3 posDDY = dFdy(inputs.position);
    bool _1381 = skipStaticModel == 0u;
    bool _1387;
    if (_1381)
    {
        _1387 = freqHigh_fragmentUniforms.staticmodel.y == 0.0;
    }
    else
    {
        _1387 = _1381;
    }
    uint _1379;
    if (_1387)
    {
        _1379 = decalsMax;
    }
    else
    {
        _1379 = decalsMin;
    }
    decalsMin = _1379;
    uint d = decalsMin;
    decal_t decal;
    vec3 _1799;
    while (d < decalsMax)
    {
        uint temp = _1408.clusterlightsid[d];
        uint divergentId = (temp >> uint(12)) & 4095u;
        uint decal_id = divergentId;
        if (decal_id >= divergentId)
        {
            d++;
        }
        int decalParms1Size = 2;
        int decalParms2Size = 2;
        int decalParms3Size = 2;
        decal.projS = _1438.decalparms1[(uint(decalParms1Size) * decal_id) + 0u];
        decal.projT = _1438.decalparms1[(uint(decalParms1Size) * decal_id) + 1u];
        decal.projR = _1458.decalparms2[(uint(decalParms2Size) * decal_id) + 0u];
        float param_16 = _1458.decalparms2[(uint(decalParms2Size) * decal_id) + 1u].x;
        decal.albedoScaleBias.x = asuint(param_16);
        float param_17 = _1458.decalparms2[(uint(decalParms2Size) * decal_id) + 1u].y;
        decal.albedoScaleBias.y = asuint(param_17);
        float param_18 = _1458.decalparms2[(uint(decalParms2Size) * decal_id) + 1u].z;
        decal.specScaleBias.x = asuint(param_18);
        float param_19 = _1458.decalparms2[(uint(decalParms2Size) * decal_id) + 1u].w;
        decal.specScaleBias.y = asuint(param_19);
        float param_20 = _1510.decalparms3[(uint(decalParms3Size) * decal_id) + 0u].x;
        decal.normalScaleBias.x = asuint(param_20);
        float param_21 = _1510.decalparms3[(uint(decalParms3Size) * decal_id) + 0u].y;
        decal.normalScaleBias.y = asuint(param_21);
        float param_22 = _1510.decalparms3[(uint(decalParms3Size) * decal_id) + 0u].z;
        decal.opacity = asuint(param_22);
        float param_23 = _1510.decalparms3[(uint(decalParms3Size) * decal_id) + 0u].w;
        decal.decalParms = asuint(param_23);
        float param_24 = _1510.decalparms3[(uint(decalParms3Size) * decal_id) + 1u].x;
        decal.albedo = asuint(param_24);
        float param_25 = _1510.decalparms3[(uint(decalParms3Size) * decal_id) + 1u].y;
        decal.emissive = asuint(param_25);
        float param_26 = _1510.decalparms3[(uint(decalParms3Size) * decal_id) + 1u].z;
        decal.specOverride = asuint(param_26);
        float param_27 = _1510.decalparms3[(uint(decalParms3Size) * decal_id) + 1u].w;
        decal.decalParms2 = asuint(param_27);
        vec4 projS = decal.projS;
        vec4 projR = decal.projR;
        vec4 projT = decal.projT;
        vec3 projTC = vec3((inputs.position.x * projS.x) + ((inputs.position.y * projS.y) + ((inputs.position.z * projS.z) + projS.w)), (inputs.position.x * projT.x) + ((inputs.position.y * projT.y) + ((inputs.position.z * projT.z) + projT.w)), (inputs.position.x * projR.x) + ((inputs.position.y * projR.y) + ((inputs.position.z * projR.z) + projR.w)));
        float clip_min = 0.0039215688593685626983642578125;
        float param_28 = projTC.x;
        float param_29 = projTC.y;
        float param_30 = projTC.z;
        bool _1675 = fmin3(param_28, param_29, param_30) <= clip_min;
        bool _1692;
        if (!_1675)
        {
            float param_31 = projTC.x;
            float param_32 = projTC.y;
            float param_33 = projTC.z;
            _1692 = fmax3(param_31, param_32, param_33) >= (1.0 - clip_min);
        }
        else
        {
            _1692 = _1675;
        }
        if (_1692)
        {
            continue;
        }
        uint decalParms2 = decal.decalParms2;
        bool _1700 = skipStaticModel != 0u;
        bool _1707;
        if (_1700)
        {
            _1707 = (decalParms2 & 512u) != 0u;
        }
        else
        {
            _1707 = _1700;
        }
        bool _1720;
        if (!_1707)
        {
            bool _1712 = skipStaticModel == 0u;
            bool _1719;
            if (_1712)
            {
                _1719 = (decalParms2 & 1024u) != 0u;
            }
            else
            {
                _1719 = _1712;
            }
            _1720 = _1719;
        }
        else
        {
            _1720 = _1707;
        }
        if (_1720)
        {
            continue;
        }
        vec2 uvDDX = vec2(dot(posDDX, projS.xyz), dot(posDDX, projT.xyz));
        vec2 uvDDY = vec2(dot(posDDY, projS.xyz), dot(posDDY, projT.xyz));
        float decalAlpha = 1.0;
        vec3 decalNormal = vec3(0.5, 0.5, 1.0);
        vec3 decalNormalTS = vec3(0.0, 0.0, 1.0);
        uint decalParms = decal.decalParms;
        uvec2 param_34 = decal.normalScaleBias;
        vec4 normalScaleBias = unpackR15G15B15A15(param_34);
        vec2 normalUVDDX = uvDDX * normalScaleBias.xy;
        vec2 normalUVDDY = uvDDY * normalScaleBias.xy;
        vec2 param_35 = (projTC.xy * normalScaleBias.xy) + normalScaleBias.zw;
        vec2 param_36 = normalUVDDX;
        vec2 param_37 = normalUVDDY;
        vec4 temp_1 = texPhys(samp_decalsatlasmap, param_35, param_36, param_37);
        decalNormal = temp_1.xyz;
        decalAlpha = temp_1.w;
        decalNormalTS = (decalNormal * 2.0) - vec3(1.0);
        if (decalAlpha <= (4.0 * clip_min))
        {
            continue;
        }
        decalNormal = decalNormalTS;
        if ((decalParms2 & 128u) != 0u)
        {
            _1799 = vec3(-decalNormal.x, -decalNormal.y, decalNormal.z);
        }
        else
        {
            _1799 = decalNormal;
        }
        decalNormal = _1799;
        uint packed_albedo = decal.albedo;
        uint param_38 = packed_albedo;
        float z_soft_scale = 1.0 + (unpackUintR8G8B8A8(param_38).w * 0.062745101749897003173828125);
        uint param_39 = decalParms;
        float emissive_blending_time = unpackR8G8B8A8(param_39).z;
        uint param_40 = packed_albedo;
        vec3 decalAlbedo = unpackR8G8B8A8(param_40).xyz;
        float param_41 = z_soft_scale - (z_soft_scale * abs((projTC.z * 2.0) - 1.0));
        decalAlpha *= saturate(param_41);
        float emissiveMask = decalAlpha;
        if ((decalParms & 1u) != 0u)
        {
            vec3 albedoTint = decalAlbedo;
            decalAlbedo = vec3(0.0);
            uvec2 param_42 = decal.albedoScaleBias;
            vec4 albedoScaleBias = unpackR15G15B15A15(param_42);
            vec2 albedoUVDDX = uvDDX * albedoScaleBias.xy;
            vec2 albedoUVDDY = uvDDY * albedoScaleBias.xy;
            vec2 param_43 = (projTC.xy * albedoScaleBias.xy) + albedoScaleBias.zw;
            vec2 param_44 = albedoUVDDX;
            vec2 param_45 = albedoUVDDY;
            vec4 temp_2 = texPhys(samp_decalsatlasmap, param_43, param_44, param_45);
            temp_2 *= temp_2;
            decalAlbedo = temp_2.xyz;
            emissiveMask = temp_2.w;
            decalAlbedo *= albedoTint;
        }
        vec3 vertexNormal = normalize(vec3(inputs.invTS[0].z, inputs.invTS[1].z, inputs.invTS[2].z));
        float param_46 = dot(vertexNormal, normalize(projR.xyz));
        float angleWeight = saturate(param_46);
        uint packed_emissive = decal.emissive;
        uint param_47 = packed_emissive;
        vec4 emissive_parms = unpackR8G8B8A8(param_47);
        inputs.emissive += ((decalAlbedo * angleWeight) * ((emissive_parms.xyz * ((emissiveMask * emissive_parms.w) * 16.0)) * emissive_blending_time));
        uint specOverride = decal.specOverride;
        uint param_48 = specOverride;
        vec4 decalSpecular = unpackR8G8B8A8(param_48);
        if ((decalParms & 2u) != 0u)
        {
            uvec2 param_49 = decal.specScaleBias;
            vec4 specScaleBias = unpackR15G15B15A15(param_49);
            vec2 specUVDDX = uvDDX * specScaleBias.xy;
            vec2 specUVDDY = uvDDY * specScaleBias.xy;
            vec2 param_50 = (projTC.xy * specScaleBias.xy) + specScaleBias.zw;
            vec2 param_51 = specUVDDX;
            vec2 param_52 = specUVDDY;
            decalSpecular = texPhys(samp_decalsatlasmap, param_50, param_51, param_52);
            decalSpecular *= decalSpecular;
        }
        if ((decalParms & 32u) != 0u)
        {
            uint param_53 = decalParms;
            float blending_time = unpackR8G8B8A8(param_53).x;
            uint param_54 = decalParms;
            float threshold_softness = unpackUintR8G8B8A8(param_54).y;
            float param_55 = dot((projTC.xy + decalNormalTS.xy) - vec2(0.5), (projTC.xy + decalNormalTS.xy) - vec2(0.5));
            float center_attenuation = saturate(param_55);
            float param_56 = threshold_softness * (blending_time - center_attenuation);
            float param_57 = saturate(param_56);
            float threshold_alpha = fastSqrtNR0(param_57);
            decalAlpha = min(decalAlpha, threshold_alpha);
        }
        float alpha_mask = decalAlpha * angleWeight;
        uint packed_opacity = decal.opacity;
        uint param_58 = packed_opacity;
        vec4 opacity = unpackR8G8B8A8(param_58) * alpha_mask;
        inputs.alpha = max(inputs.alpha, opacity.x);
        uint param_59 = inputs.albedo_packed;
        vec3 param_60 = mix(unpackR10G10B10(param_59), decalAlbedo, opacity.xxx);
        uint _2062 = packR10G10B10(param_60);
        inputs.albedo_packed = _2062;
        uint param_61 = inputs.specular_packed;
        vec3 param_62 = mix(unpackR10G10B10(param_61), decalSpecular.xyz, opacity.yyy);
        uint _2074 = packR10G10B10(param_62);
        inputs.specular_packed = _2074;
        vec3 projNormal = vertexNormal;
        vec3 _2086 = projS.xyz + (projNormal * dot(projS.xyz, projNormal));
        projS = vec4(_2086.x, _2086.y, _2086.z, projS.w);
        vec3 _2097 = projT.xyz + (projNormal * dot(projT.xyz, projNormal));
        projT = vec4(_2097.x, _2097.y, _2097.z, projT.w);
        decalNormal = ((normalize(projS.xyz) * decalNormal.x) + (normalize(projT.xyz) * decalNormal.y)) + (projNormal * decalNormal.z);
        if ((decalParms2 & 256u) != 0u)
        {
            vec3 decalBlend = mix(vertexNormal, decalNormal, opacity.www);
            float normalProj = dot(decalBlend, vertexNormal);
            decalNormal = (inputs.normal * normalProj) + ((decalBlend - (vertexNormal * normalProj)) * dot(inputs.normal, vertexNormal));
        }
        else
        {
            if ((decalParms2 & 64u) != 0u)
            {
                decalNormal = mix(mix(inputs.normal, vertexNormal, vec3(alpha_mask)), decalNormal, opacity.www);
            }
            else
            {
                decalNormal = mix(inputs.normal, decalNormal, opacity.www);
            }
        }
        inputs.normal = normalize(decalNormal);
        float param_63 = length(decalNormal);
        float Na = saturate(param_63);
        if (Na < 1.0)
        {
            float roughness = 1.0 - decalSpecular.w;
            float Na2 = Na * Na;
            float k = ((3.0 * Na) - (Na * Na2)) / (1.0 - Na2);
            float variance = 1.0 / (2.0 * k);
            float param_64 = (roughness * roughness) + variance;
            decalSpecular.w = 1.0 - fastSqrtNR0(param_64);
        }
        inputs.smoothness = mix(inputs.smoothness, decalSpecular.w, opacity.z);
    }
    vec3 ambient = vec3(0.0);
    vec3 shc0 = vec3(vofi_TexCoord8.x, vofi_TexCoord8.y, vofi_TexCoord8.z);
    vec3 shc1 = vec3(vofi_TexCoord8.w, vofi_TexCoord9.x, vofi_TexCoord9.y);
    vec3 shc2 = vec3(vofi_TexCoord9.z, vofi_TexCoord9.w, vofi_TexCoord10.x);
    vec3 shc3 = vec3(vofi_TexCoord10.y, vofi_TexCoord10.z, vofi_TexCoord10.w);
    vec3 indirectDiffuse = ((shc0 - (shc1 * inputs.normal.y)) + (shc2 * inputs.normal.z)) - (shc3 * inputs.normal.x);
    float param_65 = freqLow_fragmentUniforms.envirradiancescale.x;
    ambient += max((indirectDiffuse * vec3(1.0)) * saturate(param_65), vec3(0.0));
    ambient += inputs.emissive;
    float _2293;
    if (dot(inputs.emissive, vec3(1.0)) > 0.0)
    {
        _2293 = -inputs.smoothness;
    }
    else
    {
        _2293 = inputs.smoothness;
    }
    inputs.smoothness = _2293;
    vec3 param_66 = ambient;
    ambient = mix(vec3(GetLuma(param_66)), ambient, freqLow_fragmentUniforms.pbrdebugparms.www);
    inputs.ambient_lighting = ambient;
    vec3 param_67 = ambient;
    inputs.diffuse_lighting_packed = packRGBE(param_67);
    float probes_dst_alpha = 1.0;
    uint probeIdx = probesMin;
    light_t lightParms;
    while (probeIdx < probesMax)
    {
        uint temp_3 = _1408.clusterlightsid[probeIdx];
        uint divergentProbeId = (temp_3 >> uint(24)) & 4095u;
        uint probe_id = divergentProbeId;
        if (probe_id >= divergentProbeId)
        {
            probeIdx++;
        }
        int lightParms1Size = 4;
        int lightParms2Size = 4;
        int lightParms3Size = 3;
        lightParms.pos = _2361.lightparms1[(uint(lightParms1Size) * probe_id) + 0u].xyz;
        float param_68 = _2361.lightparms1[(uint(lightParms1Size) * probe_id) + 0u].w;
        lightParms.lightParms = asuint(param_68);
        lightParms.posShadow = _2361.lightparms1[(uint(lightParms1Size) * probe_id) + 1u];
        lightParms.falloffR = _2361.lightparms1[(uint(lightParms1Size) * probe_id) + 2u];
        lightParms.projS = _2400.lightparms2[(uint(lightParms2Size) * probe_id) + 0u];
        lightParms.projT = _2400.lightparms2[(uint(lightParms2Size) * probe_id) + 1u];
        lightParms.projQ = _2400.lightparms2[(uint(lightParms2Size) * probe_id) + 2u];
        float param_69 = _2361.lightparms1[(uint(lightParms1Size) * probe_id) + 3u].x;
        lightParms.scaleBias.x = asuint(param_69);
        float param_70 = _2361.lightparms1[(uint(lightParms1Size) * probe_id) + 3u].y;
        lightParms.scaleBias.y = asuint(param_70);
        float param_71 = _2361.lightparms1[(uint(lightParms1Size) * probe_id) + 3u].z;
        lightParms.scaleBias.z = asuint(param_71);
        float param_72 = _2361.lightparms1[(uint(lightParms1Size) * probe_id) + 3u].w;
        lightParms.scaleBias.w = asuint(param_72);
        lightParms.boxMin = _2468.lightparms3[(uint(lightParms3Size) * probe_id) + 0u];
        lightParms.boxMax = _2468.lightparms3[(uint(lightParms3Size) * probe_id) + 1u];
        lightParms.areaPlane = _2468.lightparms3[(uint(lightParms3Size) * probe_id) + 2u];
        float param_73 = _2400.lightparms2[(uint(lightParms2Size) * probe_id) + 3u].x;
        lightParms.lightParms2 = asuint(param_73);
        float param_74 = _2400.lightparms2[(uint(lightParms2Size) * probe_id) + 3u].y;
        lightParms.colorPacked = asuint(param_74);
        lightParms.specMultiplier = _2400.lightparms2[(uint(lightParms2Size) * probe_id) + 3u].z;
        lightParms.shadowBleedReduce = _2400.lightparms2[(uint(lightParms2Size) * probe_id) + 3u].w;
        vec3 projTC_1 = vec3((inputs.position.x * lightParms.projS.x) + ((inputs.position.y * lightParms.projS.y) + ((inputs.position.z * lightParms.projS.z) + lightParms.projS.w)), (inputs.position.x * lightParms.projT.x) + ((inputs.position.y * lightParms.projT.y) + ((inputs.position.z * lightParms.projT.z) + lightParms.projT.w)), (inputs.position.x * lightParms.projQ.x) + ((inputs.position.y * lightParms.projQ.y) + ((inputs.position.z * lightParms.projQ.z) + lightParms.projQ.w)));
        vec2 _2596 = projTC_1.xy / vec2(projTC_1.z);
        projTC_1 = vec3(_2596.x, _2596.y, projTC_1.z);
        projTC_1.z = (inputs.position.x * lightParms.falloffR.x) + ((inputs.position.y * lightParms.falloffR.y) + ((inputs.position.z * lightParms.falloffR.z) + lightParms.falloffR.w));
        float clip_min_1 = 0.0039215688593685626983642578125;
        float param_75 = projTC_1.x;
        float param_76 = projTC_1.y;
        float param_77 = projTC_1.z;
        bool _2632 = fmin3(param_75, param_76, param_77) <= clip_min_1;
        bool _2649;
        if (!_2632)
        {
            float param_78 = projTC_1.x;
            float param_79 = projTC_1.y;
            float param_80 = projTC_1.z;
            _2649 = fmax3(param_78, param_79, param_80) >= (1.0 - clip_min_1);
        }
        else
        {
            _2649 = _2632;
        }
        if (_2649)
        {
            continue;
        }
        uint light_parms = lightParms.lightParms;
        uint param_81 = lightParms.colorPacked;
        vec3 light_color = unpackRGBE(param_81);
        float light_spec_multiplier = lightParms.specMultiplier;
        vec3 light_position = lightParms.pos;
        uint param_82 = light_parms;
        float light_probe_innerfalloff = unpackR8G8B8A8(param_82).y;
        vec3 norm_pos_cube = (projTC_1 * 2.0) - vec3(1.0);
        vec3 norm_pos_sphere = norm_pos_cube * sqrt(((vec3(1.0) - ((norm_pos_cube.yzx * norm_pos_cube.yzx) * 0.5)) - ((norm_pos_cube.zxy * norm_pos_cube.zxy) * 0.5)) + ((((norm_pos_cube.yzx * norm_pos_cube.yzx) * norm_pos_cube.zxy) * norm_pos_cube.zxy) / vec3(3.0)));
        float param_83 = 1.0 - ((length(norm_pos_sphere) - light_probe_innerfalloff) / ((1.0 - light_probe_innerfalloff) + 9.9999999747524270787835121154785e-07));
        float light_attenuation = saturate(param_83);
        light_attenuation *= light_attenuation;
        light_attenuation *= (lightParms.boxMin.w * probes_dst_alpha);
        probes_dst_alpha *= (1.0 - light_attenuation);
        if (light_attenuation <= (clip_min_1 * 4.0))
        {
            continue;
        }
        vec3 light_color_final = light_color;
        vec3 param_84 = light_color_final;
        light_color_final = mix(vec3(GetLuma(param_84)), light_color_final, freqLow_fragmentUniforms.pbrdebugparms.www);
        uint param_85 = light_parms;
        float light_probe_id = unpackUintR8G8B8A8(param_85).z;
        vec3 diffEnvProbe = vec3(0.0);
        vec3 specEnvProbe = vec3(0.0);
        vec3 normal_1 = inputs.normal;
        normal_1.x = dot(lightParms.posShadow.xy, inputs.normal.xy);
        normal_1.y = dot(lightParms.posShadow.zw, inputs.normal.xy);
        vec3 R = reflect(-inputs.view, inputs.normal);
        vec3 bmax = (lightParms.boxMax.xyz - inputs.position) / R;
        vec3 bmin = (lightParms.boxMin.xyz - inputs.position) / R;
        vec3 bminmax = max(bmax, bmin);
        float param_86 = bminmax.x;
        float param_87 = bminmax.y;
        float param_88 = bminmax.z;
        float intersection_dist = fmin3(param_86, param_87, param_88);
        vec3 intersection_pos = inputs.position + (R * intersection_dist);
        vec3 LRtmp = normalize(intersection_pos - light_position);
        vec3 LR = LRtmp;
        LR.x = dot(lightParms.posShadow.xy, LRtmp.xy);
        LR.y = dot(lightParms.posShadow.zw, LRtmp.xy);
        float num_mips = 6.0;
        float mip_level = num_mips - (num_mips * abs(inputs.smoothness));
        vec4 param_89 = vec4(LR, light_probe_id);
        float param_90 = mip_level;
        specEnvProbe = texCUBEARRAYlod(samp_envprobesmaparray, param_89, param_90).xyz;
        float param_91 = dot(inputs.view, inputs.normal);
        float NdotV = saturate(param_91);
        uint param_92 = inputs.specular_packed;
        float param_93 = NdotV;
        float param_94 = abs(inputs.smoothness);
        vec3 param_95 = unpackR10G10B10(param_92);
        vec3 envBRDF = environmentBRDF(param_93, param_94, param_95);
        specEnvProbe *= (envBRDF * light_spec_multiplier);
        vec3 param_96 = diffEnvProbe;
        diffEnvProbe = mix(vec3(GetLuma(param_96)), diffEnvProbe, freqLow_fragmentUniforms.pbrdebugparms.www);
        vec3 param_97 = specEnvProbe;
        specEnvProbe = mix(vec3(GetLuma(param_97)), specEnvProbe, freqLow_fragmentUniforms.pbrdebugparms.www);
        float param_98 = light_attenuation;
        uint param_99 = inputs.specular_lighting_packed;
        vec3 param_100 = ((specEnvProbe * light_color_final) * saturate(param_98)) + unpackRGBE(param_99);
        inputs.specular_lighting_packed = packRGBE(param_100);
        if (probes_dst_alpha <= (clip_min_1 * 4.0))
        {
            break;
        }
    }
    uint lightIdx = lightsMin;
    light_t lightParms_1;
    shadowparms_t shadow_parms;
    shadowparms_t shadow_parms_1;
    shadowparms_t shadow_parms_2;
    int _3659;
    shadowparms_t shadow_parms_3;
    float _4149;
    float _4294;
    vec3 _4369;
    vec3 _4382;
    while (lightIdx < lightsMax)
    {
        uint temp_4 = _1408.clusterlightsid[lightIdx];
        uint divergentLightId = temp_4 & 4095u;
        uint light_id = divergentLightId;
        if (light_id >= divergentLightId)
        {
            lightIdx++;
        }
        int lightParms1Size_1 = 4;
        int lightParms2Size_1 = 4;
        int lightParms3Size_1 = 3;
        lightParms_1.pos = _2361.lightparms1[(uint(lightParms1Size_1) * light_id) + 0u].xyz;
        float param_101 = _2361.lightparms1[(uint(lightParms1Size_1) * light_id) + 0u].w;
        lightParms_1.lightParms = asuint(param_101);
        lightParms_1.posShadow = _2361.lightparms1[(uint(lightParms1Size_1) * light_id) + 1u];
        lightParms_1.falloffR = _2361.lightparms1[(uint(lightParms1Size_1) * light_id) + 2u];
        lightParms_1.projS = _2400.lightparms2[(uint(lightParms2Size_1) * light_id) + 0u];
        lightParms_1.projT = _2400.lightparms2[(uint(lightParms2Size_1) * light_id) + 1u];
        lightParms_1.projQ = _2400.lightparms2[(uint(lightParms2Size_1) * light_id) + 2u];
        float param_102 = _2361.lightparms1[(uint(lightParms1Size_1) * light_id) + 3u].x;
        lightParms_1.scaleBias.x = asuint(param_102);
        float param_103 = _2361.lightparms1[(uint(lightParms1Size_1) * light_id) + 3u].y;
        lightParms_1.scaleBias.y = asuint(param_103);
        float param_104 = _2361.lightparms1[(uint(lightParms1Size_1) * light_id) + 3u].z;
        lightParms_1.scaleBias.z = asuint(param_104);
        float param_105 = _2361.lightparms1[(uint(lightParms1Size_1) * light_id) + 3u].w;
        lightParms_1.scaleBias.w = asuint(param_105);
        lightParms_1.boxMin = _2468.lightparms3[(uint(lightParms3Size_1) * light_id) + 0u];
        lightParms_1.boxMax = _2468.lightparms3[(uint(lightParms3Size_1) * light_id) + 1u];
        lightParms_1.areaPlane = _2468.lightparms3[(uint(lightParms3Size_1) * light_id) + 2u];
        float param_106 = _2400.lightparms2[(uint(lightParms2Size_1) * light_id) + 3u].x;
        lightParms_1.lightParms2 = asuint(param_106);
        float param_107 = _2400.lightparms2[(uint(lightParms2Size_1) * light_id) + 3u].y;
        lightParms_1.colorPacked = asuint(param_107);
        lightParms_1.specMultiplier = _2400.lightparms2[(uint(lightParms2Size_1) * light_id) + 3u].z;
        lightParms_1.shadowBleedReduce = _2400.lightparms2[(uint(lightParms2Size_1) * light_id) + 3u].w;
        float clip_min_2 = 0.0039215688593685626983642578125;
        vec3 projTC_2 = vec3((inputs.position.x * lightParms_1.projS.x) + ((inputs.position.y * lightParms_1.projS.y) + ((inputs.position.z * lightParms_1.projS.z) + lightParms_1.projS.w)), (inputs.position.x * lightParms_1.projT.x) + ((inputs.position.y * lightParms_1.projT.y) + ((inputs.position.z * lightParms_1.projT.z) + lightParms_1.projT.w)), (inputs.position.x * lightParms_1.projQ.x) + ((inputs.position.y * lightParms_1.projQ.y) + ((inputs.position.z * lightParms_1.projQ.z) + lightParms_1.projQ.w)));
        vec2 _3192 = projTC_2.xy / vec2(projTC_2.z);
        projTC_2 = vec3(_3192.x, _3192.y, projTC_2.z);
        projTC_2.z = (inputs.position.x * lightParms_1.falloffR.x) + ((inputs.position.y * lightParms_1.falloffR.y) + ((inputs.position.z * lightParms_1.falloffR.z) + lightParms_1.falloffR.w));
        uint light_parms_1 = lightParms_1.lightParms;
        uint light_flags = skipStaticModel;
        light_flags |= 64u;
        float param_108 = projTC_2.x;
        float param_109 = projTC_2.y;
        float param_110 = projTC_2.z;
        bool _3234 = fmin3(param_108, param_109, param_110) <= clip_min_2;
        bool _3251;
        if (!_3234)
        {
            float param_111 = projTC_2.x;
            float param_112 = projTC_2.y;
            float param_113 = projTC_2.z;
            _3251 = fmax3(param_111, param_112, param_113) >= (1.0 - clip_min_2);
        }
        else
        {
            _3251 = _3234;
        }
        bool _3259;
        if (!_3251)
        {
            _3259 = (light_parms_1 & light_flags) != 0u;
        }
        else
        {
            _3259 = _3251;
        }
        if (_3259)
        {
            continue;
        }
        vec3 light_position_1 = lightParms_1.pos;
        vec3 light_vector = light_position_1 - inputs.position;
        float param_114 = dot(inputs.normal, light_vector);
        float NdotL = saturate(param_114);
        uvec2 param_115 = lightParms_1.scaleBias.xy;
        vec4 falloffScaleBias = unpackR15G15B15A15(param_115);
        uvec2 param_116 = lightParms_1.scaleBias.zw;
        vec4 projFilterScaleBias = unpackR15G15B15A15(param_116);
        vec4 param_117 = vec4((projTC_2.xy * projFilterScaleBias.xy) + projFilterScaleBias.zw, 0.0, 0.0);
        float projFilter = tex2Dlod(samp_lightsatlasmap, param_117).x;
        vec4 param_118 = vec4((vec2(projTC_2.z, 0.5) * falloffScaleBias.xy) + falloffScaleBias.zw, 0.0, 0.0);
        float falloff = tex2Dlod(samp_lightsatlasmap, param_118).x;
        float light_attenuation_1 = (falloff * falloff) * (projFilter * projFilter);
        if (light_attenuation_1 <= (clip_min_2 / 256.0))
        {
            continue;
        }
        float shadow = 1.0;
        if ((light_parms_1 & 4u) != 0u)
        {
            float normal_bias_scale = 0.5;
            vec3 pos = inputs.position + (inputs.normal * normal_bias_scale);
            uint idx = 0u;
            if ((light_parms_1 & 3u) == 0u)
            {
                vec3 light_dir = pos - lightParms_1.posShadow.xyz;
                float param_119 = light_dir.x;
                float param_120 = light_dir.y;
                float param_121 = light_dir.z;
                idx = getCubeMapFaceID(param_119, param_120, param_121);
            }
            else
            {
                if ((light_parms_1 & 3u) == 2u)
                {
                    float border = 1.0;
                    int shadowParmSize = 5;
                    shadow_parms.shadowLightS = _3391.shadowsparmsubo[(uint(shadowParmSize) * (light_parms_1 >> uint(22))) + 0u];
                    shadow_parms.shadowLightT = _3391.shadowsparmsubo[(uint(shadowParmSize) * (light_parms_1 >> uint(22))) + 1u];
                    shadow_parms.shadowLightR = _3391.shadowsparmsubo[(uint(shadowParmSize) * (light_parms_1 >> uint(22))) + 2u];
                    shadow_parms.shadowLightQ = _3391.shadowsparmsubo[(uint(shadowParmSize) * (light_parms_1 >> uint(22))) + 3u];
                    shadow_parms.shadowAtlasScaleBias = _3391.shadowsparmsubo[(uint(shadowParmSize) * (light_parms_1 >> uint(22))) + 4u];
                    vec2 shadowTC = vec2(dot(pos, shadow_parms.shadowLightS.xyz) + shadow_parms.shadowLightS.w, dot(pos, shadow_parms.shadowLightT.xyz) + shadow_parms.shadowLightT.w);
                    shadowTC = abs((shadowTC * 2.0) - vec2(1.0));
                    bool _3463 = shadowTC.x >= border;
                    bool _3471;
                    if (!_3463)
                    {
                        _3471 = shadowTC.y >= border;
                    }
                    else
                    {
                        _3471 = _3463;
                    }
                    if (_3471)
                    {
                        idx = 1u;
                        int shadowParmSize_1 = 5;
                        shadow_parms_1.shadowLightS = _3391.shadowsparmsubo[(uint(shadowParmSize_1) * ((light_parms_1 >> uint(22)) + 1u)) + 0u];
                        shadow_parms_1.shadowLightT = _3391.shadowsparmsubo[(uint(shadowParmSize_1) * ((light_parms_1 >> uint(22)) + 1u)) + 1u];
                        shadow_parms_1.shadowLightR = _3391.shadowsparmsubo[(uint(shadowParmSize_1) * ((light_parms_1 >> uint(22)) + 1u)) + 2u];
                        shadow_parms_1.shadowLightQ = _3391.shadowsparmsubo[(uint(shadowParmSize_1) * ((light_parms_1 >> uint(22)) + 1u)) + 3u];
                        shadow_parms_1.shadowAtlasScaleBias = _3391.shadowsparmsubo[(uint(shadowParmSize_1) * ((light_parms_1 >> uint(22)) + 1u)) + 4u];
                        shadowTC = vec2(dot(pos, shadow_parms_1.shadowLightS.xyz) + shadow_parms_1.shadowLightS.w, dot(pos, shadow_parms_1.shadowLightT.xyz) + shadow_parms_1.shadowLightT.w);
                        shadowTC = abs((shadowTC * 2.0) - vec2(1.0));
                        bool _3551 = shadowTC.x >= border;
                        bool _3559;
                        if (!_3551)
                        {
                            _3559 = shadowTC.y >= border;
                        }
                        else
                        {
                            _3559 = _3551;
                        }
                        if (_3559)
                        {
                            idx = 2u;
                            int shadowParmSize_2 = 5;
                            shadow_parms_2.shadowLightS = _3391.shadowsparmsubo[(uint(shadowParmSize_2) * ((light_parms_1 >> uint(22)) + 2u)) + 0u];
                            shadow_parms_2.shadowLightT = _3391.shadowsparmsubo[(uint(shadowParmSize_2) * ((light_parms_1 >> uint(22)) + 2u)) + 1u];
                            shadow_parms_2.shadowLightR = _3391.shadowsparmsubo[(uint(shadowParmSize_2) * ((light_parms_1 >> uint(22)) + 2u)) + 2u];
                            shadow_parms_2.shadowLightQ = _3391.shadowsparmsubo[(uint(shadowParmSize_2) * ((light_parms_1 >> uint(22)) + 2u)) + 3u];
                            shadow_parms_2.shadowAtlasScaleBias = _3391.shadowsparmsubo[(uint(shadowParmSize_2) * ((light_parms_1 >> uint(22)) + 2u)) + 4u];
                            shadowTC = vec2(dot(pos, shadow_parms_2.shadowLightS.xyz) + shadow_parms_2.shadowLightS.w, dot(pos, shadow_parms_2.shadowLightT.xyz) + shadow_parms_2.shadowLightT.w);
                            shadowTC = abs((shadowTC * 2.0) - vec2(1.0));
                        }
                    }
                    float fraction = (1.0 - max(shadowTC.x, shadowTC.y)) * freqLow_fragmentUniforms.parallellightslicescale.w;
                    vec2 screenNoise = fract(gl_FragCoord.xy * 0.5);
                    screenNoise.x = fract((screenNoise.x * 0.5) + screenNoise.y);
                    if (screenNoise.x > fraction)
                    {
                        _3659 = 1;
                    }
                    else
                    {
                        _3659 = 0;
                    }
                    idx += uint(_3659);
                }
            }
            int shadowParmSize_3 = 5;
            shadow_parms_3.shadowLightS = _3391.shadowsparmsubo[(uint(shadowParmSize_3) * ((light_parms_1 >> uint(22)) + idx)) + 0u];
            shadow_parms_3.shadowLightT = _3391.shadowsparmsubo[(uint(shadowParmSize_3) * ((light_parms_1 >> uint(22)) + idx)) + 1u];
            shadow_parms_3.shadowLightR = _3391.shadowsparmsubo[(uint(shadowParmSize_3) * ((light_parms_1 >> uint(22)) + idx)) + 2u];
            shadow_parms_3.shadowLightQ = _3391.shadowsparmsubo[(uint(shadowParmSize_3) * ((light_parms_1 >> uint(22)) + idx)) + 3u];
            shadow_parms_3.shadowAtlasScaleBias = _3391.shadowsparmsubo[(uint(shadowParmSize_3) * ((light_parms_1 >> uint(22)) + idx)) + 4u];
            vec4 shadowTC_1 = vec4((pos.x * shadow_parms_3.shadowLightS.x) + ((pos.y * shadow_parms_3.shadowLightS.y) + ((pos.z * shadow_parms_3.shadowLightS.z) + shadow_parms_3.shadowLightS.w)), (pos.x * shadow_parms_3.shadowLightT.x) + ((pos.y * shadow_parms_3.shadowLightT.y) + ((pos.z * shadow_parms_3.shadowLightT.z) + shadow_parms_3.shadowLightT.w)), (pos.x * shadow_parms_3.shadowLightR.x) + ((pos.y * shadow_parms_3.shadowLightR.y) + ((pos.z * shadow_parms_3.shadowLightR.z) + shadow_parms_3.shadowLightR.w)), (pos.x * shadow_parms_3.shadowLightQ.x) + ((pos.y * shadow_parms_3.shadowLightQ.y) + ((pos.z * shadow_parms_3.shadowLightQ.z) + shadow_parms_3.shadowLightQ.w)));
            vec3 _3815 = shadowTC_1.xyz / vec3(shadowTC_1.w);
            shadowTC_1 = vec4(_3815.x, _3815.y, _3815.z, shadowTC_1.w);
            bool _3820 = shadowTC_1.x > 0.0;
            bool _3826;
            if (_3820)
            {
                _3826 = shadowTC_1.x < 1.0;
            }
            else
            {
                _3826 = _3820;
            }
            bool _3832;
            if (_3826)
            {
                _3832 = shadowTC_1.y > 0.0;
            }
            else
            {
                _3832 = _3826;
            }
            bool _3838;
            if (_3832)
            {
                _3838 = shadowTC_1.y < 1.0;
            }
            else
            {
                _3838 = _3832;
            }
            if (_3838)
            {
                vec2 _3850 = (shadowTC_1.xy * shadow_parms_3.shadowAtlasScaleBias.xy) + shadow_parms_3.shadowAtlasScaleBias.zw;
                shadowTC_1 = vec4(_3850.x, _3850.y, shadowTC_1.z, shadowTC_1.w);
                if (false)
                {
                    vec3 param_122 = shadowTC_1.xyz;
                    shadow = shadow2Ddepth(samp_shadowatlasdepthcomparemap, param_122);
                }
                else
                {
                    vec2 uv = shadowTC_1.xy * freqLow_fragmentUniforms.shadowatlasresolution.xy;
                    vec2 shadowMapSizeInv = freqLow_fragmentUniforms.shadowatlasresolution.zw;
                    vec2 base_uv = vec2(floor(uv.x + 0.5), floor(uv.y + 0.5));
                    float s = (uv.x + 0.5) - base_uv.x;
                    float t = (uv.y + 0.5) - base_uv.y;
                    base_uv -= vec2(0.5);
                    base_uv *= shadowMapSizeInv;
                    float uw0 = 4.0 - (3.0 * s);
                    float uw1 = 7.0;
                    float uw2 = 1.0 + (3.0 * s);
                    float u0 = ((3.0 - (2.0 * s)) / uw0) - 2.0;
                    float u1 = (3.0 + s) / uw1;
                    float u2 = (s / uw2) + 2.0;
                    float vw0 = 4.0 - (3.0 * t);
                    float v0 = ((3.0 - (2.0 * t)) / vw0) - 2.0;
                    vec3 param_123 = vec3(base_uv + (vec2(u0, v0) * shadowMapSizeInv), shadowTC_1.z);
                    float s0 = (uw0 * vw0) * shadow2Ddepth(samp_shadowatlasdepthcomparemap, param_123);
                    vec3 param_124 = vec3(base_uv + (vec2(u1, v0) * shadowMapSizeInv), shadowTC_1.z);
                    float s1 = (uw1 * vw0) * shadow2Ddepth(samp_shadowatlasdepthcomparemap, param_124);
                    vec3 param_125 = vec3(base_uv + (vec2(u2, v0) * shadowMapSizeInv), shadowTC_1.z);
                    float s2 = (uw2 * vw0) * shadow2Ddepth(samp_shadowatlasdepthcomparemap, param_125);
                    shadow = (s0 + s1) + s2;
                    float vw1 = 7.0;
                    float v1 = (3.0 + t) / vw1;
                    vec3 param_126 = vec3(base_uv + (vec2(u0, v1) * shadowMapSizeInv), shadowTC_1.z);
                    float s0_1 = (uw0 * vw1) * shadow2Ddepth(samp_shadowatlasdepthcomparemap, param_126);
                    vec3 param_127 = vec3(base_uv + (vec2(u1, v1) * shadowMapSizeInv), shadowTC_1.z);
                    float s1_1 = (uw1 * vw1) * shadow2Ddepth(samp_shadowatlasdepthcomparemap, param_127);
                    vec3 param_128 = vec3(base_uv + (vec2(u2, v1) * shadowMapSizeInv), shadowTC_1.z);
                    float s2_1 = (uw2 * vw1) * shadow2Ddepth(samp_shadowatlasdepthcomparemap, param_128);
                    shadow += ((s0_1 + s1_1) + s2_1);
                    float vw2 = 1.0 + (3.0 * t);
                    float v2 = (t / vw2) + 2.0;
                    vec3 param_129 = vec3(base_uv + (vec2(u0, v2) * shadowMapSizeInv), shadowTC_1.z);
                    float s0_2 = (uw0 * vw2) * shadow2Ddepth(samp_shadowatlasdepthcomparemap, param_129);
                    vec3 param_130 = vec3(base_uv + (vec2(u1, v2) * shadowMapSizeInv), shadowTC_1.z);
                    float s1_2 = (uw1 * vw2) * shadow2Ddepth(samp_shadowatlasdepthcomparemap, param_130);
                    vec3 param_131 = vec3(base_uv + (vec2(u2, v2) * shadowMapSizeInv), shadowTC_1.z);
                    float s2_2 = (uw2 * vw2) * shadow2Ddepth(samp_shadowatlasdepthcomparemap, param_131);
                    shadow += ((s0_2 + s1_2) + s2_2);
                    shadow /= 144.0;
                }
            }
            else
            {
                if ((light_parms_1 & 3u) == 2u)
                {
                    _4149 = 1.0;
                }
                else
                {
                    _4149 = 0.0;
                }
                shadow = _4149;
            }
            float shadow_fade = float((light_parms_1 >> uint(16)) & 63u) / 63.0;
            float param_132 = ((shadow * shadow_fade) + 1.0) - shadow_fade;
            shadow = saturate(param_132);
        }
        uint param_133 = lightParms_1.colorPacked;
        vec3 light_color_1 = (unpackRGBE(param_133) * shadow) * light_attenuation_1;
        float light_spec_multiplier_1 = lightParms_1.specMultiplier;
        if ((light_parms_1 & 48u) != 0u)
        {
            vec4 areaLightPlane = lightParms_1.areaPlane;
            vec4 areaLightPlaneU = lightParms_1.boxMin;
            vec4 areaLightPlaneV = lightParms_1.boxMax;
            float projToOrigin = dot(inputs.position, areaLightPlane.xyz) + areaLightPlane.w;
            if (projToOrigin < 0.0)
            {
                continue;
            }
            float falloffDistance = length(areaLightPlane.xyz);
            float param_134 = projToOrigin;
            float falloff_1 = saturate(param_134);
            light_color_1 *= (falloff_1 * falloff_1);
            projToOrigin /= falloffDistance;
            areaLightPlane /= vec4(falloffDistance);
            vec3 mirrorDir = reflect(-inputs.view, inputs.normal);
            if (dot(mirrorDir, areaLightPlane.xyz) > 0.0)
            {
                mirrorDir = reflect(mirrorDir, areaLightPlane.xyz);
            }
            float projToPlane = dot(mirrorDir, areaLightPlane.xyz);
            float projLength = projToOrigin / projToPlane;
            vec3 hitPos = inputs.position - (mirrorDir * projLength);
            vec3 hitDir = hitPos - light_position_1;
            float u = dot(hitDir, areaLightPlaneU.xyz);
            float v = dot(hitDir, areaLightPlaneV.xyz);
            float lenCircle = length(vec2(u, v));
            float lenRect = max(abs(u), abs(v));
            if ((light_parms_1 & 48u) == 32u)
            {
                _4294 = lenCircle;
            }
            else
            {
                _4294 = lenRect;
            }
            float len = _4294;
            if ((light_parms_1 & 48u) == 48u)
            {
                vec2 param_135 = vec2(u, v);
                vec2 _4313 = saturate(param_135);
                projTC_2 = vec3(_4313.x, _4313.y, projTC_2.z);
            }
            len = min(1.0, len) / len;
            u *= (len * areaLightPlaneU.w);
            v *= (len * areaLightPlaneV.w);
            hitDir = (areaLightPlaneU.xyz * u) + (areaLightPlaneV.xyz * v);
            light_position_1 += hitDir;
        }
        vec3 light_color_final_1 = light_color_1;
        vec3 param_136 = light_color_final_1;
        light_color_final_1 = mix(vec3(GetLuma(param_136)), light_color_final_1, freqLow_fragmentUniforms.pbrdebugparms.www);
        vec3 light_vector_1 = normalize(light_position_1 - inputs.position);
        float NdotL_1 = dot(inputs.normal, light_vector_1);
        float signNdotL = sign(NdotL_1);
        if (signNdotL >= 0.0)
        {
            _4369 = light_vector_1;
        }
        else
        {
            _4369 = reflect(light_vector_1, inputs.normal);
        }
        light_vector_1 = _4369;
        if (signNdotL >= 0.0)
        {
            _4382 = vec3(1.0);
        }
        else
        {
            _4382 = inputs.albedo;
        }
        vec3 specAlbedo = _4382;
        float param_137 = dot(inputs.normal, light_vector_1);
        float param_138 = NdotL_1;
        NdotL_1 = mix(saturate(param_137), saturate(param_138), inputs.alpha);
        uint param_139 = inputs.diffuse_lighting_packed;
        vec3 param_140 = (light_color_final_1 * NdotL_1) + unpackRGBE(param_139);
        inputs.diffuse_lighting_packed = packRGBE(param_140);
        uint param_141 = inputs.specular_packed;
        vec3 param_142 = inputs.normal;
        vec3 param_143 = inputs.view;
        vec3 param_144 = light_vector_1;
        vec3 param_145 = unpackR10G10B10(param_141);
        float param_146 = inputs.smoothness;
        vec3 spec = specBRDF(param_142, param_143, param_144, param_145, param_146);
        uint param_147 = inputs.specular_lighting_packed;
        vec3 param_148 = ((((light_color_final_1 * NdotL_1) * spec) * light_spec_multiplier_1) * specAlbedo) + unpackRGBE(param_147);
        inputs.specular_lighting_packed = packRGBE(param_148);
    }
    uint param_149 = inputs.diffuse_lighting_packed;
    uint param_150 = inputs.albedo_packed;
    inputs.diffuse_lighting = unpackRGBE(param_149) * unpackR10G10B10(param_150);
    uint param_151 = inputs.specular_lighting_packed;
    inputs.specular_lighting = unpackRGBE(param_151);
    inputs.output_lighting = inputs.diffuse_lighting + inputs.specular_lighting;
    float fogScale = inputs.alpha;
    float surf_ior = 0.89999997615814208984375;
    float refr_len = 0.4000000059604644775390625;
    vec3 refraction_vec = normalize(refract(inputs.normal, -inputs.view, surf_ior));
    vec3 param_152 = inputs.position + (refraction_vec * refr_len);
    mat4 param_153 = mat4(vec4(freqLow_fragmentUniforms.globalpostowindowx), vec4(freqLow_fragmentUniforms.globalpostowindowy), vec4(freqLow_fragmentUniforms.globalpostowindowz), vec4(freqLow_fragmentUniforms.globalpostowindoww));
    vec4 refr_tc = MatrixMul(param_152, param_153);

    // FIX
    vec2 _4531 = refr_tc.xy / vec2(refr_tc.w);
    _4531.x += vk3d_params.stereo.x * 0.49;


    refr_tc = vec4(_4531.x, _4531.y, refr_tc.z, refr_tc.w);
    float smoothness_1 = min(inputs.smoothness, 0.99989998340606689453125);
    float blend_ratio = fract(smoothness_1 * 4.0);
    vec3 refraction = vec3(0.0);
    if (smoothness_1 > 0.97500002384185791015625)
    {
        vec4 param_154 = vec4(refr_tc.xy, 0.0, 0.0);
        refraction = tex2Dlod(samp_scenemip0, param_154).xyz;
    }
    else
    {
        if (smoothness_1 > 0.75)
        {
            vec4 param_155 = vec4(refr_tc.xy, 0.0, 0.0);
            vec4 param_156 = vec4(refr_tc.xy, 0.0, 0.0);
            refraction = mix(tex2Dlod(samp_scenemip1, param_155).xyz, tex2Dlod(samp_scenemip0, param_156).xyz, vec3(blend_ratio));
        }
        else
        {
            if (smoothness_1 > 0.5)
            {
                vec4 param_157 = vec4(refr_tc.xy, 0.0, 0.0);
                vec4 param_158 = vec4(refr_tc.xy, 0.0, 0.0);
                refraction = mix(tex2Dlod(samp_scenemip2, param_157).xyz, tex2Dlod(samp_scenemip1, param_158).xyz, vec3(blend_ratio));
            }
            else
            {
                if (smoothness_1 > 0.25)
                {
                    vec4 param_159 = vec4(refr_tc.xy, 0.0, 0.0);
                    vec4 param_160 = vec4(refr_tc.xy, 0.0, 0.0);
                    refraction = mix(tex2Dlod(samp_scenemip3, param_159).xyz, tex2Dlod(samp_scenemip2, param_160).xyz, vec3(blend_ratio));
                }
                else
                {
                    vec4 param_161 = vec4(refr_tc.xy, 0.0, 0.0);
                    vec4 param_162 = vec4(refr_tc.xy, 0.0, 0.0);
                    refraction = mix(tex2Dlod(samp_scenemip4, param_161).xyz, tex2Dlod(samp_scenemip3, param_162).xyz, vec3(blend_ratio));
                }
            }
        }
    }
    inputs.output_lighting = mix(inputs.albedo * refraction, inputs.diffuse_lighting, vec3(inputs.alpha)) + inputs.specular_lighting;
    fogScale = 0.66600000858306884765625;
    float FLT_EPSILON = 9.9999997473787516355514526367188e-05;
    vec3 fogLightInscatterScaledColor = freqLow_fragmentUniforms.foglightinscattercolor.xyz * freqLow_fragmentUniforms.foglightinscatterintensity.x;
    vec3 heightFogColor = mix(fogLightInscatterScaledColor, freqLow_fragmentUniforms.foglightoppositecolor.xyz, vec3(vofi_TexCoord5.z));
    float param_163 = vofi_TexCoord5.y + vofi_TexCoord5.x;
    float fogAmount = saturate(param_163);
    float fogSafeAmount = max(fogAmount, FLT_EPSILON);
    float fogSelection = max(0.0, (fogSafeAmount - vofi_TexCoord5.x) / fogSafeAmount);
    vec3 fogColor = mix(freqLow_fragmentUniforms.fogcolor.xyz, heightFogColor, vec3(fogSelection));
    fogAmount = 1.0 - fogAmount;
    inputs.output_lighting = mix((fogColor * vec3(freqLow_fragmentUniforms.transparencylightmult.x)) * fogScale, inputs.output_lighting, vec3(fogAmount));
    out_FragColor0 = vec4(inputs.output_lighting, inputs.alpha);
    vec3 _4748 = out_FragColor0.xyz + freqLow_fragmentUniforms.highlightcolor.xyz;
    out_FragColor0 = vec4(_4748.x, _4748.y, _4748.z, out_FragColor0.w);
    vec3 _4754 = min(out_FragColor0.xyz, vec3(50.0));
    out_FragColor0 = vec4(_4754.x, _4754.y, _4754.z, out_FragColor0.w);
    out_FragColor0.w = 1.0;
}


