#version 430

flat in uint varaArrayIndex;
flat in vec4 varaColor;

uniform sampler2D flareBillboard0;
uniform sampler2D flareBillboard1;
uniform sampler2D flareBillboard2;
uniform sampler2D flareBillboard3;
//uniform sampler2D flareBillboard4;
//uniform vec4 flareColor;

out vec4 vFragColor;

void main(void) {
	vec4 textureColor;
	switch(varaArrayIndex) {
		case 0:
            textureColor = texture(flareBillboard0, gl_PointCoord)*varaColor;
		break;
		case 1:
            textureColor = texture(flareBillboard1, gl_PointCoord)*varaColor;
		break;
		case 2:
            textureColor = texture(flareBillboard2, gl_PointCoord)*varaColor;
		break;
		case 3:
            textureColor = texture(flareBillboard3, gl_PointCoord)*varaColor;
		break;
		//case 4:
        //    textureColor = texture(flareBillboard4, gl_PointCoord)*varaColor;
		//break;
		default:
            textureColor = vec4(0,0,0,1);
	}
	vFragColor = textureColor;
}