2022-12-25 09:26:13 +01:00
|
|
|
#ifndef SUPERRENDERER_H
|
|
|
|
#define SUPERRENDERER_H
|
2022-12-13 02:47:01 +01:00
|
|
|
|
2022-12-25 09:26:13 +01:00
|
|
|
#include "renderer/renderer.h"
|
2022-12-13 02:47:01 +01:00
|
|
|
#include <atomic>
|
|
|
|
|
|
|
|
class SuperRenderer : public Renderer {
|
2022-12-25 09:26:13 +01:00
|
|
|
static void renderThread(const Scene *scene, Camera const *camera, Texture *image, int width, int widthStep,
|
|
|
|
int widthOffset, int height, int heightStep, int heightOffset, std::atomic<int> *k,
|
|
|
|
int const stepSize, int superSamplingFactor);
|
|
|
|
|
2022-12-13 02:47:01 +01:00
|
|
|
public:
|
2022-12-25 09:26:13 +01:00
|
|
|
// Constructor / Destructor
|
|
|
|
SuperRenderer() = default;
|
|
|
|
~SuperRenderer() override = default;
|
2022-12-13 02:47:01 +01:00
|
|
|
|
2022-12-25 09:26:13 +01:00
|
|
|
// Get
|
|
|
|
int superSamplingFactor() { return this->superSamplingFactor_; }
|
2022-12-13 02:47:01 +01:00
|
|
|
|
2022-12-25 09:26:13 +01:00
|
|
|
// Set
|
|
|
|
void setSuperSamplingFactor(int factor) { this->superSamplingFactor_ = factor; }
|
2022-12-13 02:47:01 +01:00
|
|
|
|
2022-12-25 09:26:13 +01:00
|
|
|
// Render functions
|
|
|
|
Texture renderImage(Scene const &scene, Camera const &camera, int width, int height) override;
|
2022-12-13 02:47:01 +01:00
|
|
|
|
2022-12-25 09:26:13 +01:00
|
|
|
private:
|
|
|
|
int superSamplingFactor_ = 2;
|
2022-12-13 02:47:01 +01:00
|
|
|
};
|
|
|
|
|
2022-12-25 09:26:13 +01:00
|
|
|
#endif
|