I've got a strange problem most likely tied to my inexperience with using shaders. Basically only my first shader program seems to work. I'm doing error checking with glGetShaderInfoLog etc and the shaders seem to compile fine. I've also been trying to print out the active uniform variables and it will only ever work for the first shader that I create.

This all works perfectly if it is shader1 that is bound, but shader2 being bound results in nothing being drawn. I've tested both shaders and they work, but it's only ever the first program created that will result in the geometry rendering with that shader.

I can't see why this isn't working and I can post more code if needed. But basically my shader loading code is taken from a tutorial website and I can actually get something drawing with the first bound shader. The only thing I can think of is that vertex array objects might have an effect on the shaders used?

uniformId ends up equal to some absurdly large integer. The shader does contain the uniform mat4 MVP variable. If it was shader1 that was bound, this would work fine and uniformId wouldn't be some absurdly large number.

I could just swap the diffuse and passthrough shader around and i'd get the same problem, only the first created one will work.