#pragma once #include "helper.hpp" #include "distribution.hpp" #include "sampler.h" #define NUM_CHAINS 100 class ApplicationIntegrator: public Application { public: ApplicationIntegrator(int argc, char** argv, const std::string& name); virtual ~ApplicationIntegrator() = default; protected: virtual void render(int* pixels, int width, int height, float time, const ISPCCamera& camera) override; virtual void drawGUI() override; virtual void resetRender() override; bool bMetropolis = false; void mltRender(int* pixels, int width, int height, float time, const ISPCCamera& camera); void mcRender(int* pixels, int width, int height, float time, const ISPCCamera& camera); /* renders a single screen tile */ void mcRenderTile(int taskIndex, int threadIndex, int* pixels, const unsigned int width, const unsigned int height, const float time, const ISPCCamera& camera, const int numTilesX, const int numTilesY); std::atomic luminance_count = 0; std::atomic accepted_count = 0; double large_step_global_luminance = 0.0; std::mutex large_step_global_luminance_mutex; MLTRandomSampler chains[NUM_CHAINS]; float last_l[NUM_CHAINS]; size_t frame_count = 0; int chain_lengths = 10000; float small_step_size = 0.01; float large_step_probability = 0.02; bool keep_chains = true; bool bootstrap = false; int bootstrap_amount = 500000; };