hi people :). i have set up a system for passing a model through multiple lights. everything works fine until i try to multiply the vertices passed to the vertex shader when finally rendering the image by a 4x4 perspective matrix. i get nothing on the window. if i remove the perspective matrix i get a result that looks fairly good, but obviously this is not what i want. i have tried setting the perspective matrix as a uniform and hard coding it in and i get nothing in both cases. i am wondering if any of you could help me fix this.
here is my vertex shader:
const char *vshaderdraw =
"#version 430 core
"
"uniform mat4 perspective;
"
"uniform mat3 uvn;
"
"layout (location = 4) in vec3 verticestfin;
"
"layout (location = 6) in vec4 colorstfin;
"
"out vec4 color;
"
"mat4 correctaxes = mat4(1, 0, 0, 0,
"
"0, 0, 1, 0,
"
"0, 1, 0, 0,
"
"0, 0, 0, 1);
"
"void main()
"
"{
"
"gl_Position = perspective * correctaxes * vec4(verticestfin, 1);
"
"color = colorstfin;
"
"}
";
here is my rendering code:
glGenVertexArrays(1, &vao);
glBindVertexArray(vao);
glUseProgram(progdraw);
GLuint perspectiveloc = glGetUniformLocation(progdraw, "perspective");
GLuint uvnloc = glGetUniformLocation(progdraw, "uvn");
glUniformMatrix4fv(perspectiveloc, 1, GL_FALSE, cam->ProjectionMat.marray);
glUniformMatrix3fv(uvnloc, 1, GL_FALSE, cam->UVNMat.marray);
glBindBuffer(GL_ARRAY_BUFFER, vertexbufferout);
glVertexAttribPointer(4, 3, GL_FLOAT, GL_FALSE, 0, 0);
glEnableVertexAttribArray(4);
glBindBuffer(GL_ARRAY_BUFFER, colorbufferout);
glVertexAttribPointer(6, 4, GL_FLOAT, GL_FALSE, 0, 0);
glEnableVertexAttribArray(6);
glDrawArrays(GL_TRIANGLES, 0, mesh->MeshIndexListSize * 3);
glBindVertexArray(0);
glDeleteVertexArrays(1, &vao);
thanks alot