source: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredShader.h @ 2859

Revision 2859, 933 bytes checked in by mattausch, 16 years ago (diff)
Line 
1#ifndef _DeferredShader_H__
2#define _DeferredShader_H__
3
4#include "common.h"
5#include "glInterface.h"
6#include <Cg/cg.h>
7#include <Cg/cgGL.h>
8
9
10namespace CHCDemoEngine
11{
12
13class FrameBufferObject;
14
15
16/** This class implements a deferred shading algorithm that takes
17        a frame buffer object as input and outputs an image in the given size
18*/
19class DeferredShader
20{
21public:
22        /** constructor for a deferred shader taking the requested output image size
23        */
24        DeferredShader(int w, int h);
25
26        /** The algorithm renders the scene given an fbo.
27                The fbo must have color buffer, position buffer, normal buffer.
28        */
29        void Render(FrameBufferObject *fbo);
30
31        /** Initialises the deferred shader and loads the required shaders:
32                This function has to be called only once.
33        */
34        static void Init(CGcontext context);
35
36
37protected:
38
39        int mWidth;
40        int mHeight;
41};
42
43} // namespace
44#endif // _DeferredShader_H__
Note: See TracBrowser for help on using the repository browser.