#pragma once #include "RenderTechnique.h" /** @brief Base abstract class __declspec( dllexport ) of rendering a light volume of a particle system. Light volumes are used when self shadowing of particle systems should be simulated. Each layer of the volume represents the amount of transmitted light. The current implementation uses four grayscale layers, and places these layers to the four channel of the light volume texture. */ class __declspec( dllexport ) IllumVolumeRenderTechnique : virtual public RenderTechnique { 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 useDistCalc flag to skip updates if the shaded particle system is far away (not used) @param useHierarchicalImpostor set this flag to true if the particle system is a hierarchical particle system @param parentRenderable the object to operate on @param parentTechniqueGroup the TechniqueGroup this RenderedTechnique is attached to */ IllumVolumeRenderTechnique( unsigned long startFrame, unsigned long illumVolumeUpdateInterval, unsigned int illumTextureResolution, unsigned int textureDepth, bool useDistCalc, bool useHierarchicalImpostor, ElementaryRenderable* parentRenderable, TechniqueGroup* parentTechniqueGroup ); virtual ~IllumVolumeRenderTechnique(); //inherited void update(unsigned long frameNum); //inherited void runChanged(RenderingRunType runType, RenderingRun* run); //inherited void runUpdated(RenderingRunType runType, RenderingRun* run); protected: /** @brief the update frequency of the light volume */ unsigned long illumVolumeUpdateInterval; /** @brief the resolution of the light volume texture */ unsigned int illumTextureResolution; /** @brief the number of layers to use (should be set to 1) */ unsigned int textureDepth; /** @brief offset in frame number used during update */ unsigned long startFrame; /** @brief flag to skip updates if the shaded particle system is far away (not used) */ bool useDistCalc; /** @brief set this flag to true if the particle system is a hierarchical particle system */ bool useHierarchicalImpostor; /** @brief creates a light volume rendering run needed by this technique @return pointer to the created LightVolumeRenderingRun instance */ virtual RenderingRun* createLightVolumeRenderingRun()=0; /** @brief Called if the LightVolumeRenderingRun is chaged @param pointer to the new LightVolumeRenderingRun instance to use */ virtual void lightVolumeChanged(RenderingRun* run) = 0; /** @brief Called if the LightVolumeRenderingRun is updated @param pointer to the updated LightVolumeRenderingRun instance */ virtual void lightVolumeUpdated(RenderingRun* run) = 0; /** @brief Called if the ChildParticleSystemRenderingRun is chaged Only called if this particle system is a hierarchical particle system. @param pointer to the new ChildParticleSystemRenderingRun instance to use */ virtual void hierarchicalImpostorUpdated(RenderingRun* run) = 0; };