-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathIS_PathTracer.h
58 lines (46 loc) · 1.18 KB
/
IS_PathTracer.h
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#pragma once
#include <cmath>
#include "Integrator.h"
#include "Ray.h"
#include "Object.h"
#include "Primitive.h"
#include "AccelerationStructure.h"
enum MSAA_Level {
none,
msaa_4x,
msaa_8x
};
class IS_PathTracer:
public Integrator {
public:
int NUM_THREADS;
int n_indirect_samples, n_primary_direct_samples, n_secondary_direct_samples, min_depth, max_depth, tile_size;
MSAA_Level msaa_level;
IS_PathTracer();
// search utility, searches space for intersections
// trace first ray
Primitive* trace(Ray&, Scene*) const;
// recursively trace further
void _trace(Ray&, Scene*, int) const;
// renders the image
std::vector<double> render(Scene*);
AccelerationStructure* acceleration_structure;
~IS_PathTracer();
private:
};
const double MSAA_jitter_4x[4*2] = {
3.0/4.0, -1.0/4.0,
1.0/4.0, 3.0/3.0,
-1.0/4.0, -3.0/4.0,
-3.0/4.0, 1.0/4.0
};
const double MSAA_jitter_8x[8*2] = {
3.0/4.0, 1.0/4.0,
-3.0/4.0, -1.0/3.0,
-1.0/4.0, 5.0/4.0,
5.0/4.0, -3.0/4.0,
-5.0/4.0, -5.0/4.0,
1.0/4.0, -7.0/4.0,
-7.0/4.0, 3.0/4.0,
7.0/4.0, 7.0/4.0
};