+ | Debug view

This commit is contained in:
TheRedShip
2025-01-18 16:00:24 +01:00
parent 5d3de6158b
commit 85bab977df
9 changed files with 3010 additions and 36 deletions

View File

@ -17,10 +17,15 @@ Scene::Scene()
_camera = new Camera(glm::vec3(0.0f, 0.0f, 0.0f), glm::vec3(0.0f, 1.0f, 0.0f), -90.0f, 0.0f);
_gpu_volume.enabled = 0;
_gpu_volume.sigma_a = glm::vec3(0.0001f);
_gpu_volume.sigma_a = glm::vec3(0.0000f);
_gpu_volume.sigma_s = glm::vec3(0.0800f);
_gpu_volume.sigma_t = _gpu_volume.sigma_a + _gpu_volume.sigma_s;
_gpu_volume.g = 0.9f;
_gpu_volume.g = 1.0f;
_gpu_debug.enabled = 0;
_gpu_debug.mode = 0;
_gpu_debug.triangle_treshold = 1;
_gpu_debug.box_treshold = 1;
}
Scene::~Scene()
@ -193,6 +198,11 @@ GPUVolume &Scene::getVolume()
return (_gpu_volume);
}
GPUDebug &Scene::getDebug()
{
return (_gpu_debug);
}
std::vector<GPUBvh> &Scene::getBVH()
{
return (_gpu_bvh);

View File

@ -248,6 +248,15 @@ void Window::imGuiRender()
ImGui::End();
ImGui::Begin("Debug");
has_changed |= ImGui::Checkbox("Enable", (bool *)(&_scene->getDebug().enabled));
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);
has_changed |= ImGui::SliderInt("Triangle treshold", &_scene->getDebug().triangle_treshold, 1, 2000);
ImGui::End();
ImGui::Render();
ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData());