This code should paints my cube with a different texture for each quadrant and one red quadrant. (using flat colors, each quadrant is different)
Instead I get a red quadrant and the rest is all the same texture.
If I change the order of the textures, the displayed texture will change but I will only see one texture at a time.
Where you define v_pos?
This shader should be compiled, but current hw doesn’t support branching. Compiler generate code which evaluate all branches and depending on IF expresion modulate results by 0.0 or 1.0, and accumulate all results to final.
most likely in your actual program (not the shaders)
youre not setting the various textures correctly
u need to use glUniform1iARB(…) or something similar