#pragma once //disable inheritance warning caused by multiple inheritance #if _WIN32 #if _MSC_VER #pragma warning(disable: 4250) #endif #endif #include "OgreRenderTechnique.h" #include "IllumVolumeRenderTechnique.h" /** @brief IllumVolumeRenderTechnique used in an OGRE environment. */ class __declspec( dllexport ) OgreIllumVolumeRenderTechnique : public OgreRenderTechnique, public IllumVolumeRenderTechnique { public: /** @brief Constructor. @param startFrame adds an offset to the current frame number to help evenly distribute updates between frames @param illumVolumeUpdateInterval the update frequency of the light volume @param illumTextureResolution the resolution of the light volume texture @param textureDepth the number of layers to use (should be set to 1) @param illumTexID the id of the texture unit state the resulting illum volume should be bound to @param useDistCalc flag to skip updates if the shaded particle system is far away (not used) @param materialName the name of the material that is used while rendering the light volume @param lightMatrixGPUParamName the name of the gpu program parameter where the light matrix should be bound to @param useHierarchicalImpostor set this flag to true if the particle system is a hierarchical particle system @param impostorTexID the id of the texture unit state where the impostor image of the smaller system 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 */ OgreIllumVolumeRenderTechnique(unsigned long startFrame, unsigned long illumVolumeUpdateInterval, unsigned int illumTextureResolution, unsigned int textureDepth, unsigned char illumTexID, bool useDistCalc, String materialName, String lightMatrixGPUParamName, bool useHierarchicalImpostor, unsigned char impostorTexID, Pass* pass, OgreRenderable* parentRenderable, OgreTechniqueGroup* parentTechniqueGroup ); /** @brief Destructor. */ virtual ~OgreIllumVolumeRenderTechnique(); protected: /** @brief the name of the material that is used while rendering the light volume */ String materialName; /** @brief the id of the texture unit state the resulting illumevolume should be bound to */ unsigned char illumTexID; /** @brief the name of the gpu program parameter where the light matrix should be bound to */ String lightMatrixGPUParamName; /** @brief the id of the texture unit state where the impostor image of the smaller system should be bound to */ unsigned char impostorTexID; //inherited RenderingRun* createLightVolumeRenderingRun(); //inherited void lightVolumeChanged(RenderingRun* run); //inherited void lightVolumeUpdated(RenderingRun* run); //inherited void hierarchicalImpostorUpdated(RenderingRun* run); }; /** @brief RenderTechniqueFactory to create OgreIllumVolumeRenderTechnique instances. */ class __declspec( dllexport ) OgreIllumVolumeRenderTechniqueFactory : public RenderTechniqueFactory { public: OgreIllumVolumeRenderTechniqueFactory(); OgreRenderTechnique* createInstance(IllumTechniqueParams* params, Pass* pass, OgreRenderable* parentRenderable, OgreTechniqueGroup* parentTechniqueGroup); virtual bool needMaterialCopy(IllumTechniqueParams* params){return true;} String materialName; unsigned char illumTexID; unsigned long startFrame; unsigned long illumVolumeUpdateInterval; unsigned int illumTextureResolution; unsigned int textureDepth; bool useDistCalc; String lightMatrixGPUParamName; unsigned char impostorTexID; bool useHierarchicalImpostor; };