[790] | 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,
|
---|
[1055] | 20 | public SBBRenderTechnique,
|
---|
| 21 | public RenderTargetListener,
|
---|
| 22 | public FrameListener,
|
---|
| 23 | public UpdateListener
|
---|
[790] | 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 | );
|
---|
[2320] | 40 | virtual ~OgreSBBRenderTechnique();
|
---|
[790] | 41 |
|
---|
| 42 | //inherited
|
---|
| 43 | virtual void update(unsigned long frameNum);
|
---|
[2240] | 44 | //inherited
|
---|
[1055] | 45 | void preRenderTargetUpdate (const RenderTargetEvent &evt);
|
---|
[2240] | 46 | //inherited
|
---|
[1055] | 47 | void postRenderTargetUpdate (const RenderTargetEvent &evt);
|
---|
[2240] | 48 | //inherited
|
---|
[1055] | 49 | bool frameEnded (const FrameEvent &evt);
|
---|
[2240] | 50 | //inherited
|
---|
[1055] | 51 | void preAllUpdates();
|
---|
[2240] | 52 | //inherited
|
---|
[1055] | 53 | void postAllUpdates();
|
---|
[790] | 54 |
|
---|
| 55 | protected:
|
---|
| 56 | /**
|
---|
| 57 | &brief the id of the texture unit state the resulting scene depth map should be bound to
|
---|
| 58 | */
|
---|
| 59 | unsigned char depthTexID;
|
---|
[1055] | 60 |
|
---|
| 61 | bool lastVisibility;
|
---|
[790] | 62 |
|
---|
| 63 | };
|
---|
[836] | 64 |
|
---|
[2240] | 65 | /**
|
---|
| 66 | @brief RenderTechniqueFactory to create OgreSBBRenderTechnique instances.
|
---|
| 67 | */
|
---|
[836] | 68 | class OgreSBBRenderTechniqueFactory : public RenderTechniqueFactory
|
---|
| 69 | {
|
---|
| 70 | public:
|
---|
| 71 |
|
---|
| 72 | OgreSBBRenderTechniqueFactory();
|
---|
| 73 |
|
---|
| 74 | OgreRenderTechnique* createInstance(IllumTechniqueParams* params,
|
---|
| 75 | Pass* pass,
|
---|
| 76 | OgreRenderable* parentRenderable,
|
---|
| 77 | OgreTechniqueGroup* parentTechniqueGroup);
|
---|
| 78 |
|
---|
| 79 |
|
---|
| 80 | unsigned char depthTexID;
|
---|
| 81 |
|
---|
| 82 | };
|
---|
| 83 |
|
---|
| 84 |
|
---|