#ifndef _DeferredShader_H__ #define _DeferredShader_H__ #include "common.h" #include "glInterface.h" #include #include namespace CHCDemoEngine { class FrameBufferObject; /** This class implements a deferred shading algorithm that takes a frame buffer object as input and outputs an image in the given size */ class DeferredShader { public: /** constructor for a deferred shader taking the requested output image size */ DeferredShader(int w, int h); ~DeferredShader(); /** The algorithm renders the scene given an fbo. The fbo must have color buffer, position buffer, normal buffer. */ void Render(FrameBufferObject *fbo); /** Initialises the deferred shader and loads the required shaders: This function has to be called only once. */ static void Init(CGcontext context); protected: void FirstPass(FrameBufferObject *fbo); void AntiAliasing(FrameBufferObject *fbo); int mWidth; int mHeight; //FrameBufferObject *mFbo; }; } // namespace #endif // _DeferredShader_H__