#version 330 core
layout(location = 0) in vec3 aPos;
layout(location = 1) in vec3 aOffset;
layout(location = 2) in float maxLife;
layout(location = 3) in float currentLife;

uniform mat4 model;
uniform mat4 viewProjection;
uniform float sizeStart;
uniform float sizeEnd;

out float modifier;

void main()
{
    modifier =  currentLife/maxLife;
    float sizeMultiplier = sizeStart * (1.0 - modifier) + (sizeEnd * modifier);
    vec3 finalPosition = aPos * sizeMultiplier + aOffset;
    gl_Position = viewProjection * model * vec4(finalPosition, 1.0);
}