#pragma once #include "RenderTechnique.h" /** @brief Base abstract class __declspec( dllexport ) of rendering a hierarchical particle system. A hierarchical particle system is a particle system made out of a smaller particle system. It renders an image of the smaller particle system and multiplies this image to achieve a bigger particle system. This way fewer computation is needed to simulate large number of particles, while the trick is usually unnoticable. */ class __declspec( dllexport ) HierarchicalParticleSystemTechnique : virtual public RenderTechnique { 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 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 parentRenderable the object to operate on @param parentTechniqueGroup the TechniqueGroup this RenderedTechnique is attached to */ HierarchicalParticleSystemTechnique( unsigned long startFrame, unsigned long impostorUpdateInterval, unsigned int impostorResolution, bool useDistCalc, bool perspectiveRendering, ElementaryRenderable* parentRenderable, TechniqueGroup* parentTechniqueGroup ); virtual ~HierarchicalParticleSystemTechnique(); //inherited void update(unsigned long frameNum); //inherited void runChanged(RenderingRunType runType, RenderingRun* run); //inherited void runUpdated(RenderingRunType runType, RenderingRun* run); protected: /** @brief update frequency of the impostor texture (image of the smaller system) */ unsigned long impostorUpdateInterval; /** @brief resolution of the impostor texture */ unsigned int impostorResolution; /** @brief offset in frame number used during update */ unsigned long startFrame; /** @brief flag to skip impostor update if object is far away (//not used) */ bool useDistCalc; /** @brief sets if the impostor should be rendered with a perspective projection or orthogonal */ bool perspectiveRendering; /** @brief Creates the ChildParticleSystemRenderingRun needed by this technique. @return pointer to the ChildParticleSystemRenderingRun created instance */ virtual RenderingRun* createChildPSysRenderingRun()=0; /** @brief Called if the impostor rendering run changed. @param run pointer to the new ChildParticleSystemRenderingRun instance to use */ virtual void impostorChanged(RenderingRun* run) = 0; /** @brief Called if the impostor rendering run is updated. @param run pointer to the updated ChildParticleSystemRenderingRu. */ virtual void impostorUpdated(RenderingRun* run) = 0; };