#pragma once #include "RenderingRun.h" /** @brief Base abstract class __declspec( dllexport ) that defines a rendering process of a caustic cubemap. A caustic cubemap stores caustic light spots caused by a caustic emitter object. */ class __declspec( dllexport ) CausticCubeMapRenderingRun : virtual public RenderingRun { public: /** @brief Constructor. @param startFrame adds an offset to the current frame number to help evenly distribute updates between frames @param updateInterval photon map update frequency @param resolution photon map resolution @param updateAllFace defines if all cubemap faces should be updated in a frame or only one face per frame */ CausticCubeMapRenderingRun(unsigned long startFrame, unsigned long updateInterval, unsigned int resolution, bool updateAllFace); virtual ~CausticCubeMapRenderingRun(){} /** @brief Called if the changed run is a PhotonMapRenderingRun. @param run pointer to the changed PhotonMapRenderingRun */ virtual void photonMapChanged(RenderingRun* run) = 0; protected: /** @brief defines if all cubemap faces should be updated in a frame or only one face per frame */ bool updateAllFace; /** @brief the number of the face to be updated */ unsigned char currentFace; /** @brief the resolution of the cubemap texture that was created by this run */ unsigned int resolution; /** @brief Creates a cubemap texture used for the caustic-cubemap. */ virtual inline void createCausticCubeMap() = 0; /** @brief Updates one face of the cubemap. @param facenum the number of the face to be updated */ virtual inline void updateCubeFace(int facenum) = 0; /** @brief Checks if a cubemap face needs to be updated. If the object we are updating the cubemap for is far from the camera, or too small, or the given cubemapface does not have significant effect on the rendering the face can be skipped. @param facenum the number of the face to be checked */ virtual bool faceNeedsUpdate(int facenum) = 0; //inherited virtual void updateFrame(unsigned long frameNum); };