-
Notifications
You must be signed in to change notification settings - Fork 1
/
monte_carlo_integrator.h
62 lines (46 loc) · 1.34 KB
/
monte_carlo_integrator.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
59
60
61
62
#ifndef _MONTE_CARLO_INTEGRATOR_H_
#define _MONTE_CARLO_INTEGRATOR_H_
#include "common.h"
#include "math3.h"
#include "integrator.h"
#include "sensor.h"
namespace Renzoku {
class IMonteCarloIntegrator {
public:
inline int get_num_samples() const;
inline void set_num_samples(int num_samples);
protected:
int num_samples;
};
inline int IMonteCarloIntegrator::get_num_samples() const {
return num_samples;
}
inline void IMonteCarloIntegrator::set_num_samples(int num_samples) {
this->num_samples = num_samples;
}
class MonteCarloIntegrator : public Integrator,
public IMonteCarloIntegrator {
public:
MonteCarloIntegrator();
virtual void initialize(Scene *scene);
virtual inline string get_suffix() const;
/**
* Perform integration of the bundle and provide progressive update to the frame buffer.
*/
virtual void integrate(PrimaryRayBundle &b, FrameBuffer *frame);
virtual void on_frame_begin() {}
virtual void on_frame_end() {}
protected:
virtual void radiance(PrimaryRay &r);
virtual Rgb radiance(const Ray &r);
virtual Rgb radiance(const Receiver &r);
protected:
string suffix;
ImageFloat *target;
ImageFloat *weight;
};
inline string MonteCarloIntegrator::get_suffix() const {
return suffix;
}
} // end namespace
#endif