varying vec2 TexCoord;
varying float alpha;

attribute float Life, MaxLife, AlphaMult, LifeClamp, Frame;
attribute vec3 Vstart, HalfAcc;

void main()
{		
	if (Life > 0.0)
	{
		vec4 vert = gl_Vertex;
		float l = min(Life, LifeClamp);
		vert.xyz += l * (Vstart + HalfAcc * l); // vrh šikmý
		vert.z = max(vert.z, -0.5);
		vert.w = 1.0;
		
		alpha = (1.0-(Life/MaxLife)) * AlphaMult;

		gl_Position = gl_ModelViewProjectionMatrix * vert;
		
		TexCoord = gl_MultiTexCoord0.xy;
		TexCoord.x += Frame;
	}
	else
	{
		gl_Position = vec4(-2.0);
	}
}
