#pragma once #include "RenderTechnique.h" /** @brief Base abstract class __declspec( dllexport ) of rendering a cube map. This technique defines that the final rendering of an object needs a cubmap of the surrounding environment and/or the object itself. */ class __declspec( dllexport ) CubeMapRenderTechnique : virtual public RenderTechnique { 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 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 layer the layer of this cubemap @param parentRenderable the object to operate on @param parentTechniqueGroup the TechniqueGroup this RenderedTechnique is attached to */ CubeMapRenderTechnique( unsigned long startFrame, unsigned long cubeMapUpdateInterval, unsigned int cubeMapResolution, bool useDistCalc, bool useFaceAngleCalc, float distTolerance, float angleTolerance, bool updateAllFace, bool renderSelf, bool renderEnvironment, int layer, ElementaryRenderable* parentRenderable, TechniqueGroup* parentTechniqueGroup ); virtual ~CubeMapRenderTechnique(); //inherited void runChanged(RenderingRunType runType, RenderingRun* run); //inherited void runUpdated(RenderingRunType runType, RenderingRun* run); protected: /** @brief a flag to skip cube face update if object is far away or too small. @see distTolerance */ bool useDistCalc; /** @brief a flag to skip cube face update the face is neglible. @see angleTolerance */ bool useFaceAngleCalc; /** @brief A value used in face skip test. The higher this value gets the more precise, but slower the method will be. */ float distTolerance; /** @brief A value used in face skip test. The higher this value gets the more precise, but slower the method will be. */ float angleTolerance; /** @brief defines if all cubemap faces should be updated in a frame or only one face per frame */ bool updateAllFace; /** @brief color-cubemap update frequency */ unsigned long cubeMapUpdateInterval; /** @brief color-cubemap resolution */ unsigned int cubeMapResolution; /** @brief offset in frame number used during update */ unsigned long startFrame; /** @brief Sets if the object should be rendered to the cube map */ bool renderSelf; /** @brief Sets if the environment should be rendered to the cube map */ bool renderEnvironment; /** @brief The layer of the cubemap. This extension was created to achieve effect such as multiple reflections and refractions that require more complete sampling of the scene. With this extension we can render the environment into several cubemap layers eg. with depth peeling. */ int layer; /** @brief The exact run type of this run (according to the actual layer). */ RenderingRunType cubemapLayer; /** @brief Creates a CubeMapRenderingRun. @return the new CubeMapRenderingRun instance. */ virtual RenderingRun* createCubeMapRun() = 0; /** @brief Called if the changed run is a CubeMapRenderingRun. @param run pointer to the new CubeMapRenderingRun */ virtual void cubeMapRunChanged(RenderingRun* run) = 0; /** @brief Called if the updated run is a CubeMapRenderingRun. @param run pointer to the updated CubeMapRenderingRun */ virtual void cubeMapRunUpdated(RenderingRun* run) = 0; };