#pragma once //disable inheritance warning caused by multiple inheritance #if _WIN32 #if _MSC_VER #pragma warning(disable: 4250) #endif #endif #include "OgreRenderingRun.h" #include "CausticCubeMapRenderingRun.h" #include "OgreSharedRuns.h" /** @brief ColorCubeMapRenderingRun used in an OGRE environment. */ class OgreCausticCubeMapRenderingRun : public OgreRenderingRun, public CausticCubeMapRenderingRun { public: /** @brief Constructor. @param sharedRuns a pointer to the OgreSharedRuns this run belongs to @param name the name of the cubemap texture to be created @param startFrame adds an offset to the current frame number to help evenly distribute updates between frames @param updateInterval update frequency @param resolution cubemap resolution @param materialName the name of the material that should be used when rendering the caustic cubemap @param photonMapTexId the texture unit state id of the caustic map generation material where the photonhit map should be bound to @param updateAllFace defines if all cubemap faces should be updated in a frame or only one face per frame */ OgreCausticCubeMapRenderingRun(OgreSharedRuns* sharedRuns, String name, unsigned long startFrame, unsigned long updateInterval, unsigned int resolution, String materialName, unsigned char photonMapTexId, bool updateAllFace, float attenuation, bool useTriangles, bool blurMap ); /** @brief returns the name of the resulting caustic cubemap texture */ const String& getCausticCubeMapTextureName() { if(blurMap) return bluredCausticCubemapTexture->getName(); else return name; } //inherited void photonMapChanged(RenderingRun* run); float getAttenuation(){return attenuation;} bool canJoin(RenderingRun* run) { OgreCausticCubeMapRenderingRun* r = (OgreCausticCubeMapRenderingRun*) run->asOgreRenderingRun(); if(r->materialName == materialName) return true; return false; } protected: /** @brief the texture unit state id of the caustic map generation material where the photonhit map should be bound to */ unsigned char photonMapTexId; /** @brief a pointer to the OgreSharedRuns this run belongs to */ OgreSharedRuns* sharedRuns; /** @brief the name of the cubemap texture that was created by this run */ String name; /** @brief a pointer to the cubemap texture that was created by this run */ Texture* causticCubemapTexture; /** @brief a pointer to the blurred cubemap texture that was created by this run */ Texture* bluredCausticCubemapTexture; /** @brief the name of the material that should be used when rendering the caustic cubemap */ String materialName; float attenuation; bool useTriangles; bool blurMap; //inherited inline void createCausticCubeMap(); //inherited inline void updateCubeFace(int facenum); //inherited bool faceNeedsUpdate(int facenum); };