
varying float color_amount;

#vertexshader

const int BATCH_SIZE = 32;
uniform vec4 center_and_radius[BATCH_SIZE];
uniform vec3 upvectors[BATCH_SIZE];
uniform vec3 rightvectors[BATCH_SIZE];
attribute vec4 vertex_info;

void main()
{
	int index = int(vertex_info.x);
	vec4 info = center_and_radius[index];
	vec3 up = upvectors[index];
	vec3 right = rightvectors[index];
	//vec4 pos = vec4(gl_Vertex.xyz*info.w + info.xyz, 1.0);
	vec3 pos = info.xyz + (right*gl_Vertex.x+up*gl_Vertex.y)*info.w;
	color_amount = 1.0; //pow(info.w, 2.0);
	gl_Position = gl_ModelViewProjectionMatrix * vec4(pos, 1.0);
}

#fragmentshader

void main()
{
	gl_FragColor = vec4(color_amount,color_amount,color_amount,1);
}
