2016-07-26 19:27:02 +00:00
|
|
|
#ifndef __GL_RENDERBUFFERS_H
|
|
|
|
#define __GL_RENDERBUFFERS_H
|
|
|
|
|
|
|
|
#include "gl/shaders/gl_shader.h"
|
|
|
|
|
2016-07-27 19:50:30 +00:00
|
|
|
class FGLBloomTextureLevel
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
GLuint VTexture = 0;
|
|
|
|
GLuint VFramebuffer = 0;
|
|
|
|
GLuint HTexture = 0;
|
|
|
|
GLuint HFramebuffer = 0;
|
|
|
|
GLuint Width = 0;
|
|
|
|
GLuint Height = 0;
|
|
|
|
};
|
|
|
|
|
2016-07-26 19:27:02 +00:00
|
|
|
class FGLRenderBuffers
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
FGLRenderBuffers();
|
|
|
|
~FGLRenderBuffers();
|
|
|
|
|
|
|
|
void Setup(int width, int height);
|
|
|
|
void BindSceneFB();
|
2016-07-28 22:36:43 +00:00
|
|
|
void BindHudFB();
|
2016-07-26 19:27:02 +00:00
|
|
|
void BindOutputFB();
|
|
|
|
void BindSceneTexture(int index);
|
2016-07-28 22:36:43 +00:00
|
|
|
void BindHudTexture(int index);
|
2016-07-26 19:27:02 +00:00
|
|
|
|
|
|
|
static bool IsSupported() { return gl.version >= 3.3f; }
|
|
|
|
|
2016-07-27 19:50:30 +00:00
|
|
|
enum { NumBloomLevels = 4 };
|
|
|
|
FGLBloomTextureLevel BloomLevels[NumBloomLevels];
|
|
|
|
|
2016-07-26 19:27:02 +00:00
|
|
|
private:
|
2016-07-27 19:50:30 +00:00
|
|
|
void Clear();
|
|
|
|
|
2016-07-26 19:27:02 +00:00
|
|
|
int mWidth = 0;
|
|
|
|
int mHeight = 0;
|
|
|
|
|
|
|
|
GLuint mSceneTexture = 0;
|
|
|
|
GLuint mSceneDepthStencil = 0;
|
|
|
|
GLuint mSceneFB = 0;
|
2016-07-28 22:36:43 +00:00
|
|
|
GLuint mHudTexture = 0;
|
|
|
|
GLuint mHudFB = 0;
|
2016-07-26 19:27:02 +00:00
|
|
|
GLuint mOutputFB = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|