diff --git a/shaders/compute.glsl b/shaders/compute.glsl index f99683d..22ddf59 100644 --- a/shaders/compute.glsl +++ b/shaders/compute.glsl @@ -205,7 +205,10 @@ void main() return; if (u_pixelisation != 1 && (uint(pixel_coords.x) % u_pixelisation != 0 || uint(pixel_coords.y) % u_pixelisation != 0)) + { + imageStore(accumulation_image, pixel_coords, vec4(0.0)); return; + } uint rng_state = uint(u_resolution.x) * uint(pixel_coords.y) + uint(pixel_coords.x); rng_state = rng_state + u_frameCount * 719393; diff --git a/srcs/class/Window.cpp b/srcs/class/Window.cpp index e491026..ea85dde 100644 --- a/srcs/class/Window.cpp +++ b/srcs/class/Window.cpp @@ -99,9 +99,9 @@ void Window::mouseButtonCallback(GLFWwindow* window, int button, int action, int Window* win = static_cast(glfwGetWindowUserPointer(window)); (void) win; (void) button; (void) mods; - if (action == GLFW_PRESS) + if (action == GLFW_RELEASE) { - + win->_frameCount = 0; } } void Window::keyCallback(GLFWwindow *window, int key, int scancode, int action, int mods) @@ -120,6 +120,8 @@ void Window::keyCallback(GLFWwindow *window, int key, int scancode, int action, << dov.x << " " << dov.y << " " << "\t" << std::endl; } + if (action == GLFW_RELEASE) + win->_frameCount = 0; } void Window::display()