-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoffScreenBuffer.h
More file actions
52 lines (38 loc) · 1.4 KB
/
offScreenBuffer.h
File metadata and controls
52 lines (38 loc) · 1.4 KB
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
#pragma once
#include "texture2d.h"
#include "teShader.h"
#include "TranceEngine.h"
//#include "modules/te2graphicsmodule.h"
extern TranceEngine* globalWorld;
class OffScreenBuffer
{
public:
void BeginOffscreenRender(); //binds and clears
void EndOffscreenRender(); //binds framebuffer 0
void DrawToScreen(); //draws fullscreen quad
void resize(int width, int height);
void bindTexture_WorldPos(GLuint slot);
void bindTexture_Depth(GLuint slot);
void bindTexture_Color(GLuint slot);
void setDrawBuffers_ColorOnly(); //my FBO must already be bound
void setDrawBuffers_All(); //my FBO must already be bound
OffScreenBuffer(GLuint width, GLuint height);
~OffScreenBuffer();
private:
GLuint myFBO_Main; //for most objects, writes globalID
GLuint myFBO_SecondPass; //for transparencies and water
//========= Textures for first FBO =========
Texture2D myFramebufferTexture_Depth;
Texture2D myFramebufferTexture_Color;
Texture2D myFramebufferTexture_GlobalID;
Texture2D myFramebufferTexture_WorldPos;
//========= Texture for second FBO =========
Texture2D myFramebufferTexture_SecondPass_Color;
GLuint myWidth = 0;
GLuint myHeight = 0;
//====== Items needed to draw fullscreen quad to FBO 0 =====
teShader myShader;
GLuint fullscreenQuad_VAO;
GLuint fullscreenQuad_VBO;
GLboolean Confuse, Chaos, Shake = GL_FALSE;
};