-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRayTracer.h
More file actions
49 lines (31 loc) · 1.13 KB
/
Copy pathRayTracer.h
File metadata and controls
49 lines (31 loc) · 1.13 KB
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
//
// Created by Jiang Kairong on 3/10/18.
//
#ifndef PROG03_INLINEBOOL_RAYTRACER_H
#define PROG03_INLINEBOOL_RAYTRACER_H
#include "Scene.h"
#include "Image.h"
#include <random>
class RayTracer {
public:
explicit RayTracer(const std::string &sceneFileName, double randomMu = 0., double randomSigma = 1.,
int maxRecursiveDepth = 5, int sampleRate = 100, bool distributionEnabled = false);
Image8i renderForDisplay();
Image8i convertFloatImage2Int(Image32f image);
int getSampleRate() const;
void setSampleRate(int sampleRate);
bool isDistributionEnabled() const;
void setDistributionEnabled(bool distributionEnabled);
private:
const ColorRGB32f shading(const Ray &ray, bool doDistribution, int depth);
Image32f render(bool doDistribution = false);
std::vector<Ray> prepareRays(const Camera &camera, bool doDistribution = false);
Scene scene;
double randomMu, randomSigma;
int maxRecursiveDepth;
int sampleRate;
bool distributionEnabled;
std::default_random_engine randomEngine;
std::uniform_real_distribution<double> uniformRandomGenerator;
};
#endif //PROG03_INLINEBOOL_RAYTRACER_H