#pragma once //disable inheritance warning caused by multiple inheritance #if _WIN32 #if _MSC_VER #pragma warning(disable: 4250) #endif #endif #include "OgreRenderTechnique.h" #include "HierarchicalParticleSystemTechnique.h" /** @brief HierarchicalParticleSystemTechnique used in an OGRE environment. */ class __declspec( dllexport ) OgreHierarchicalParticleSystemTechnique : public OgreRenderTechnique, public HierarchicalParticleSystemTechnique { public: /** @brief Constructor. @param startFrame adds an offset to the current frame number to help evenly distribute updates between frames @param impostorUpdateInterval update frequency of the impostor texture (image of the smaller system) @param impostorResolution resolution of the impostor texture @param impostorTexID the id of the texture unit state the impostor image should be bound to @param useDistCalc flag to skip impostor update if object is far away (//not used) @param perspectiveRendering sets if the impostor should be rendered with a perspective projection or orthogonal @param childPSysScriptName name of the small particle system script @param useOwnMaterial use the material for the smaller system that was defined in the particle script @param impostorMaterialName use this specific material for the small particle system @param useVParam bound particle radius to a gpu vertex program parameter @param VParamRadius name of the gpu vertex program parameter the particle radius should be bound to @param useFParam bound particle radius to a gpu fragment program parameter @param FParamRadius name of the gpu fragment program parameter the particle radius 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 */ OgreHierarchicalParticleSystemTechnique(unsigned long startFrame, unsigned long impostorUpdateInterval, unsigned int impostorResolution, unsigned char impostorTexID, bool useDistCalc, bool perspectiveRendering, String childPSysScriptName, bool useOwnMaterial, String impostorMaterialName, bool useVParam, String VParamRadius, bool useFParam, String FParamRadius, Pass* pass, OgreRenderable* parentRenderable, OgreTechniqueGroup* parentTechniqueGroup ); /** @brief Destructor. */ virtual ~OgreHierarchicalParticleSystemTechnique(); protected: /** @brief use this specific material for the small particle system */ String impostorMaterialName; /** @brief name of the small particle system script */ String childPSysScriptName; /** @brief name of the created child particle system */ String childPSysName; /** @brief the id of the texture unit state the impostor image should be bound to */ unsigned char impostorTexID; /** @brief use the material for the smaller system that was defined in the particle script */ bool useOwnMaterial; /** @brief name of the gpu vertex program parameter the particle radius should be bound to */ String VParamRadius; /** @brief name of the gpu fragment program parameter the particle radius should be bound to */ String FParamRadius; /** @brief bound particle radius to a gpu vertex program parameter */ bool useVParam; /** @brief bound particle radius to a gpu fragment program parameter */ bool useFParam; //inherited RenderingRun* createChildPSysRenderingRun(); //inherited RenderingRun* createLightVolumeRenderingRun(); //inherited virtual void impostorChanged(RenderingRun* run); //inherited virtual void impostorUpdated(RenderingRun* run); }; /** @brief RenderTechniqueFactory to create OgreHierarchicalParticleSystemTechnique instances. */ class __declspec( dllexport ) OgreHierarchicalParticleSystemTechniqueFactory : public RenderTechniqueFactory { public: OgreHierarchicalParticleSystemTechniqueFactory(); OgreRenderTechnique* createInstance(IllumTechniqueParams* params, Pass* pass, OgreRenderable* parentRenderable, OgreTechniqueGroup* parentTechniqueGroup); virtual bool needMaterialCopy(IllumTechniqueParams* params){return true;} unsigned long impostorUpdateInterval; unsigned int impostorResolution; unsigned long startFrame; bool useDistCalc; unsigned char impostorTexID; bool perspectiveRendering; String impostorMaterialName; String childPSysScriptName; bool useOwnMaterial; String VParamRadius; String FParamRadius; bool useVParam; bool useFParam; };