-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrenderer.h
More file actions
38 lines (28 loc) · 748 Bytes
/
renderer.h
File metadata and controls
38 lines (28 loc) · 748 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef RENDERER_H
#define RENDERER_H
#include <memory>
#include "framebuffer.h"
#include "lin_alg.h"
#include "scene.h"
class Renderer : public Framebuffer
{
public:
Renderer(std::unique_ptr<Scene> scene);
~Renderer() { KillAllWorkerThreads(); }
void SetSampleCount(uint cnt);
uint GetSampleCount() const { return m_sample_count; }
protected:
bool RayMarch(Vec3f origin, Vec3f dir, float& t);
void RenderTile(Tile& tile) override;
float DistanceBruteForce(Vec3f pos);
bool IntersectBruteForce(
Vec3f origin,
Vec3f dir,
float& t,
float& u,
float& v,
uint32& tri_idx);
std::unique_ptr<Scene> m_scene;
uint m_sample_count = 16;
};
#endif // RENDERER_H