source: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/ShadowMapping.h @ 2891

Revision 2891, 1.1 KB checked in by mattausch, 16 years ago (diff)
Line 
1#ifndef _ShadowMapping_H__
2#define _ShadowMapping_H__
3
4#include "common.h"
5#include "glInterface.h"
6#include "AxisAlignedBox3.h"
7#include "Matrix4x4.h"
8#include <Cg/cg.h>
9#include <Cg/cgGL.h>
10
11
12
13namespace CHCDemoEngine
14{
15
16class FrameBufferObject;
17class RenderTraverser;
18class Vector3;
19class Camera;
20class Light;
21
22/** This class implements a shadow mapping algorithm
23*/
24class ShadowMapping
25{
26public:
27        /** constructor for a deferred shader taking the requested shadow size
28        */
29        ShadowMapping(const AxisAlignedBox3 &sceneBox, int size);
30
31        ~ShadowMapping();
32        /** Renders the shadowed scene
33        */
34        void Render(RenderTraverser *traverser, Camera *cam);
35        /** Initialises shadow mapping and loads the required shaders:
36                This function has to be called only once.
37        */
38        static void Init(CGcontext context);
39
40//protected:
41
42        void ComputeShadowMap(Light *light, RenderTraverser *traverser);
43
44protected:
45
46        FrameBufferObject *mFbo;
47
48        int mSize;
49
50        AxisAlignedBox3 mSceneBox;
51
52        Camera *mShadowCam;
53
54        Matrix4x4 mShadowMatrix;
55
56        Light *mLight;
57};
58
59} // namespace
60#endif // _DeferredShader_H__
Note: See TracBrowser for help on using the repository browser.