#version 330 core in vec3 color; in vec2 TexCoord; flat in int TexIndex; out vec4 FragColor; uniform sampler2D textures[5]; // update based on number of textures in game void main() { vec4 texColor; texColor = texture(textures[TexIndex], TexCoord); FragColor = texColor * vec4(color, 1.0); }