DeferredRenderer 1.0
|
00001 #ifndef POSTPROCESSOR_H 00002 #define POSTPROCESSOR_H 00003 00004 #include "FrameBufferObject.h" 00005 #include "TextureManager.h" 00006 #include "ScreenQuad.h" 00007 #include "Effect.h" 00008 #include "map" 00009 00017 class PostProcessor{ 00018 public: 00019 00021 PostProcessor(){} 00022 00027 PostProcessor(int _w, int _h, GLuint _vao); 00028 00030 ~PostProcessor(){} 00031 00033 void init(); 00034 00036 void addEffect(const std::string &_effectName, Effect _e); 00037 00039 void start(); 00040 00042 void finish(){m_fbo.unbind();} 00043 00045 void doEffect(const std::string &_effectName); 00046 00048 GLuint getFinalComposite(){return m_finalComposite;} 00049 00050 private: 00051 00053 GLuint m_finalComposite; 00054 00056 ScreenQuad m_screenQuad; 00057 00059 std::map<std::string, Effect> m_effects; 00060 00062 int m_width, m_height; 00063 00065 FrameBufferObject m_fbo; 00066 00068 GLuint m_vao; 00069 00071 int m_currentAttachment; 00072 }; 00073 00074 #endif // POSTPROCESSOR_H