Revision 2894,
1.3 KB
checked in by mattausch, 16 years ago
(diff) |
shadow mapping almost working (but ulgy!!)
|
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 | class ShadowMap;
|
---|
15 | class Matrix4x4;
|
---|
16 |
|
---|
17 |
|
---|
18 | /** This class implements a deferred shading algorithm that takes
|
---|
19 | a frame buffer object as input and outputs an image in the given size
|
---|
20 | */
|
---|
21 | class DeferredShader
|
---|
22 | {
|
---|
23 | public:
|
---|
24 | /** constructor for a deferred shader taking the requested output image size
|
---|
25 | */
|
---|
26 | DeferredShader(int w, int h, float maxDepth);
|
---|
27 |
|
---|
28 | ~DeferredShader();
|
---|
29 | /** The algorithm renders the scene given an fbo.
|
---|
30 | The fbo must have color buffer, position buffer, normal buffer.
|
---|
31 | */
|
---|
32 | void Render(FrameBufferObject *fbo);
|
---|
33 |
|
---|
34 | /** Initialises the deferred shader and loads the required shaders:
|
---|
35 | This function has to be called only once.
|
---|
36 | */
|
---|
37 | static void Init(CGcontext context);
|
---|
38 |
|
---|
39 | void Render(FrameBufferObject *fbo, ShadowMap *shadowMap);
|
---|
40 |
|
---|
41 |
|
---|
42 | protected:
|
---|
43 |
|
---|
44 | void FirstPass(FrameBufferObject *fbo);
|
---|
45 |
|
---|
46 | void FirstPassShadow(FrameBufferObject *fbo, ShadowMap *shadowMap);
|
---|
47 |
|
---|
48 | void AntiAliasing(FrameBufferObject *fbo);
|
---|
49 |
|
---|
50 |
|
---|
51 | //////////////////
|
---|
52 |
|
---|
53 | int mWidth;
|
---|
54 | int mHeight;
|
---|
55 |
|
---|
56 | float mScaleFactor;
|
---|
57 | };
|
---|
58 |
|
---|
59 | } // namespace
|
---|
60 | #endif // _DeferredShader_H__ |
---|
Note: See
TracBrowser
for help on using the repository browser.