
in vec2 uv;
in vec4 color;
in float alpha;

in flat int tex_idx;
in flat int is_tex_coloured;

layout (location = 0) out vec4 C;

void main(){
	vec4 cc = color;
	C = vec4(cc.rgb,alpha);
	//	if(alpha < 0.99){
	//		cc.rgb = vec3(0.0);
	//	}
	if(tex_idx >= 0){
		C *= texture(textures[tex_idx], uv);
		if(is_tex_coloured == 1){
			//			C.rgb = color.rgb;
			C.rgb = color.rgb;
			C.a *= color.a;
		}
		//		if(C.x > 0.){
		//			C.a = 0.0;
		//		}
		//		C.xyz = 1.0;
	}
}
