-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathr_composite.h
63 lines (48 loc) · 1.09 KB
/
r_composite.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
63
#ifndef R_COMPOSITE_HDR
#define R_COMPOSITE_HDR
#include "r_method.h"
namespace m {
struct mat4;
struct perspective;
}
namespace r {
struct compositeMethod : method {
compositeMethod();
bool init(const u::vector<const char *> &defines = u::vector<const char *>());
void setWVP(const m::mat4 &wvp);
void setColorTextureUnit(int unit);
void setColorGradingTextureUnit(int unit);
void setPerspective(const m::perspective &perspective);
private:
uniform *m_WVP;
uniform *m_colorMap;
uniform *m_colorGradingMap;
uniform *m_screenSize;
};
inline compositeMethod::compositeMethod()
: m_WVP(nullptr)
, m_colorMap(nullptr)
, m_colorGradingMap(nullptr)
, m_screenSize(nullptr)
{
}
struct composite {
composite();
~composite();
bool init(const m::perspective &p, GLuint depth);
void update(const m::perspective &p);
void bindWriting();
GLuint texture() const;
private:
enum {
kBuffer,
kDepth
};
void destroy();
GLuint m_fbo;
GLuint m_texture;
size_t m_width;
size_t m_height;
};
}
#endif