~ | Fixing fog lighting acne and denoising not clearing

This commit is contained in:
TheRedShip
2025-03-09 16:01:03 +01:00
parent c19595392f
commit 0908afef0f
4 changed files with 12 additions and 7 deletions

View File

@ -100,7 +100,7 @@ int main(int argc, char **argv)
render_program.use();
drawScreenTriangle(VAO, textures[window.getOutputTexture()], render_program.getProgram());
window.imGuiRender(raytracing_program);
window.imGuiRender(raytracing_program, textures);
window.display();
window.pollEvents();

View File

@ -192,7 +192,7 @@ void Window::imGuiNewFrame()
ImGui::NewFrame();
}
void Window::imGuiRender(ShaderProgram &raytracing_program)
void Window::imGuiRender(ShaderProgram &raytracing_program, std::vector<GLuint> &textures)
{
bool has_changed = false;
@ -290,7 +290,12 @@ void Window::imGuiRender(ShaderProgram &raytracing_program)
if (ImGui::CollapsingHeader("Denoiser"))
{
ImGui::Checkbox("Enable##1", (bool *)(&_scene->getDenoise().enabled));
if (ImGui::Checkbox("Enable##1", (bool *)(&_scene->getDenoise().enabled)))
{
//clear denoising texture
glClearTexImage(textures[3], 0, GL_RGBA, GL_FLOAT, nullptr);
glClearTexImage(textures[4], 0, GL_RGBA, GL_FLOAT, nullptr);
}
ImGui::Separator();
if (ImGui::SliderInt("Pass", &_scene->getDenoise().pass, 0, 8))
_scene->getDenoise().pass = (_scene->getDenoise().pass / 2) * 2; // make sure it's even