-
Notifications
You must be signed in to change notification settings - Fork 0
/
AlternativeBPTracer.h
32 lines (24 loc) · 1015 Bytes
/
AlternativeBPTracer.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
#pragma once
#include <omp.h>
#include "MCRenderer.h"
#include <unordered_map>
#include "macros.h"
class AlternativeBPTracer : public MCRenderer
{
public:
protected:
unsigned spp;
Ray link(const Ray& src, const Ray& dst);
vec4<float> connectColorProb(const Path& connectedPath, int connectIndex);
float connectWeight(int pixelID, int lightRaysCaught, const Path& connectedPath, int connectIndex, float expTerm = 1);
void colorByConnectingPaths(vector<unordered_map<unsigned, unsigned>>& nLightRaysCaught, vector<omp_lock_t> &pixelLocks, const Camera& camera, vector<vec3f>& colors, const Path& eyePath, const Path& lightPath);
bool connectRays(Path& path, int connectIndex, int pixelID);
void statLightRaysCaught(vector<unordered_map<unsigned, unsigned>>& nLightRaysCaught, vector<omp_lock_t> &pixelLocks, const Path& lightPath);
public:
AlternativeBPTracer(Renderer* renderer) : MCRenderer(renderer)
{
maxDepth = 20;
spp = -1;
}
virtual vector<vec3f> renderPixels(const Camera& camera);
};