54 lines
1.5 KiB
C++
54 lines
1.5 KiB
C++
#pragma once
|
|
#include "helper.hpp"
|
|
#include "application_integrator.h"
|
|
#include "simd/vboolf4_sse2.h"
|
|
|
|
|
|
class Application3 : public ApplicationIntegrator {
|
|
public:
|
|
Application3(int argc, char** argv) : ApplicationIntegrator(argc, argv, "Assignment 3") {
|
|
}
|
|
|
|
private:
|
|
Vec3fa renderPixel(float x, float y, const ISPCCamera& camera, RayStats& stats, RandomSamplerWrapper& sampler) override;
|
|
Vec3fa renderPixelPT(float x, float y, const ISPCCamera& camera, RayStats& stats, RandomSamplerWrapper& sampler);
|
|
Vec3fa renderPixelNEE(float x, float y, const ISPCCamera& camera, RayStats& stats, RandomSamplerWrapper& sampler);
|
|
|
|
|
|
void drawGUI() override {
|
|
ApplicationIntegrator::drawGUI(); // NEW!
|
|
ImGui::InputInt("Ray depth", &ray_depth);
|
|
if (ray_depth < 1) {
|
|
ray_depth = 1;
|
|
}
|
|
|
|
const char* methods[] = {"PT", "NEE"};
|
|
if (ImGui::Combo("Methods", &method, methods, 2)) {
|
|
resetRender();
|
|
}
|
|
|
|
const char* scenes[] = {"Cornell", "Ring"};
|
|
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)
|
|
causticScene();
|
|
}
|
|
|
|
}
|
|
|
|
void initScene() override;
|
|
|
|
void standardScene();
|
|
|
|
void causticScene();
|
|
|
|
float colorLight[3] = {1.0f, 1.0f, 1.0f};
|
|
int ray_depth = 5;
|
|
int scene = 0;
|
|
int method = 0;
|
|
};
|