1 | #pragma once
|
---|
2 | #include "RenderingRun.h"
|
---|
3 |
|
---|
4 | /**
|
---|
5 | @brief Base abstract class 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 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 | /**
|
---|
26 | @brief Called if the changed run is a PhotonMapRenderingRun.
|
---|
27 |
|
---|
28 | @param run pointer to the changed PhotonMapRenderingRun
|
---|
29 | */
|
---|
30 | virtual void photonMapChanged(RenderingRun* run) = 0;
|
---|
31 |
|
---|
32 | protected:
|
---|
33 |
|
---|
34 | /**
|
---|
35 | @brief defines if all cubemap faces should be updated in a frame or only one face per frame
|
---|
36 | */
|
---|
37 | bool updateAllFace;
|
---|
38 | /**
|
---|
39 | @brief the number of the face to be updated
|
---|
40 | */
|
---|
41 | unsigned char currentFace;
|
---|
42 |
|
---|
43 | /**
|
---|
44 | @brief the resolution of the cubemap texture that was created by this run
|
---|
45 | */
|
---|
46 | unsigned int resolution;
|
---|
47 |
|
---|
48 | /**
|
---|
49 | @brief Creates a cubemap texture used for the caustic-cubemap.
|
---|
50 | */
|
---|
51 | virtual inline void createCausticCubeMap() = 0;
|
---|
52 | /**
|
---|
53 | @brief Updates one face of the cubemap.
|
---|
54 |
|
---|
55 | @param facenum the number of the face to be updated
|
---|
56 | */
|
---|
57 | virtual inline void updateCubeFace(int facenum) = 0;
|
---|
58 | /**
|
---|
59 | @brief Checks if a cubemap face needs to be updated.
|
---|
60 |
|
---|
61 | If the object we are updating the cubemap for is far from the camera, or too small, or
|
---|
62 | the given cubemapface does not have significant effect on the rendering the face can be skipped.
|
---|
63 |
|
---|
64 | @param facenum the number of the face to be checked
|
---|
65 | */
|
---|
66 | virtual bool faceNeedsUpdate(int facenum) = 0;
|
---|
67 |
|
---|
68 | //inherited
|
---|
69 | virtual void updateFrame(unsigned long frameNum);
|
---|
70 |
|
---|
71 | };
|
---|