#pragma once //disable inheritance warning caused by multiple inheritance #if _WIN32 #if _MSC_VER #pragma warning(disable: 4250) #endif #endif #include "OgreRenderTechnique.h" #include "CausticCasterRenderTechnique.h" /** @brief CausticCasterRenderTechnique used in an OGRE environment. */ class OgreCausticCasterRenderTechnique : public OgreRenderTechnique, public CausticCasterRenderTechnique { public: /** @brief Constructor. @param startFrame adds an offset to the current frame number to help evenly distribute updates between frames @param photonMapUpdateInterval photon map and caustic cubemap update frequency @param photonMapResolution photon map resolution @param causticCubeMapResolution caustic cubemap resolution @param photonMapMaterialName the name of the material should be used when rendering the choton hit map @param causticMapMaterialName 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 useDistance tells if a distance cubemap impostor should be used in photon hit calculation (recommended) @param pass the pass to operate on @param parentRenderable the object to operate on @param parentTechniqueGroup the TechniqueGroup this RenderedTechnique is attached to */ OgreCausticCasterRenderTechnique( unsigned long startFrame, unsigned long photonMapUpdateInterval, unsigned int photonMapResolution, unsigned int custicCubeMapResolution, String photonMapMaterialName, String causticMapMaterialName, unsigned char photonMapTexID, bool updateAllFace, bool useDistance, float attenuation, bool useTriangles, bool blurCauCubeMap, Pass* pass, OgreRenderable* parentRenderable, OgreTechniqueGroup* parentTechniqueGroup ); /** @brief Destructor. */ ~OgreCausticCasterRenderTechnique(); /** @brief Returns the name of the created caustic cubemap. @return name of the caustic cubemap texture */ const String& getCausticCubeMapName(); float getAttenuation(){return attenuation;} protected: /** @brief name of the created photon hit map texture */ String photonMapMaterialName; /** @brief name of the created caustic cubemap texture */ String causticMapMaterialName; /** @brief the texture unit state id of the caustic map generation material where the photonhit map should be bound to. */ unsigned char photonMapTexID; float attenuation; bool useTriangles; bool blurCauCubeMap; //inherited void photonMapRunChanged(RenderingRun* run); //inherited void causticCubeMapRunChanged(RenderingRun* run); //inherited void distanceCubeMapRunChanged(RenderingRun* run); //inherited void distanceCubeMapRunUpdated(RenderingRun* run); //inherited RenderingRun* createPhotonMapRun(); //inherited RenderingRun* createCausticCubeMapRun(); //inherited RenderingRun* createDistanceCubeMapRun(); }; class OgreCausticCasterRenderTechniqueFactory : public RenderTechniqueFactory { public: OgreCausticCasterRenderTechniqueFactory(); OgreRenderTechnique* createInstance(IllumTechniqueParams* params, Pass* pass, OgreRenderable* parentRenderable, OgreTechniqueGroup* parentTechniqueGroup); float attenuation; unsigned long startFrame; unsigned long photonMapUpdateInterval; unsigned int photonMapResolution; unsigned int causticCubeMapResolution; String photonMapMaterialName; String causticMapMaterialName; unsigned char photonMapTexID; bool updateAllFace; bool useDistance; bool useTriangles; bool blurCauCubeMap; };