#include <metal_stdlib>
#include <simd/simd.h>

using namespace metal;

struct Globals
{
    float4x4 uVP;
    packed_float3 uOffset;
    float uLayer;
    float uAlpha;
};

struct main0_out
{
    float4 FragColor [[color(0)]];
};

struct main0_in
{
    float2 vUV [[user(locn0)]];
};

fragment main0_out main0(main0_in in [[stage_in]], constant Globals& _23 [[buffer(0)]], texture2d_array<float> uAtlas [[texture(0)]], sampler uAtlasSmplr [[sampler(0)]])
{
    main0_out out = {};
    float3 _31 = float3(in.vUV, _23.uLayer);
    float4 texel = uAtlas.sample(uAtlasSmplr, _31.xy, uint(rint(_31.z)));
    if (texel.w < 0.039999999105930328369140625)
    {
        discard_fragment();
    }
    out.FragColor = float4(texel.xyz * float3(0.920000016689300537109375, 1.059999942779541015625, 1.019999980926513671875), texel.w * _23.uAlpha);
    return out;
}

