I have the following shaders: My fragment shader:
#version 110
uniform mat4 modelMatrix;
uniform mat4 viewMatrix;
uniform mat4 projectionMatrix;
void main() {
gl_FragColor = vec4(1, 0, 0, 1);
}
And my vertex shader:
#version 110
uniform mat4 modelMatrix;
uniform mat4 viewMatrix;
uniform mat4 projectionMatrix;
attribute vec3 vertex;
void main() {
vec4 world = modelMatrix * vec4(vertex, 1);
vec4 camera = world * viewMatrix;
gl_Position = projectionMatrix * world;
}
They both compile and link just fine. When I print out my active uniforms I get
projectionMatrix
modelMatrix
but no viewMatrix. When I try and get the Uniform with glGetUniformLocation, I can get projectionMatrix, modelMatrix, and my vertex attribute just fine, so why is viewMatrix inactive?