#version 450 core
layout (location = 0) in vec2 f_tex_coords;
layout (location = 1) in vec4 f_vert_color;
layout (location = 2) flat in int f_tex_index;

out vec4 color;
layout (binding = 0) uniform sampler2D textures[32];

void main()
{    
    //color = f_vert_color * texture(textures[int(f_tex_index)], f_tex_coords);
    //color = vec4(float(f_tex_index) * 0.01, 0.0 , 0.0, 1.0);
   color = f_vert_color * texture(textures[f_tex_index], f_tex_coords);
//    switch(f_tex_index)
// 	{
// 		case  0: color = vec4(1.0, 0.0, 0.0, 1.0); break; //texture(textures[ 0], f_tex_coords); break;
// 		case  1: color = vec4(0.0, 1.0, 0.0, 1.0); break; //texture(textures[ 1], f_tex_coords); break;
// 		case  2: color = vec4(0.0, 0.0, 1.0, 1.0); break; //texture(textures[ 1], f_tex_coords); break;
//         default: color = vec4(1.0, 1.0, 1.0, 1.0); break;
//     }

    // if (f_tex_index > 1000)
    // {
    //     color = vec4(1.0, 0.0, 0.0, 1.0);
    // }
    // else
    // {
    //     color = vec4(0.0, 0.0, 1.0, 1.0);
    // }
} 