Revision 2861,
954 bytes
checked in by mattausch, 16 years ago
(diff) |
cleaned up code
|
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 |
|
---|
10 | namespace CHCDemoEngine
|
---|
11 | {
|
---|
12 |
|
---|
13 | class 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 | */
|
---|
19 | class DeferredShader
|
---|
20 | {
|
---|
21 | public:
|
---|
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 |
|
---|
38 | protected:
|
---|
39 |
|
---|
40 | int mWidth;
|
---|
41 | int mHeight;
|
---|
42 | };
|
---|
43 |
|
---|
44 | } // namespace
|
---|
45 | #endif // _DeferredShader_H__ |
---|
Note: See
TracBrowser
for help on using the repository browser.