
// Vk3DVision (http://3dsurroundgaming.com/) - Original Shader
#version 450
#extension GL_ARB_shader_draw_parameters : require

invariant gl_Position;

struct SLIDING_SPLAT_CONSTANT_BUFFER
{
    uint _uSplatCount;
};

layout(set = 0, binding = 52, std140) uniform dyn_CONSTANT_BUFFER_BLOCK_0
{
    SLIDING_SPLAT_CONSTANT_BUFFER g_cbSplat;
} _28;

layout(set = 0, binding = 24, std430) readonly buffer dyn_fSplatBuffer_Layout
{
    float fSplatBuffer[];
} _39;

layout(location = 0) in vec3 in_vfCsPositionAndTailFactor;
layout(location = 8) out vec2 out_vfUv0;
layout(location = 8) in vec2 in_vfUv0;
layout(location = 9) out float out_fLifeFactor;

void main()
{
    int _23 = gl_InstanceIndex + gl_DrawIDARB;
    uint _24 = uint(_23);
    uint _33 = _24 % _28.g_cbSplat._uSplatCount;
    uint _55 = _33 + _28.g_cbSplat._uSplatCount;
    uint _63 = 2u * _28.g_cbSplat._uSplatCount;
    uint _64 = _33 + _63;
    uint _72 = 3u * _28.g_cbSplat._uSplatCount;
    uint _73 = _33 + _72;
    uint _81 = 4u * _28.g_cbSplat._uSplatCount;
    uint _82 = _33 + _81;
    uint _90 = 5u * _28.g_cbSplat._uSplatCount;
    uint _91 = _33 + _90;
    vec2 _99 = vec2(_39.fSplatBuffer[_33], _39.fSplatBuffer[_55]);
    float _103 = _39.fSplatBuffer[_82] - _39.fSplatBuffer[_91];
    uint _117 = _24 / _28.g_cbSplat._uSplatCount;
    uint _120 = _117 % 3u;
    uint _123 = _117 / 3u;
    float _129 = float(_120);
    float _131 = float(_123);
    vec2 _132 = vec2(_129, _131);
    vec2 _133 = _132 * 2.0;
    vec2 _134 = vec2(-2.0) + _133;
    vec2 _141 = in_vfCsPositionAndTailFactor.xy * _39.fSplatBuffer[_73];
    vec2 _143 = _141 * 0.5;
    float _146 = -_103;
    float _148 = _146 * _39.fSplatBuffer[_64];
    vec2 _149 = vec2(0.0, _148);
    vec2 _153 = _149 * in_vfCsPositionAndTailFactor.z;
    vec2 _154 = _143 + _153;
    vec2 _156 = _154 + _99;
    vec2 _158 = _156 + _134;
    out_vfUv0 = in_vfUv0;
    out_fLifeFactor = 1.0 - (_39.fSplatBuffer[_91] / _39.fSplatBuffer[_82]);
    float _173 = _158.x;
    float _174 = _158.y;
    vec4 _175 = vec4(_173, _174, 0.0, 1.0);
    gl_Position = _175;
}

