mirror of
https://github.com/TheRedShip/RT_GPU.git
synced 2025-09-27 10:48:34 +02:00
+ | Trying noise but poorly for now
This commit is contained in:
@ -56,6 +56,7 @@ int main(int argc, char **argv)
|
||||
glBufferData(GL_SHADER_STORAGE_BUFFER, gpu_data.size() * sizeof(GPUObject), gpu_data.data(), GL_DYNAMIC_DRAW);
|
||||
glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 1, objectSSBO);
|
||||
|
||||
shader.set_int("u_frameCount", window.getFrameCount());
|
||||
shader.set_int("u_objectsNum", gpu_data.size());
|
||||
shader.set_vec2("u_resolution", glm::vec2(WIDTH, HEIGHT));
|
||||
shader.set_vec3("u_cameraPosition", scene.getCamera()->get_position());
|
||||
|
@ -118,6 +118,8 @@ void Window::display()
|
||||
lastTime = currentTime;
|
||||
_fps = 1.0f / delta;
|
||||
|
||||
_frameCount++;
|
||||
|
||||
glfwSwapBuffers(_window);
|
||||
}
|
||||
void Window::pollEvents()
|
||||
@ -140,4 +142,9 @@ GLFWwindow *Window::getWindow(void) const
|
||||
float Window::getFps(void) const
|
||||
{
|
||||
return (_fps);
|
||||
}
|
||||
|
||||
int Window::getFrameCount(void) const
|
||||
{
|
||||
return (_frameCount);
|
||||
}
|
Reference in New Issue
Block a user