#pragma once //disable inheritance warning caused by multiple inheritance #if _WIN32 #if _MSC_VER #pragma warning(disable: 4250) #endif #endif #include "OgreRenderTechnique.h" #include "Ogre.h" using namespace Ogre; class FireRenderTarget : public GlobalUseRenderTarget { public: static int targetsize; FireRenderTarget(); ~FireRenderTarget(); }; /** @brief A special SBBRenderTechnique used in an OGRE environment. Instead of rendering to the frame buffer this Technique renders into two render targets at the same time. The firs render target will be used as it were an ordinary backbuffer. The second rendertarget will be used to simulate heat shimmering (offset values will be written to it). The shimmering effect will be achieved with post processing: combining the backbuffer with the first render target using the second render target as uv offset. Just like the spherical billboard techniqeue, this thechnique requires a depth image taken from main camera's viewpoint. */ class OgreFireRenderTechnique : public OgreRenderTechnique, public RenderTargetListener, public FrameListener, public UpdateListener { public: /** @brief Constructor. @param depthTexID the id of the texture unit state the resulting scene depth map should be bound to @param pass the pass to operate on @param parentRenderable the object to operate on @param parentTechniqueGroup the TechniqueGroup this RenderedTechnique is attached to */ OgreFireRenderTechnique( unsigned char depthTexID, Pass* pass, OgreRenderable* parentRenderable, OgreTechniqueGroup* parentTechniqueGroup ); virtual ~OgreFireRenderTechnique(); //inherited virtual void update(unsigned long frameNum); //inherited void preRenderTargetUpdate (const RenderTargetEvent &evt); //inherited void postRenderTargetUpdate (const RenderTargetEvent &evt); //inherited bool frameEnded (const FrameEvent &evt); //inherited void preAllUpdates(); protected: /** &brief the id of the texture unit state the resulting scene depth map should be bound to */ unsigned char depthTexID; bool lastVisibility; }; /** @brief RenderTechniqueFactory to create OgreFireRenderTechnique instances. */ class OgreFireRenderTechniqueFactory : public RenderTechniqueFactory { public: OgreFireRenderTechniqueFactory(); OgreRenderTechnique* createInstance(IllumTechniqueParams* params, Pass* pass, OgreRenderable* parentRenderable, OgreTechniqueGroup* parentTechniqueGroup); unsigned char depthTexID; };