mirror of
https://github.com/TheRedShip/RT_GPU.git
synced 2025-09-27 18:48:36 +02:00
~ | Weird random, needs to be upgrade
This commit is contained in:
@ -44,6 +44,7 @@ int main(int argc, char **argv)
|
||||
|
||||
shader.set_int("u_frameCount", window.getFrameCount());
|
||||
shader.set_int("u_objectsNum", gpu_data.size());
|
||||
shader.set_float("u_time", (float)(glfwGetTime()));
|
||||
shader.set_vec2("u_resolution", glm::vec2(WIDTH, HEIGHT));
|
||||
shader.set_vec3("u_cameraPosition", scene.getCamera()->get_position());
|
||||
shader.set_mat4("u_viewMatrix", scene.getCamera()->get_view_matrix());
|
||||
|
@ -167,6 +167,10 @@ void Shader::set_int(const std::string &name, int value) const
|
||||
{
|
||||
glUniform1i(glGetUniformLocation(_program_compute, name.c_str()), value);
|
||||
}
|
||||
void Shader::set_float(const std::string &name, float value) const
|
||||
{
|
||||
glUniform1f(glGetUniformLocation(_program_compute, name.c_str()), value);
|
||||
}
|
||||
void Shader::set_vec2(const std::string &name, const glm::vec2 &value) const
|
||||
{
|
||||
glUniform2fv(glGetUniformLocation(_program_compute, name.c_str()), 1, glm::value_ptr(value));
|
||||
|
@ -90,7 +90,7 @@ void Window::mouseMoveCallback(GLFWwindow* window, double xpos, double ypos)
|
||||
{
|
||||
win->_scene->getCamera()->process_mouse(xoffset, yoffset, true);
|
||||
|
||||
// scene.frameCount = 0;
|
||||
win->_frameCount = 0;
|
||||
}
|
||||
|
||||
lastX = xpos;
|
||||
|
Reference in New Issue
Block a user