#pragma once #include "CubeMapRenderTechnique.h" /** @brief Base abstract class __declspec( dllexport ) of rendering a color cube map which will be reduced. This technique defines that the final rendering of an object needs a reduced sized cubmap of the colors of the surrounding environment. This reduced sized cubemap is created with averaging the original cubemap. This reduced cubemap can easily be convolved in the final shading to acheve special effects like diffuse reflections. */ class __declspec( dllexport ) ConvolvedCubeMapRenderTechnique : virtual public CubeMapRenderTechnique { public: /** @brief Constructor. @param startFrame adds an offset to the current frame number to help evenly distribute updates between frames @param cubeMapUpdateInterval update frequency @param cubeMapResolution color cubemap resolution @param reducedCubeMapResolution the resolution of the reduced cube map @param useDistCalc flag to skip cube face update if object is far away @param useFaceAngleCalc flag to skip cube face update if face is neglible @param distTolerance distance tolerance used in face skip @param angleTolerance angle tolerance used in face skip @param updateAllFace defines if all cubemap faces should be updated in a frame or only one face per frame @param renderSelf sets if the object should be rendered to the cube map @param renderEnvironment sets if the environment should be rendered to the cube map @param parentRenderable the object to operate on @param parentTechniqueGroup the TechniqueGroup this RenderedTechnique is attached to */ ConvolvedCubeMapRenderTechnique( unsigned long startFrame, unsigned long cubeMapUpdateInterval, unsigned int cubeMapResolution, unsigned int reducedCubeMapResolution, bool useDistCalc, bool useFaceAngleCalc, float distTolerance, float angleTolerance, bool updateAllFace, bool renderSelf, bool renderEnvironment, ElementaryRenderable* parentRenderable, TechniqueGroup* parentTechniqueGroup ); virtual ~ConvolvedCubeMapRenderTechnique(); /** @brief Updates the resources in the given frame. @param frameNum the actual framenumber */ virtual void update(unsigned long frameNum); //inherited void runChanged(RenderingRunType runType, RenderingRun* run); protected: /** @brief The resolution of the downsampled cubemap created by this run. */ unsigned int reducedCubeMapResolution; /** @brief Called if the changed run is a ReducedCubeMapRenderingRun. @param run pointer to the changed ReducedCubeMapRenderingRun */ virtual void reducedCubeMapRunChanged(RenderingRun* run) = 0; /** @brief Called if the changed run is a CubeMapRenderingRun (containing colors of the environment). @param run pointer to the changed CubeMapRenderingRun */ virtual void colorCubeMapRunChanged(RenderingRun* run) = 0; /** @brief Creates a ReducedCubeMapRenderingRun. @return the new ReducedCubeMapRenderingRun instance. */ virtual RenderingRun* createReducedCubeMapRun() = 0; };