#version 330

uniform mat4 perspective_matrix;
uniform mat4 modelview_matrix;

uniform sampler2D readTexture;

in vec2 vertex;

out float alpha;

void main(void)
{
	vec4 particle = vec4(texture(readTexture, vertex).xyz, 1.0);

	alpha = clamp(1.0 - texture(readTexture, vertex).w, 0.0, 1.0);

	gl_PointSize = 32.0;
	
	gl_Position = perspective_matrix*modelview_matrix*particle;
}
