#version 150 in vec2 vertTexCoord; in vec4 vertColor; in float vertTextureIndex; uniform sampler2D textures[8]; out vec4 fragColor; void main() { fragColor = vec4(0, 0, 0, 0); fragColor += texture(textures[0], vertTexCoord) * int(vertTextureIndex == 0); fragColor += texture(textures[1], vertTexCoord) * int(vertTextureIndex == 1); fragColor += texture(textures[2], vertTexCoord) * int(vertTextureIndex == 2); fragColor += texture(textures[3], vertTexCoord) * int(vertTextureIndex == 3); fragColor += texture(textures[4], vertTexCoord) * int(vertTextureIndex == 4); fragColor += texture(textures[5], vertTexCoord) * int(vertTextureIndex == 5); fragColor += texture(textures[6], vertTexCoord) * int(vertTextureIndex == 6); fragColor += texture(textures[7], vertTexCoord) * int(vertTextureIndex == 7); fragColor *= vertColor; }