51 lines
1.4 KiB
C++
51 lines
1.4 KiB
C++
#pragma once
|
|
#include "helper.hpp"
|
|
#include "imgui.h"
|
|
|
|
|
|
class Application1 : public Application {
|
|
public:
|
|
Application1(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 renderPixelPathTracer(float x, float y, const ISPCCamera& camera, RayStats& stats, RandomSampler& sampler);
|
|
|
|
void drawGUI() override {
|
|
ImGui::ColorEdit3("Color", colorLight);
|
|
ImGui::InputInt("Ray depth", &ray_depth);
|
|
if (ray_depth < 1) {
|
|
ray_depth = 1;
|
|
}
|
|
|
|
const char* items[] = {"Original", "Path Tracer"};
|
|
ImGui::Combo("Version", &selected, items, 2);
|
|
|
|
const char* scenes[] = {"Cornell", "Veach"};
|
|
int oldscene = scene;
|
|
ImGui::Combo("Scenes", &scene, scenes, 2);
|
|
if (scene != oldscene) {
|
|
Data_Destructor(&data);
|
|
Data_Constructor(&data, 1, 8);
|
|
if (scene == 0)
|
|
standardScene();
|
|
if (scene == 1)
|
|
veachScene();
|
|
}
|
|
|
|
}
|
|
|
|
void initScene() override;
|
|
|
|
void standardScene();
|
|
|
|
void veachScene();
|
|
|
|
float colorLight[3] = {1.0f, 1.0f, 1.0f};
|
|
int ray_depth = 5;
|
|
int selected = 0;
|
|
int scene = 0;
|
|
|
|
};
|