2015-01-30 13:59:52 +00:00
|
|
|
#ifndef POST_PROCESSOR_H
|
|
|
|
#define POST_PROCESSOR_H
|
|
|
|
|
|
|
|
#include "Types.h"
|
|
|
|
#include "OpenGL.h"
|
|
|
|
#include "Textures.h"
|
|
|
|
|
|
|
|
class PostProcessor {
|
|
|
|
public:
|
|
|
|
void init();
|
|
|
|
void destroy();
|
|
|
|
|
2016-04-02 12:56:07 +00:00
|
|
|
FrameBuffer * doBlur(FrameBuffer * _pBuffer);
|
|
|
|
FrameBuffer * doGammaCorrection(FrameBuffer * _pBuffer);
|
2016-10-29 17:33:05 +00:00
|
|
|
FrameBuffer * doOrientationCorrection(FrameBuffer * _pBuffer);
|
2015-01-30 13:59:52 +00:00
|
|
|
|
|
|
|
static PostProcessor & get();
|
|
|
|
|
|
|
|
private:
|
2016-04-02 12:56:07 +00:00
|
|
|
PostProcessor();
|
2015-01-30 13:59:52 +00:00
|
|
|
PostProcessor(const PostProcessor & _other);
|
2016-04-22 20:49:18 +00:00
|
|
|
|
2015-12-23 10:22:30 +00:00
|
|
|
void _initCommon();
|
|
|
|
void _destroyCommon();
|
|
|
|
void _initGammaCorrection();
|
|
|
|
void _destroyGammaCorrection();
|
2016-10-29 17:33:05 +00:00
|
|
|
void _initOrientationCorrection();
|
|
|
|
void _destroyOrientationCorrection();
|
2015-12-23 10:21:55 +00:00
|
|
|
void _initBlur();
|
|
|
|
void _destroyBlur();
|
2016-05-13 17:29:35 +00:00
|
|
|
void _setGLState();
|
2015-12-23 10:22:30 +00:00
|
|
|
void _preDraw(FrameBuffer * _pBuffer);
|
|
|
|
void _postDraw();
|
2015-01-30 13:59:52 +00:00
|
|
|
|
2015-01-31 07:14:13 +00:00
|
|
|
GLuint m_extractBloomProgram;
|
|
|
|
GLuint m_seperableBlurProgram;
|
|
|
|
GLuint m_glowProgram;
|
2015-01-30 13:59:52 +00:00
|
|
|
GLuint m_bloomProgram;
|
|
|
|
|
2015-12-23 10:22:30 +00:00
|
|
|
GLuint m_gammaCorrectionProgram;
|
|
|
|
|
2016-10-29 17:33:05 +00:00
|
|
|
GLuint m_orientationCorrectionProgram;
|
|
|
|
|
2016-04-02 12:56:07 +00:00
|
|
|
FrameBuffer * m_pResultBuffer;
|
|
|
|
|
2015-01-31 07:14:13 +00:00
|
|
|
GLuint m_FBO_glowMap;
|
|
|
|
GLuint m_FBO_blur;
|
|
|
|
|
|
|
|
CachedTexture * m_pTextureOriginal;
|
|
|
|
CachedTexture * m_pTextureGlowMap;
|
|
|
|
CachedTexture * m_pTextureBlur;
|
2016-04-22 20:49:18 +00:00
|
|
|
|
|
|
|
#ifdef ANDROID
|
|
|
|
static PostProcessor processor;
|
|
|
|
#endif
|
2015-01-30 13:59:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // POST_PROCESSOR_H
|