Original Post
Hey I'm in the middle of trying out some glsl shaders. Now I got multiple shaders that each work when they are the only one being tested. The problem comes when I try to use more of them in the same frame. Say I want to render mesh-A with shader-A, and mesh-B with shader-B and so on. Right now I just load all the shaders in the start. Keep the program-ID. ( from glCreateProgram() ). And when I want to use it I just do glUseProgram( programId ); Now this don't work when I try multiple shaders, like this:
glUseProgram( shader-A );
modelA->Draw();
glUseProgram( shader-B );
modelB->Draw();
glUseProgram( shader-C );
modelC->Draw();
So the question is, what is needed to perform this? Do I need to link each shader before its used everytime?(note: tried it and it dint work for me.. ) Or should I call glUseProgram(0) after each finished model? (note: this dont work either). cheers, Sondre