I was looking at a code example for a phong lighting shader. It used the predefined variables of gl_Normal, gl_Vertex, and gl_ModelViewProjectionMatrix in the vertex shader. My current vertex shader looks like this.
#version 150 core
in vec4 in_Position;
in vec4 in_Color;
in vec2 in_TextureCoord;
uniform mat4 projection;
uniform mat4 view;
uniform mat4 model;
out vec4 pass_Color;
out vec2 pass_TextureCoord;
void main(void) {
gl_Position = projection * view * model * in_Position;
pass_Color = in_Color;
pass_TextureCoord = in_TextureCoord;
}
I was wondering is it possible to set the value of the predefined vars. For example, I would set the value of gl_ModelViewProjectionMatrix to my projection uniform. I'm asking this because whenever I try to use the predefined vars, the shader doesn't work.