Add state tracking for volumetric rendering.
This commit is contained in:
parent
c1e15155ad
commit
f702e82b4f
2 changed files with 197 additions and 55 deletions
|
|
@ -1,6 +1,7 @@
|
|||
#pragma once
|
||||
#include "helper.hpp"
|
||||
#include "imgui.h"
|
||||
#include "math/vec3fa.h"
|
||||
|
||||
|
||||
class Application2 : public Application {
|
||||
|
|
@ -15,22 +16,28 @@ private:
|
|||
|
||||
void drawGUI() override {
|
||||
ImGui::Checkbox("Bounding Box", &boundingBox);
|
||||
ImGui::InputInt("Ray depth", &ray_depth);
|
||||
if (ImGui::InputInt("Ray depth", &ray_depth))
|
||||
clear();
|
||||
|
||||
if (ray_depth < 1) {
|
||||
ray_depth = 1;
|
||||
}
|
||||
|
||||
const char* items[] = {"Original", "Homogeneous"};
|
||||
ImGui::Combo("Version", &selected, items, 2);
|
||||
if (ImGui::Combo("Version", &selected, items, 2))
|
||||
clear();
|
||||
|
||||
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, -1.0, 1.0);
|
||||
if (ImGui::SliderFloat("mu_a", &mu_a, 0.0, 1.0))
|
||||
clear();
|
||||
|
||||
if (ImGui::SliderFloat("mu_s", &mu_s, 0.0, 1.0))
|
||||
clear();
|
||||
|
||||
if (ImGui::SliderFloat("scattering parameter", &scattering_parameter, -1.0, 1.0))
|
||||
clear();
|
||||
|
||||
const char* scenes[] = {"Gnome", "Horse", "Heterogenous"};
|
||||
int oldscene = scene;
|
||||
ImGui::Combo("Scenes", &scene, scenes, 3);
|
||||
if (scene != oldscene) {
|
||||
if (ImGui::Combo("Scenes", &scene, scenes, 3)) {
|
||||
Data_Destructor(&data);
|
||||
Data_Constructor(&data, 1, 8);
|
||||
if (scene == 0)
|
||||
|
|
@ -42,6 +49,13 @@ private:
|
|||
}
|
||||
}
|
||||
|
||||
void clear() {
|
||||
data.accu_count = 0;;
|
||||
for (size_t i = 0; i < data.accu_width * data.accu_height; i++) {
|
||||
data.accu[i] = Vec3fx(0.0);
|
||||
}
|
||||
}
|
||||
|
||||
void initScene() override;
|
||||
|
||||
void emptyScene();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue