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