49 lines
1.4 KiB
C++
49 lines
1.4 KiB
C++
#pragma once
|
|
#include "helper.hpp"
|
|
|
|
|
|
class Application2 : public Application {
|
|
public:
|
|
Application2(int argc, char** argv) : Application(argc, argv, "Assignment 1") {
|
|
}
|
|
|
|
private:
|
|
Vec3fa renderPixel(float x, float y, const ISPCCamera& camera, RayStats& stats, RandomSampler& sampler) override;
|
|
Vec3fa renderPixelOrig(float x, float y, const ISPCCamera& camera, RayStats& stats, RandomSampler& sampler);
|
|
Vec3fa renderPixelHomogeneous(float x, float y, const ISPCCamera& camera, RayStats& stats, RandomSampler& sampler);
|
|
|
|
void drawGUI() override {
|
|
ImGui::Checkbox("Bounding Box", &boundingBox);
|
|
|
|
const char* items[] = {"Original", "Homogeneous"};
|
|
ImGui::Combo("Version", &selected, items, 2);
|
|
|
|
const char* scenes[] = {"Gnome", "Horse", "Heterogenous"};
|
|
int oldscene = scene;
|
|
ImGui::Combo("Scenes", &scene, scenes, 3);
|
|
if (scene != oldscene) {
|
|
Data_Destructor(&data);
|
|
Data_Constructor(&data, 1, 8);
|
|
if (scene == 0)
|
|
gnomeScene();
|
|
if (scene == 1)
|
|
horseScene();
|
|
if (scene == 2)
|
|
heterogenousScene();
|
|
}
|
|
}
|
|
|
|
void initScene() override;
|
|
|
|
void emptyScene();
|
|
|
|
void gnomeScene();
|
|
|
|
void horseScene();
|
|
|
|
void heterogenousScene();
|
|
|
|
bool boundingBox = true;
|
|
int selected = 0;
|
|
int scene = 0;
|
|
};
|