#pragma once //disable inheritance warning caused by multiple inheritance #if _WIN32 #if _MSC_VER #pragma warning(disable: 4250) #endif #endif #include "ConvolvedCubeMapRenderTechnique.h" #include "OgreCubeMapRenderTechnique.h" #include "Ogre.h" using namespace Ogre; /** @brief ConvolvedCubeMapRenderTechnique used in an Ogre environment. */ class OgreConvolvedCubeMapRenderTechnique : public ConvolvedCubeMapRenderTechnique, public OgreCubeMapRenderTechnique { 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 renderSelf sets if the object should be rendered to the cube map @param renderEnvironment sets if the environment should be rendered to the cube map @param selfMaterial the material that should be set for the object while rendering the cubemap @param environmentMaterial the material that should be set for the environment while rendering the cubemap @param getMinMax sets if the minimum and maximum values of the cubemap should be computed @param attachToTexUnit sets if this cubemap should be attach to a texture unit of the pass @param minVariableName sets the name of the gpu shader program parameter to which the minimum value should be bound to @param maxVariableName sets the name of the gpu shader program parameter to which the maximum value 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 */ OgreConvolvedCubeMapRenderTechnique( 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, bool renderSelf, bool renderEnvironment, String selfMaterial, String environmentMaterial, bool getMinMax, bool attachToTexUnit, String minVariableName, String maxVariableName, String triggerName, Pass* pass, OgreRenderable* parentRenderable, OgreTechniqueGroup* parentTechniqueGroup ); /** @brief Destructor. */ virtual ~OgreConvolvedCubeMapRenderTechnique(); //inherited void update(unsigned long frameNum); protected: //inherited void reducedCubeMapRunChanged(RenderingRun* run); //inherited void colorCubeMapRunChanged(RenderingRun* run); //inherited RenderingRun* createReducedCubeMapRun(); }; /** @brief RenderTechniqueFactory to create OgreConvoledCubeMapRenderTechnique instances. */ class OgreConvoledCubeMapRenderTechniqueFactory : public OgreCubeMapRenderTechniqueFactory { public: OgreConvoledCubeMapRenderTechniqueFactory(); OgreRenderTechnique* createInstance(IllumTechniqueParams* params, Pass* pass, OgreRenderable* parentRenderable, OgreTechniqueGroup* parentTechniqueGroup); unsigned int reducedCubeMapResolution; };