1 | #pragma once
|
---|
2 | #include "RenderingRun.h"
|
---|
3 |
|
---|
4 | /**
|
---|
5 | @brief Base abstract class __declspec( dllexport ) that defines a rendering process of a caustic cubemap.
|
---|
6 |
|
---|
7 | A caustic cubemap stores caustic light spots caused by a caustic emitter object.
|
---|
8 | */
|
---|
9 | class __declspec( dllexport ) CausticCubeMapRenderingRun : virtual public RenderingRun
|
---|
10 | {
|
---|
11 | public:
|
---|
12 | /**
|
---|
13 | @brief Constructor.
|
---|
14 |
|
---|
15 | @param startFrame adds an offset to the current frame number to help evenly distribute updates between frames
|
---|
16 | @param updateInterval photon map update frequency
|
---|
17 | @param resolution photon map resolution
|
---|
18 | @param updateAllFace defines if all cubemap faces should be updated in a frame or only one face per frame
|
---|
19 | */
|
---|
20 | CausticCubeMapRenderingRun(unsigned long startFrame,
|
---|
21 | unsigned long updateInterval,
|
---|
22 | unsigned int resolution,
|
---|
23 | bool updateAllFace);
|
---|
24 |
|
---|
25 | virtual ~CausticCubeMapRenderingRun(){}
|
---|
26 |
|
---|
27 | /**
|
---|
28 | @brief Called if the changed run is a PhotonMapRenderingRun.
|
---|
29 |
|
---|
30 | @param run pointer to the changed PhotonMapRenderingRun
|
---|
31 | */
|
---|
32 | virtual void photonMapChanged(RenderingRun* run) = 0;
|
---|
33 |
|
---|
34 | protected:
|
---|
35 |
|
---|
36 | /**
|
---|
37 | @brief defines if all cubemap faces should be updated in a frame or only one face per frame
|
---|
38 | */
|
---|
39 | bool updateAllFace;
|
---|
40 | /**
|
---|
41 | @brief the number of the face to be updated
|
---|
42 | */
|
---|
43 | unsigned char currentFace;
|
---|
44 |
|
---|
45 | /**
|
---|
46 | @brief the resolution of the cubemap texture that was created by this run
|
---|
47 | */
|
---|
48 | unsigned int resolution;
|
---|
49 |
|
---|
50 | /**
|
---|
51 | @brief Creates a cubemap texture used for the caustic-cubemap.
|
---|
52 | */
|
---|
53 | virtual inline void createCausticCubeMap() = 0;
|
---|
54 | /**
|
---|
55 | @brief Updates one face of the cubemap.
|
---|
56 |
|
---|
57 | @param facenum the number of the face to be updated
|
---|
58 | */
|
---|
59 | virtual inline void updateCubeFace(int facenum) = 0;
|
---|
60 | /**
|
---|
61 | @brief Checks if a cubemap face needs to be updated.
|
---|
62 |
|
---|
63 | If the object we are updating the cubemap for is far from the camera, or too small, or
|
---|
64 | the given cubemapface does not have significant effect on the rendering the face can be skipped.
|
---|
65 |
|
---|
66 | @param facenum the number of the face to be checked
|
---|
67 | */
|
---|
68 | virtual bool faceNeedsUpdate(int facenum) = 0;
|
---|
69 |
|
---|
70 | //inherited
|
---|
71 | virtual void updateFrame(unsigned long frameNum);
|
---|
72 |
|
---|
73 | };
|
---|