#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 CausticCubeMapRenderingRun 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 @param attenuation attenuation distance of the caustic @param useTriangles sets if triangles should be rendered into the caustic cubemap instead of sprites @param blurMap sets if the caustic cubemap should be blurred (recommended if rendering caustic triangles) */ 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); /** @see attenuation */ float getAttenuation(){return attenuation;} //inherited bool canJoin(RenderingRun* run) { OgreCausticCubeMapRenderingRun* r = (OgreCausticCubeMapRenderingRun*) run->asOgreRenderingRun(); if(r->materialName == materialName) return true; return false; } /** @see blurMap */ void setBlurMap(bool blur){blurMap = blur;} 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; /** @brief attenuation distance of the caustic */ float attenuation; /** @brief sets if triangles should be rendered into the caustic cubemap instead of sprites */ bool useTriangles; /** @brief sets if the caustic cubemap should be blurred (recommended if rendering caustic triangles) */ bool blurMap; //inherited inline void createCausticCubeMap(); //inherited inline void updateCubeFace(int facenum); //inherited bool faceNeedsUpdate(int facenum); };