-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathraytracing.h
59 lines (37 loc) · 963 Bytes
/
raytracing.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 <clcontextwrapper.h>
#include <scene.h>
#include <memory>
class RayTracing
{
public:
RayTracing(dwg::Scene scene, unsigned int glTexture, int textureWidth, int textureHeight);
void update();
void setEye(glm::vec3 eye);
glm::vec3 getEye() const;
private:
void _compactRays(BufferId rays, int count);
void _prefixSum(BufferId input, BufferId output, int n);
void testScan();
private:
// Shared OpenGL texture
unsigned int _glTexture;
BufferId _sharedTextureBufferId;
// Spheres
BufferId _spheresBufferId;
int _numSpheres;
// Planes
BufferId _planesBufferId;
int _numPlanes;
// Lights
BufferId _lightsBufferId;
int _numLights;
// Temp buffer
BufferId _tempColorsBufferId;
glm::vec3 _eye;
int _textureWidth;
int _textureHeight;
size_t localSizeX;
size_t localSizeY;
std::shared_ptr<CLContextWrapper> _clContext;
};