mirror of
https://github.com/TheRedShip/RT_GPU.git
synced 2025-09-27 18:48:36 +02:00
+ | Basic camera but glitched for now
This commit is contained in:
@ -34,7 +34,14 @@ int main(void)
|
||||
{
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
shader.setVec2f("u_resolution", glm::vec2(WIDTH, HEIGHT));
|
||||
glm::mat4 view = window.get_camera()->get_view_matrix();
|
||||
glm::mat4 projection = glm::perspective(glm::radians(45.0f), (float)WIDTH / HEIGHT, 0.1f, 100.0f);
|
||||
|
||||
shader.set_vec2("u_resolution", glm::vec2(WIDTH, HEIGHT));
|
||||
shader.set_vec3("u_cameraPosition", window.get_camera()->get_position());
|
||||
shader.set_mat4("u_viewMatrix", view);
|
||||
shader.set_mat4("u_projectionMatrix", projection);
|
||||
|
||||
glUseProgram(shader.getProgram());
|
||||
shader.drawTriangles(size);
|
||||
|
||||
|
Reference in New Issue
Block a user