+ | Define system + denoising back

This commit is contained in:
TheRedShip
2025-02-13 23:18:04 +01:00
parent 9b8da6ebd8
commit 4ddacdaadd
14 changed files with 376 additions and 319 deletions

View File

@ -184,7 +184,7 @@ void Window::imGuiNewFrame()
ImGui::NewFrame();
}
void Window::imGuiRender()
void Window::imGuiRender(ShaderProgram &raytracing_program)
{
bool has_changed = false;
@ -253,7 +253,12 @@ void Window::imGuiRender()
if (ImGui::CollapsingHeader("Fog"))
{
has_changed |= ImGui::Checkbox("Enable", (bool *)(&_scene->getVolume().enabled));
if (ImGui::Checkbox("Enable", (bool *)(&_scene->getVolume().enabled)))
{
raytracing_program.set_define("FOG", std::to_string(_scene->getVolume().enabled));
raytracing_program.reloadShaders();
has_changed = true;
}
ImGui::Separator();
if (ImGui::SliderFloat("Absorption", &_scene->getVolume().sigma_a.x, 0., 0.1))
@ -292,7 +297,12 @@ void Window::imGuiRender()
{
ImGui::PushID(0);
has_changed |= ImGui::Checkbox("Enable", (bool *)(&_scene->getDebug().enabled));
if (ImGui::Checkbox("Enable", (bool *)(&_scene->getDebug().enabled)))
{
raytracing_program.set_define("DEBUG", std::to_string(_scene->getDebug().enabled));
raytracing_program.reloadShaders();
has_changed = true;
}
ImGui::Separator();
has_changed |= ImGui::SliderInt("Debug mode", &_scene->getDebug().mode, 0, 2);
has_changed |= ImGui::SliderInt("Box treshold", &_scene->getDebug().box_treshold, 1, 2000);