Fix crashes.

This commit is contained in:
hal8174 2024-05-29 12:45:30 +02:00
parent af6e569f40
commit 0b8021c139
2 changed files with 165 additions and 1 deletions

View file

@ -1,5 +1,6 @@
#pragma once
#include "helper.hpp"
#include "imgui.h"
class Application2 : public Application {
@ -14,10 +15,18 @@ private:
void drawGUI() override {
ImGui::Checkbox("Bounding Box", &boundingBox);
ImGui::InputInt("Ray depth", &ray_depth);
if (ray_depth < 1) {
ray_depth = 1;
}
const char* items[] = {"Original", "Homogeneous"};
ImGui::Combo("Version", &selected, items, 2);
ImGui::SliderFloat("mu_a", &mu_a, 0.0, 1.0);
ImGui::SliderFloat("mu_s", &mu_s, 0.0, 1.0);
ImGui::SliderFloat("scattering parameter", &scattering_parameter, 0.0, 1.0);
const char* scenes[] = {"Gnome", "Horse", "Heterogenous"};
int oldscene = scene;
ImGui::Combo("Scenes", &scene, scenes, 3);
@ -43,7 +52,11 @@ private:
void heterogenousScene();
int ray_depth = 15;
bool boundingBox = true;
int selected = 0;
int scene = 0;
float mu_a = 0.0;
float mu_s = 0.0;
float scattering_parameter = 0.4;
};