#pragma once //disable inheritance warning caused by multiple inheritance #if _WIN32 #if _MSC_VER #pragma warning(disable: 4250) #endif #endif #include "CubeMapRenderTechnique.h" #include "OgreRenderTechnique.h" #include "Ogre.h" using namespace Ogre; /** @brief CubeMapRenderTechnique used in an Ogre environment. */ class OgreCubeMapRenderTechnique : virtual public CubeMapRenderTechnique, 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 texID 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 */ OgreCubeMapRenderTechnique( unsigned long startFrame, unsigned long cubeMapUpdateInterval, unsigned int cubeMapResolution, unsigned char texID, bool useDistCalc, bool useFaceAngleCalc, float distTolerance, float angleTolerance, bool updateAllFace, bool renderSelf, bool renderEnvironment, String selfMaterial, String environmentMaterial, int layer, bool getMinMax, bool attachToTexUnit, String minVariableName, String maxVariableName, Pass* pass, OgreRenderable* parentRenderable, OgreTechniqueGroup* parentTechniqueGroup, bool createCubeRun = false ); /** @brief Destructor. */ ~OgreCubeMapRenderTechnique(); protected: /** @brief the id of the texture unit state the resulting cubemap should be bound to */ unsigned char texID; String selfMaterial; String environmentMaterial; String texturePostFix; bool getMinMax; bool attachToTexUnit; String minVariableName; String maxVariableName; RenderingRun* createCubeMapRun(); void cubeMapRunChanged(RenderingRun* run); }; class OgreCubeMapRenderTechniqueFactory : public RenderTechniqueFactory { public: OgreCubeMapRenderTechniqueFactory(); OgreRenderTechnique* createInstance(IllumTechniqueParams* params, Pass* pass, OgreRenderable* parentRenderable, OgreTechniqueGroup* parentTechniqueGroup); void resetParams(); unsigned long startFrame; unsigned long cubeMapUpdateInterval; unsigned int cubeMapResolution; unsigned char texID; bool useDistCalc; bool useFaceAngleCalc; float distTolerance; float angleTolerance; bool updateAllFace; bool renderSelf; bool renderEnvironment; String selfMaterial; String environmentMaterial; int layer; bool getMinMax; bool attachToTexUnit; String minVariableName; String maxVariableName; };