-
Notifications
You must be signed in to change notification settings - Fork 0
/
VCMTracer.h
50 lines (37 loc) · 1.2 KB
/
VCMTracer.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
#pragma once
#include "mcrenderer.h"
#include <omp.h>
#include "PointKDTree.h"
#include "macros.h"
#include "smallFuncs.h"
struct LightPathPoint
{
vec3f pos;
Path* path;
int index;
};
class VCMTracer : public MCRenderer
{
protected:
unsigned spp;
bool usePT;
bool mustUsePT(const Path& connectedPath);
Ray link(const Path& connectedPath, int connectIndex, int i, int j);
vec4<float> connectColorProb(const Path& connectedPath, int connectIndex, bool merged = false);
float connectMergeWeight(const Path& connectedPath, int connectIndex, bool merged, float expTerm = 1);
void colorByMergingPaths(vector<vec3f>& colors, const Path& eyePath, PointKDTree<LightPathPoint>& tree);
void colorByConnectingPaths(vector<omp_lock_t> &pixelLocks, const Camera& camera, vector<vec3f>& colors, const Path& eyePath, const Path& lightPath, vector<unsigned>* visibilityList = NULL);
public:
float mergeRadius;
float alpha;
unsigned timeInterval , lastTime;
VCMTracer(Renderer* renderer) : MCRenderer(renderer)
{
alpha = 0.6667;
spp = -1;
usePT = false;
timeInterval = lastTime = 3600;
}
void setRadius(const float& r) { mergeRadius = r; }
virtual vector<vec3f> renderPixels(const Camera& camera);
};