hachem.wtf
aboutsummaryrefslogtreecommitdiff
path: root/src/states/simulation_state.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/states/simulation_state.cpp')
-rw-r--r--src/states/simulation_state.cpp38
1 files changed, 36 insertions, 2 deletions
diff --git a/src/states/simulation_state.cpp b/src/states/simulation_state.cpp
index 9f1e0a7..540f236 100644
--- a/src/states/simulation_state.cpp
+++ b/src/states/simulation_state.cpp
@@ -1,6 +1,7 @@
#include "simulation_state.h"
#include "rendering/renderer.h"
#include "core/application.h"
+#include "core/hdri_manager.h"
#include "core/window.h"
#include "core/event.h"
#include "core/settings_manager.h"
@@ -10,6 +11,7 @@
#include <chrono>
#include <iomanip>
#include <sstream>
+#include <vector>
namespace Donut
{
@@ -165,9 +167,7 @@ namespace Donut
ImGui::Text("Objects: %zu", engine.get_objects().size());
if (ImGui::Button("Print Object Info"))
- {
engine.print_object_info();
- }
int compute_height = engine.get_compute_height();
if (ImGui::SliderInt("Compute Height", &compute_height, 64, 2048))
@@ -281,6 +281,40 @@ namespace Donut
ImGui::Spacing();
+ ImGui::TextColored(ImVec4(0.9f, 0.9f, 1.0f, 1.0f), "HDRI Environment");
+ ImGui::Separator();
+
+ static int selected_hdri = 0;
+ ImGui::PushID("SimulationHDRI");
+ auto& hdri_manager = HDRIManager::get();
+ const auto& available_hdri = hdri_manager.get_available_hdri();
+
+ static std::vector<std::string> hdri_option_names;
+ static std::vector<const char*> hdri_options;
+
+ if (hdri_option_names.size() != available_hdri.size())
+ {
+ hdri_option_names.clear();
+ hdri_options.clear();
+
+ for (const auto& path : available_hdri)
+ {
+ hdri_option_names.push_back(hdri_manager.get_hdri_name(path));
+ hdri_options.push_back(hdri_option_names.back().c_str());
+ }
+ }
+
+ if (ImGui::Combo("HDRI Environment", &selected_hdri, hdri_options.data(), static_cast<int>(hdri_options.size())))
+ {
+ auto& hdri_manager = HDRIManager::get();
+ hdri_manager.set_current_hdri(available_hdri[selected_hdri]);
+ engine.set_hdri_environment(hdri_manager.get_current_hdri());
+ }
+ ImGui::TextDisabled("HDRI provides background and lighting for the simulation");
+ ImGui::PopID();
+
+ ImGui::Spacing();
+
ImGui::TextColored(ImVec4(0.9f, 0.9f, 1.0f, 1.0f), "Camera");
ImGui::Separator();