#pragma once //disable inheritance warning caused by multiple inheritance #if _WIN32 #if _MSC_VER #pragma warning(disable: 4250) #endif #endif #include "ConvolvedCubeMapRenderTechnique.h" #include "OgreRenderTechnique.h" #include "Ogre.h" using namespace Ogre; /** @brief ConvolvedCubeMapRenderTechnique used in an Ogre environment. */ class OgreConvolvedCubeMapRenderTechnique : public ConvolvedCubeMapRenderTechnique, public OgreRenderTechnique { public: /** @brief Constructor. @param startFrame adds an offset to the current frame number to help evenly distribute updates between frames @param cubeMapUpdateInterval update frequency @param cubeMapResolution color cubemap resolution @param reducedCubeMapResolution reduced sized color cubemap resolution @param reducedTexID the id of the texture unit state the resulting cubemap should be bound to @param useDistCalc flag to skip cube face update if object is far away @param useFaceAngleCalc flag to skip cube face update if face is neglible @param distTolerance distance tolerance used in face skip @param angleTolerance angle tolerance used in face skip @param updateAllFace defines if all cubemap faces should be updated in a frame or only one face per frame @param pass the pass to operate on @param parentRenderable the object to operate on @param parentTechniqueGroup the TechniqueGroup this RenderedTechnique is attached to */ OgreConvolvedCubeMapRenderTechnique( unsigned long startFrame, unsigned long cubeMapUpdateInterval, unsigned int cubeMapResolution, unsigned int reducedCubeMapResolution, unsigned char reducedTexID, bool useDistCalc, bool useFaceAngleCalc, float distTolerance, float angleTolerance, bool updateAllFace, Pass* pass, OgreRenderable* parentRenderable, OgreTechniqueGroup* parentTechniqueGroup ); /** @brief Destructor. */ ~OgreConvolvedCubeMapRenderTechnique(); //inherited void update(unsigned long frameNum); protected: /** @brief the id of the texture unit state the resulting cubemap should be bound to */ unsigned char reducedTexID; //inherited void reducedCubeMapRunChanged(RenderingRun* run); //inherited void colorCubeMapRunChanged(RenderingRun* run); //inherited RenderingRun* createColorCubeMapRun(); //inherited RenderingRun* createReducedCubeMapRun(); }; class OgreConvoledCubeMapRenderTechniqueFactory : public RenderTechniqueFactory { public: OgreConvoledCubeMapRenderTechniqueFactory(); OgreRenderTechnique* createInstance(IllumTechniqueParams* params, Pass* pass, OgreRenderable* parentRenderable, OgreTechniqueGroup* parentTechniqueGroup); unsigned long startFrame; unsigned long cubeMapUpdateInterval; unsigned int cubeMapResolution; unsigned int reducedCubeMapResolution; unsigned char texID; bool useDistCalc; bool useFaceAngleCalc; float distTolerance; float angleTolerance; bool updateAllFace; };