-
Notifications
You must be signed in to change notification settings - Fork 0
/
GBuffer.h
65 lines (55 loc) · 1.14 KB
/
GBuffer.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
64
65
#ifndef GBUFFER_H
#define GBUFFER_H
#include <windows.h>
#undef __glext_h_
#undef __glxext_h_
#undef __gl_h_
#include <GL/GLee.h>
#include <vector>
#include "Chunk.h"
#include "WorldState.h"
#include "Camera.h"
#include "Frustum.h"
#include "View.h"
using namespace std;
/*
* Author: wcrane
* Date: 3/17/2013
*
* Framebuffer Object holding the first pass of deffered shading process.
*/
class GBuffer
{
private:
GLuint m_nDepthTex;
GLuint m_nNormalTex;
GLuint m_nColorTex;
GLuint m_nWorldPosTex;
GLuint m_nGlowTex;
GLuint m_nMotionTex;
GLuint m_nFrameBuffer;
int m_nWidth, m_nHeight;
Camera m_lastCamera;
glm::mat4 m_m4LastCameraProj;
public:
GBuffer(int nWidth, int nHeight);
~GBuffer();
void drawToBuffer(View *view);
void bind();
void unbind();
void bindDepthTex();
void bindNormalTex();
void bindColorTex();
void bindPositionTex();
void bindGlowTex();
void bindMotionTex();
GLuint getGlowTex();
GLuint getDepthTex();
GLuint getColorTex();
GLuint getNormalTex();
GLuint getWorldPosTex();
GLuint getMotionTex();
int getWidth();
int getHeight();
};
#endif