[3255] | 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 "OgreRenderingRun.h"
|
---|
| 11 | #include "DepthShadowMapRenderingRun.h"
|
---|
| 12 | #include "OgreSharedRuns.h"
|
---|
| 13 | #include "OgreFocusingMapRenderingRun.h"
|
---|
| 14 |
|
---|
| 15 |
|
---|
| 16 | /**
|
---|
| 17 | @brief DepthShadowMapRenderingRun used in an OGRE environment.
|
---|
| 18 | */
|
---|
| 19 | class __declspec( dllexport ) OgreDepthShadowMapRenderingRun : public OgreRenderingRun,
|
---|
| 20 | public DepthShadowMapRenderingRun
|
---|
| 21 | {
|
---|
| 22 | public:
|
---|
| 23 |
|
---|
| 24 | /**
|
---|
| 25 | @brief Constructor.
|
---|
| 26 |
|
---|
| 27 | @param sharedRuns a pointer to the OgreSharedRuns this run belongs to
|
---|
| 28 | @param name the name of the depth map texture to be created
|
---|
| 29 | @param light the light source this depth shadow map belongs to
|
---|
| 30 | @param resolutionX the resolution width of the depth shadow map
|
---|
| 31 | @param resolutionY the resolution height of the depth shadow map
|
---|
| 32 | @param materialName the name of the material to be used when rendering the depth shadow map
|
---|
| 33 | */
|
---|
| 34 | OgreDepthShadowMapRenderingRun(OgreSharedRuns* sharedRuns,
|
---|
| 35 | String name,
|
---|
| 36 | Light* light,
|
---|
| 37 | unsigned int resolutionX,
|
---|
| 38 | unsigned int resolutionY,
|
---|
| 39 | String materialName);
|
---|
| 40 |
|
---|
| 41 | virtual ~OgreDepthShadowMapRenderingRun(){}
|
---|
| 42 |
|
---|
| 43 |
|
---|
| 44 | /**
|
---|
| 45 | @brief returns the depth shadow map texture created by this run
|
---|
| 46 | */
|
---|
| 47 | const String& getDepthMapTextureName();
|
---|
| 48 |
|
---|
| 49 | /**
|
---|
| 50 | @brief Refreshes light camera matrices, called in each update.
|
---|
| 51 | */
|
---|
| 52 | void refreshLight(unsigned long frameNum);
|
---|
| 53 | /**
|
---|
| 54 | @brief Retuns the view matrix of the camera from which the depth shadow map was created.
|
---|
| 55 | */
|
---|
| 56 | Matrix4 getLightViewMatrix();
|
---|
| 57 | /**
|
---|
| 58 | @brief Retuns the concatenation of the view and projection matrices of the camera from which the depth shadow map was created.
|
---|
| 59 | */
|
---|
| 60 | Matrix4 getLightViewProjMatrix();
|
---|
| 61 | /**
|
---|
| 62 | @brief Retuns the far plane of the light projection.
|
---|
| 63 | */
|
---|
| 64 | Real getLightFarPlane(){return lightFarPlane;}
|
---|
| 65 |
|
---|
| 66 | void freeAllResources();
|
---|
| 67 |
|
---|
| 68 | bool renderableQueued (Renderable *rend, uint8 groupID, ushort priority, Technique **ppTech);
|
---|
| 69 |
|
---|
| 70 | protected:
|
---|
| 71 | /**
|
---|
| 72 | @brief The light source this depth shadow map belongs to.
|
---|
| 73 | */
|
---|
| 74 | Light* light;
|
---|
| 75 | /**
|
---|
| 76 | @brief Pointer to the camera of the lightsource.
|
---|
| 77 | */
|
---|
| 78 | Camera* depthMapCamera;
|
---|
| 79 | /**
|
---|
| 80 | @brief The name of the material to be used when rendering the depth shadow map.
|
---|
| 81 | */
|
---|
| 82 | String materialName;
|
---|
| 83 | /**
|
---|
| 84 | @brief A pointer to the OgreSharedRuns this run belongs to.
|
---|
| 85 | */
|
---|
| 86 | OgreSharedRuns* sharedRuns;
|
---|
| 87 | /**
|
---|
| 88 | @brief The name of the depth shadow map texture that was created by this run.
|
---|
| 89 | */
|
---|
| 90 | String name;
|
---|
| 91 | /**
|
---|
| 92 | @brief The name of the blurred depth shadow map texture that was created by this run.
|
---|
| 93 | */
|
---|
| 94 | String blurredname;
|
---|
| 95 | /**
|
---|
| 96 | @brief A pointer to the depth shadow texture that was created by this run.
|
---|
| 97 | */
|
---|
| 98 | Texture* depthMapTexture;
|
---|
| 99 | /**
|
---|
| 100 | @brief A pointer to the blurred depth shadow texture that was created by this run.
|
---|
| 101 | */
|
---|
| 102 | Texture* blurredDepthMapTexture;
|
---|
| 103 | Real lightFarPlane;
|
---|
| 104 | String triggerName;
|
---|
| 105 |
|
---|
| 106 | //inherited
|
---|
| 107 | void updateFrame(unsigned long frameNum);
|
---|
| 108 | //inherited
|
---|
| 109 | inline void createDepthMap();
|
---|
| 110 | //inherited
|
---|
| 111 | void updateDepthCubeFace(int facenum);
|
---|
| 112 | //inherited
|
---|
| 113 | void updateDepthMap();
|
---|
| 114 |
|
---|
| 115 | };
|
---|