+ | Trying noise but poorly for now

This commit is contained in:
TheRedShip
2024-12-27 12:05:22 +01:00
parent ebb8ca36bd
commit dfc37301e4
6 changed files with 97 additions and 75 deletions

View File

@ -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());

View File

@ -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);
}