I have this weird problem, where when I give my shader an identity matrix, and multiply it by my vertex position, it doesn’t give me the same result as using just my vertex position.
My shader code:
#version 330
uniform mat4 viewMatrix;
in vec4 in_Position;
in vec2 in_TextureUV;
in vec4 in_Color;
out vec4 pass_Color;
out vec2 pass_TextureUV;
void main(void) {
gl_Position = viewMatrix * in_Position; //View matrix is an identity matrix
pass_Color = in_Color;
pass_TextureUV = in_TextureUV;
}
When I print out my ‘viewMatrix’ values, it gives me this:
View Matrix :
1.0 0.0 0.0 0.0
0.0 1.0 0.0 0.0
0.0 0.0 1.0 0.0
0.0 0.0 0.0 1.0
[icode]gl_Position = in_Position;[/icode]
[icode]gl_Position = viewMatrix * in_Position;[/icode]