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

Revision 2879, 1.0 KB checked in by mattausch, 16 years ago (diff)

improved performance

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        ~DeferredShader();
27        /** The algorithm renders the scene given an fbo.
28                The fbo must have color buffer, position buffer, normal buffer.
29        */
30        void Render(FrameBufferObject *fbo);
31
32        /** Initialises the deferred shader and loads the required shaders:
33                This function has to be called only once.
34        */
35        static void Init(CGcontext context);
36
37
38protected:
39
40        void FirstPass(FrameBufferObject *fbo);
41        void AntiAliasing(FrameBufferObject *fbo);
42
43        int mWidth;
44        int mHeight;
45
46        //FrameBufferObject *mFbo;
47};
48
49} // namespace
50#endif // _DeferredShader_H__
Note: See TracBrowser for help on using the repository browser.