summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2018-02-04 21:57:24 -0500
committerKelly Rauchenberger <fefferburbia@gmail.com>2018-02-04 21:57:24 -0500
commit1e8de01d3704c584e43e1b84947487c2aaddb7d7 (patch)
tree44daec2c6cadacd2a2f66bcbf05e2dabbab83a54 /src
parent51971f4d3b08e9e0835e3e11d50e8c27672a25aa (diff)
downloadtherapy-1e8de01d3704c584e43e1b84947487c2aaddb7d7.tar.gz
therapy-1e8de01d3704c584e43e1b84947487c2aaddb7d7.tar.bz2
therapy-1e8de01d3704c584e43e1b84947487c2aaddb7d7.zip
Made some fixes to rendering I guess
This is pretty old so I'm not exactly sure what it does but without it,
the monitor gets rendered upside down.
Diffstat (limited to 'src')
-rw-r--r--src/renderer.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/renderer.cpp b/src/renderer.cpp index 99d5389..ffe9d47 100644 --- a/src/renderer.cpp +++ b/src/renderer.cpp
@@ -363,7 +363,7 @@ GLFWwindow* initRenderer()
363 std::vector<glm::vec3> mesh_vertices; 363 std::vector<glm::vec3> mesh_vertices;
364 std::vector<glm::vec2> mesh_uvs; 364 std::vector<glm::vec2> mesh_uvs;
365 std::vector<glm::vec3> mesh_normals; 365 std::vector<glm::vec3> mesh_normals;
366 loadMesh("res/monitor-fef.obj", mesh_vertices, mesh_uvs, mesh_normals); 366 loadMesh("res/monitor-old.obj", mesh_vertices, mesh_uvs, mesh_normals);
367 367
368 mesh_numvertices = mesh_vertices.size(); 368 mesh_numvertices = mesh_vertices.size();
369 369
@@ -795,8 +795,8 @@ void Texture::renderScreen() const
795 glUniform1i(glGetUniformLocation(finalShader, "scanlinestex"), 1); 795 glUniform1i(glGetUniformLocation(finalShader, "scanlinestex"), 1);
796 796
797 // Initialize the MVP matrices 797 // Initialize the MVP matrices
798 glm::mat4 p_matrix = glm::perspective(42.5f, (float) buffer_width / (float) buffer_height, 0.1f, 100.0f); 798 glm::mat4 p_matrix = glm::perspective(glm::radians(25.0f), (float) buffer_width / (float) buffer_height, 0.1f, 100.0f);
799 glm::mat4 v_matrix = glm::lookAt(glm::vec3(2,0,0), glm::vec3(0,0,0), glm::vec3(0,1,0)); 799 glm::mat4 v_matrix = glm::lookAt(glm::vec3(3.75,0,0), glm::vec3(0,0,0), glm::vec3(0,1,0));
800 glm::mat4 m_matrix = glm::mat4(1.0); 800 glm::mat4 m_matrix = glm::mat4(1.0);
801 glm::mat4 mvp_matrix = p_matrix * v_matrix * m_matrix; 801 glm::mat4 mvp_matrix = p_matrix * v_matrix * m_matrix;
802 802
@@ -804,6 +804,7 @@ void Texture::renderScreen() const
804 glUniformMatrix4fv(glGetUniformLocation(finalShader, "worldMat"), 1, GL_FALSE, &m_matrix[0][0]); 804 glUniformMatrix4fv(glGetUniformLocation(finalShader, "worldMat"), 1, GL_FALSE, &m_matrix[0][0]);
805 glUniform2f(glGetUniformLocation(finalShader, "resolution"), buffer_width, buffer_height); 805 glUniform2f(glGetUniformLocation(finalShader, "resolution"), buffer_width, buffer_height);
806 glUniform1f(glGetUniformLocation(finalShader, "iGlobalTime"), glfwGetTime()); 806 glUniform1f(glGetUniformLocation(finalShader, "iGlobalTime"), glfwGetTime());
807 glUniform3f(glGetUniformLocation(finalShader, "frameColor"), 0.76f, 0.78f, 0.81f);
807 808
808 glEnableVertexAttribArray(0); 809 glEnableVertexAttribArray(0);
809 glBindBuffer(GL_ARRAY_BUFFER, mesh_vertexbuffer); 810 glBindBuffer(GL_ARRAY_BUFFER, mesh_vertexbuffer);