Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualtempvar

Posted 27 November 2012 - 10:18 AM

Just tried that, didn't change anything but I should keep them as GLuint because that's what they should have been anyway.

I stepped through setting up uniforms for the second created shader. It had a program ID of 6, which is correct (first shader has 1,2 for vert and frag and 3 for programID and same with the second).

I then call

GLuint uniformId = glGetUniformLocation(shader2, "MVP");
glUniformMatrix4fv(uniformId, 1, GL_FALSE, &mat[0][0]);

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.

#1tempvar

Posted 27 November 2012 - 10:17 AM

Just tried that, didn't change anything but I should keep them as GLuint because that's what they should have been anyway.

I stepped through setting up uniforms for the second created shader. It had a program ID of 6, which is correct (first shader has 1,2 for vert and frag and 3 for programID and same with the second).

I then call

GLuint uniformId = glGetUniformLocation(shader2, "MVP");
glUniformMatrix4fv(uniformId, 1, GL_FALSE, &mat[0][0]);

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.

PARTNERS