Revision 2879,
1.0 KB
checked in by mattausch, 16 years ago
(diff) |
improved performance
|
Rev | Line | |
---|
[2858] | 1 | #ifndef _DeferredShader_H__
|
---|
| 2 | #define _DeferredShader_H__
|
---|
| 3 |
|
---|
| 4 | #include "common.h"
|
---|
[2859] | 5 | #include "glInterface.h"
|
---|
| 6 | #include <Cg/cg.h>
|
---|
| 7 | #include <Cg/cgGL.h>
|
---|
[2858] | 8 |
|
---|
[2859] | 9 |
|
---|
[2858] | 10 | namespace CHCDemoEngine
|
---|
| 11 | {
|
---|
| 12 |
|
---|
| 13 | class FrameBufferObject;
|
---|
| 14 |
|
---|
[2859] | 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
|
---|
[2858] | 18 | */
|
---|
| 19 | class DeferredShader
|
---|
| 20 | {
|
---|
| 21 | public:
|
---|
[2859] | 22 | /** constructor for a deferred shader taking the requested output image size
|
---|
[2858] | 23 | */
|
---|
[2859] | 24 | DeferredShader(int w, int h);
|
---|
[2858] | 25 |
|
---|
[2861] | 26 | ~DeferredShader();
|
---|
[2858] | 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);
|
---|
[2859] | 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 |
|
---|
[2865] | 40 | void FirstPass(FrameBufferObject *fbo);
|
---|
| 41 | void AntiAliasing(FrameBufferObject *fbo);
|
---|
| 42 |
|
---|
[2859] | 43 | int mWidth;
|
---|
| 44 | int mHeight;
|
---|
[2865] | 45 |
|
---|
[2879] | 46 | //FrameBufferObject *mFbo;
|
---|
[2858] | 47 | };
|
---|
| 48 |
|
---|
| 49 | } // namespace
|
---|
| 50 | #endif // _DeferredShader_H__ |
---|
Note: See
TracBrowser
for help on using the repository browser.