1 | #pragma once
|
---|
2 |
|
---|
3 | //disable inheritance warning caused by multiple inheritance
|
---|
4 | #if _WIN32
|
---|
5 | #if _MSC_VER
|
---|
6 | #pragma warning(disable: 4250)
|
---|
7 | #endif
|
---|
8 | #endif
|
---|
9 |
|
---|
10 | #include "OgreRenderTechnique.h"
|
---|
11 | #include "SBBRenderTechnique.h"
|
---|
12 | #include "Ogre.h"
|
---|
13 |
|
---|
14 | using namespace Ogre;
|
---|
15 |
|
---|
16 | /**
|
---|
17 | @brief SBBRenderTechnique used in an OGRE environment.
|
---|
18 | */
|
---|
19 | class OgreSBBRenderTechnique : public OgreRenderTechnique,
|
---|
20 | public SBBRenderTechnique,
|
---|
21 | public RenderTargetListener,
|
---|
22 | public FrameListener,
|
---|
23 | public UpdateListener
|
---|
24 | {
|
---|
25 | public:
|
---|
26 | /**
|
---|
27 | @brief Constructor.
|
---|
28 |
|
---|
29 | @param depthTexID the id of the texture unit state the resulting
|
---|
30 | scene depth map should be bound to
|
---|
31 | @param pass the pass to operate on
|
---|
32 | @param parentRenderable the object to operate on
|
---|
33 | @param parentTechniqueGroup the TechniqueGroup this RenderedTechnique is attached to
|
---|
34 | */
|
---|
35 | OgreSBBRenderTechnique( unsigned char depthTexID,
|
---|
36 | Pass* pass,
|
---|
37 | OgreRenderable* parentRenderable,
|
---|
38 | OgreTechniqueGroup* parentTechniqueGroup
|
---|
39 | );
|
---|
40 | ~OgreSBBRenderTechnique();
|
---|
41 |
|
---|
42 | //inherited
|
---|
43 | virtual void update(unsigned long frameNum);
|
---|
44 |
|
---|
45 | void preRenderTargetUpdate (const RenderTargetEvent &evt);
|
---|
46 | void postRenderTargetUpdate (const RenderTargetEvent &evt);
|
---|
47 | bool frameEnded (const FrameEvent &evt);
|
---|
48 | void preAllUpdates();
|
---|
49 | void postAllUpdates();
|
---|
50 |
|
---|
51 | protected:
|
---|
52 | /**
|
---|
53 | &brief the id of the texture unit state the resulting scene depth map should be bound to
|
---|
54 | */
|
---|
55 | unsigned char depthTexID;
|
---|
56 |
|
---|
57 | bool lastVisibility;
|
---|
58 |
|
---|
59 | };
|
---|
60 |
|
---|
61 |
|
---|
62 | class OgreSBBRenderTechniqueFactory : public RenderTechniqueFactory
|
---|
63 | {
|
---|
64 | public:
|
---|
65 |
|
---|
66 | OgreSBBRenderTechniqueFactory();
|
---|
67 |
|
---|
68 | OgreRenderTechnique* createInstance(IllumTechniqueParams* params,
|
---|
69 | Pass* pass,
|
---|
70 | OgreRenderable* parentRenderable,
|
---|
71 | OgreTechniqueGroup* parentTechniqueGroup);
|
---|
72 |
|
---|
73 |
|
---|
74 | unsigned char depthTexID;
|
---|
75 |
|
---|
76 | };
|
---|
77 |
|
---|
78 |
|
---|